Category: Uncategorized

Simple FLAC to MP3 shell script

By , 2009-09-10 21:41

For unix-like systems (Mac OS X, Linux). A simple shell script to convert flac to lame mp3.

Install flac, lame and id3tool

#!/bin/bash
for a in *.flac
do
OUTLAME=`echo "$a" | sed s/\.flac$/.mp3/g`
ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
ALBUM=`metaflac "$a" --show-tag=ALBUM | sed s/.*=//g`
TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
GENRE=`metaflac "$a" --show-tag=GENRE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
YEAR=`metaflac "$a" --show-tag=DATE | sed s/.*=//g`
flac -c -d "$a" | lame -m j -q 0 --vbr-new -V 0 -s 44.1 - "$OUTLAME"
id3tool --set-title="$TITLE" --set-track="${TRACKNUMBER:-0}" --set-artist="$ARTIST" --set-album="$ALBUM" --set-year="$YEAR" --set-genre="${GENRE:-12}" "$OUTLAME"
done

Edit: Apparently this has been done before…
http://pastebin.com/f641a9b21

WTF

By , 2009-09-03 12:33

chrome

MythTV/Proxmox (OpenVZ) multi-role server from hell

By , 2009-09-01 22:35

So… I just spent two hours trying to get MythTV running properly on my OpenVZ server (installed via the Proxmox VE bare-metal installer). This is starting to be a lot harder than I thought it would be…

As seen in my previous post, I installed the 2.6.26-2-openvz-amd64 kernel and headers, and compiled v4l-dvb from mercurial, and fixed a little bug with vzctl. Today, I installed the firmware files for my Hauppage HVR-1600 (see MythTV wiki page), added the Debian-multimedia repo and installed MythTV (apt-get install mythtv). Then I realized I needed X to use mythtv-setup, so for some reason I decided to install KDE 3.5. KDE installed fine (minus some missing files for the kdm theme… wonder why these aren’t included in the kdm package or a dependency…). I then proceeded to create a password for the mythtv user ($passwd mythtv as root) and then run mythtv-setup as the mythtv user. I managed to add the sources and scan for channels, but when I tried to “Watch TV”, I was told that the primary backend wasn’t running.

I tried some troubleshooting, but it’s getting kinda late and I’m lacking sleep (as you can probably tell from my grammar), so I decided to try installing a shiny new Intel Pro 1000 Desktop (82574L) PCIe x1 Ethernet card to get my server some gigabit love. Should be simple, right? Intel cards have good driver support, with the e100 and e1000 drivers, so much so that VM solutions like VMware and VirtualBox chose to emulate them as guest hardware. Well, this was not the case today. I popped the card in to a free PCIe x1 slot and powered on the PC. Link lights went on and all looked fine and dandy. But once the machine fully booted up (takes a while with all those OpenVZ containers 😉 ), ifconfig showed only the eth0 interface, which is my built-in Realtek/nForce controller. Some further probing with lspci and dmesg showed that the card is alive, but that the e1000 driver didn’t even bother to start up.

At this point, I GIVE UP for tonight. I’m cold from sitting down in the basement, tired from lack of sleep, and frustrated from uncooperative Linux servers.

No streaming TV for me tonight, but I suppose I should be glad that at least the blog is still up and running.

Which brings to mind http://xkcd.com/349/

40% of OpenBSD installs lead to shark attacks. It's their only standing security issue.

Upgrading Proxmox VE kernel

By , 2009-08-31 16:19

I currently am running this blog from an OpenVZ server managed via Proxmox VE. One issue I had with this setup is that the Proxmox 1.3 installer by default comes with a relatively old kernel (2.6.24), and I want a newer kernel (>=2.6.26, so that I can use my cx18-based TV tuner). Fortunately, Proxmox is just a customized version of Debian Lenny, so I just installed the linux-image-2.6.26-2-openvz-amd64 package from apt, then ran update-initramfs -u and update-grub.

After updating the kernel, however, I was unable to start any of my virtual machines from the Proxmox Web UI. Looking at the system log showed a message about vzctl being 32-bit; problem solved by updating vzctl via apt.

Now I’m attempting to compile v4l-dvb…. fingers crossed!

hg clone http://linuxtv.org/hg/v4l-dvb

Door-to-door water heater scam

By , 2009-08-27 19:54

Have you been visited by a National Home Services salesman lately? These people come to your door and try to get you to sign a contract for a long-term water heater rental. You then get stuck in a 15-year contract with a high cancellation penalty. To make matters worse, these salespeople lie through their teeth. Some say water heaters last only 2-5 years, others say Direct Energy doesn’t rent water heaters… My advice is don’t buy anything sold door-to-door, unless it’s a kid selling chocolate or cookies.

Further reading: http://www.thestar.com/article/463378

Because this might be forgotten in a few years….

By , 2009-08-17 13:13

The latest Canadian Internet star!

Crasher Squirrel from National Geographic

"Crasher Squirrel" from National Geographic

Bell setting download limits on resellers

By , 2009-08-17 12:40

Looks like unlimited Internet access no longer exists for Canadians (or at least Ontarians, at any rate). The CRTC has approved a petition by Bell to charge small ISPs (TekSavvy, Velcom, Acanac) for the bandwidth they use. These small companies are currently the only way for most residential customers to get true unlimited Internet access at home. The large Canadian ISPs such as Rogers, Bell Sympatico and Videotron all limit their customers’ download traffic, forcing those who need more to upgrade to more expensive service plans. This is absolutely ridiculous. In an age of digital media, where high-bitrate HD content and streaming video are becoming more and more commonplace, along with steadily increasing Internet connection speeds, this is a big step backwards for Canadians. Furthermore, the small ISPs are now at risk of going bankrupt, since their major selling point is their unlimited or high traffic allowance.

Seems the CRTC has failed Canadians once again. Now that I’ve had my little rant, the question is, what can be done to reverse the decision, or to prevent anything worse from happening?

Speed

By , 2009-08-04 10:56

Internet connection speed today. If only it were this fast every day.

Mac OS X install on ASUS P5W DH Deluxe

By , 2009-08-02 14:58

Here’s the install procedure I used to get Mac OS X 10.5.7 running on my P5W DH:

  1. Bios settings: JMicron and Intel controllers in AHCI mode, Memory Remap enabled, Hyper path 3 disabled, CPU NX enabled
  2. Boot from generic grub/boot-132 iso.
  3. Hit Esc at boot prompt, swap disc for Mac OS X 10.5.4 DVD and press enter
  4. install Mas OS, format partition if necessary.
  5. After the install is complete, boot from boot-132 cd again. hit esc, type 80 then hit Enter.
  6. should boot into leopard, at 1024*768 resolution.
  7. Install bootloader: first PC_EFI 9 from bootloader.pkg, then Chameleon 2.0 RC2, with graphics detect option.
  8. go to /Extra/Extensions, add AppleDecrypt, AppleVIAATA (for SiI3112 PCI SATA, Disabler (AppleUpstreamUserClient Version), remove A HCIPort Injector,
  9. Install alc882 AppleHDA anrd ALCinject, pkg doesnt work, use kext helper.
  10. update to 10.5.7 using comboupdate.
  11. reinstall AppleHDA.kext

Nostalgia

By , 2009-08-01 17:11

Visited my old elementary school today. Strange sense of nostalgia, remembering the days of lining up for class, going out for recess, snacktime, playing all kinds of games in the forest and the playground, messing around with old PowerMacs, asking permission to use the washroom, “roofing” basketballs and tennis balls, building snow forts, waiting for the bus number to be called…

Custom theme by me. Based on Panorama by Themocracy