How to write zeros to a drive

March 4th, 2007

to zero hda, simply
dd if=/dev/zero of=/dev/hda bs=1M

Configuring Brother MFC-9700 in Ubuntu Dapper 6.06.1

September 30th, 2006
  1. First, create symbolic links to facilitate install the lpr driver

    # sudo ln -s /etc/init.d/cupsys /etc/init.d/lpd
    # sudo ln -s /etc/init.d/cupsys /etc/init.d/lprng
  2. Download the lpr driver from here, and the cupsys driver from here (make sure to get the Debian versions for both!!!).
  3. Then, run the following commands to create spooling directories

    # sudo mkdir /var/spool/lpd
    # sudo mkdir /var/spool/lpd/MFC9700
  4. Now, run the following command to install the LPR driver

    # sudo dpkg -i ~/Desktop/mfc9700lpr-*.i386.deb
  5. Now create a symbolic link since the brother drivers expect the cups file to be /etc/init.d/cups instead of /etc/init.d/cupsys

    # sudo ln -s /etc/init.d/cupsys /etc/init.d/cups
  6. Now install the cups wrapper driver.
    #sudo dpkg -i /home/gandalf/Desktop/cupswrapperMFC9700-*.i386.deb
  7. Finally, check the configuration settings via
    System → Administration → Printing
    Especially be sure to check the connection tab.

How to speed up CD/DVD-ROM

September 30th, 2006

e.g. Assumed that /dev/cdrom is the location of CD/DVD-ROM

sudo hdparm -d1 /dev/cdrom
sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup
gksudo gedit /etc/hdparm.conf

* Append the following lines at the end of file

/dev/cdrom {
dma = on
}

* Save the edited file

Nvidia Driver Install

September 30th, 2006

This link worked wonders. *Be sure to enable the extra repositories

Software RAID and LVM in Linux

July 24th, 2006

Software RAID in linux is turning out to be a big headache. dmraid is kicking my butt, and mdadm seems to be useful, but I haven’t fully figured it out yet. Who knew setting up a RAID array like this would be such a pain in the neck.

I got some info from this page.

I used the following command
# mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/hde1 /dev/hdf1

Which produced the following results
mdadm: size set to 244198464K
mdadm: array /dev/md0 started.

Which looks promising.

To stop the mdm array, I should use this:
# mdadm -S /dev/md0

The guide also recommends creating an /etc/mdadm.conf file.

After further investigation and experimentation, mdadm is definitely the way to go when creating software raid arrays. All other tools are outdated, and weren’t even available in apt-get or synaptic except for dmraid, which is horrible.

Part of the reason I had a hard time understanding everything with RAID and LVM and what not is because it was not clear to me how physical disks, partitions, LogicalGroups, LogicalVolumes, and arrays related to each other. This article got me headed down the right path.

First, it’s important to understand that software RAID arrays are made up of disk partitions, which are created on physical disks. I’m not sure if it matters what format the partitions are in if you’re using mdadm, but I left mine unformatted when creating them using gparted. After the array is created as /dev/md0 (or something similar) it can be formatted (in this case in xfs format using mkfs.xfs in the terminal).

LVM is somewhat similar, but has more hierarchy. LogicalVolumeGroups are composed of one or more disk partitions. Each LogicalVolumeGroup has zero or more LogicalVolumes (though a LVG isn’t useful without an LV), which can span multiple partitions (physical volumes). Just like RAID arrays, LogicalVolumes can be formatted via mkfs once they’ve been created. They can be found at /dev/_LVG_/_LV_ (where _LVG_ is your LogicalVolumeGroup name and _LV_ is the name of the LogicalVolume you which to mount).

Once the LVM and/or RAID is created, formatted, and ready to role, /etc/fstab has to modified to make sure the volumes are mounted at startup. This is pretty straightforward and can be decifered via the man pages, but this article has some good counsel

Fedora Core 5’s LVM GUI on Ubuntu

July 23rd, 2006

Great HowTo on the Ubuntu Forums as to how to get the FC5 LVM management GUI to work in Ubuntu 6.06.

HOWTO : LVM gui (Not EVMS)

Using ccXStream on Ubuntu 6.06 Server

July 22nd, 2006

Continuing with the server configuration and XBMC integration, ccXStream is a streaming server that utilizes XBMSP (Xbox Media Player Streaming Protocol). After getting my Ubuntu server installed and running, I thought I should use ccXStream because it is said to be slightly faster than crusing SMB shares.

The gzip of ccXStream linux source code was obtained from here (sourceforge link). I downloaded it to my desktop and expanded the archive to a folder on the desktop as well.

According to a linux guru friend, the best place to keep the files is /usr/local/sbin. He said that if I ever have questions about the directory hierachy, I should check out the manual pages by typing man hier in the console. Pretty self-explanatory, but worth writing down for posterity.

Because the archive contains source code, not .deb or .rpm or any other form of ready-made packages, I had to compile it myself. Unfortunately, Ubuntu doesn’t come with gcc or make (yeah, crazy!), but them easily using Synaptic to download and install the build-essential package. This gave me what I needed to compile ccXStream.

So after installing the build-essential package, I used the console and navigated to the directory containing the ccXStream source code. Then, I used the command gksudo make. After entering the password, lots of warning showed up, but no errors, which meant the code compiled and created two executables: ccxstream and ccxtest.

ccxstream is the XBMSP server itself, which listens on port 1400
ccxtest is a small client program that attempts to connect to localhost:1400

More on running ccxstream coming soon, once I figure out how to schedule it to run at startup…

Building an Ubuntu Home Media Server

July 21st, 2006

After experiencing other PVR software packages including Windows XP Media Center Edition, SnapStream Beyond TV, MediaPortal, and even MythTV, I decided to switch to Xbox Media Center and a home media server.

Fortunately, I had the majority of the components for building a home media server just lying around. I only needed a better motherboard and some hard drive coolers. Here’s what I put together:

  • Soyo Dragon KT333 Ultra Platinum Edition Motherboard
  • AMD Athlon XP Mobile 1800+ (Yes, Athlon XP Mobile processor are desktop mobo-compatible)
  • 512 MB PC 2700 DDR 333 SDRAM (may need to upgrade to 1 GB)
  • eVGA Nvidia Personal Cinema MX-440 8x AGP 64MB Graphics Card (TV tuner uses BTTV linux drivers) - capture is software-encoded
  • 2 Hauppauge PRV-150MCE L.P. TV tuner cards — still need full-height brackets (uses IVTV linux drivers) - capture is hardware-encoded
  • 1 Sony DVD+/-R Recorder
  • 5 hard drives of various sizes (two of which are 250 GB Western Digital Caviar drives setup as RAID1 using the motherboard’s onboard controller)
  • Antec 430 watt ATX Power supply
  • An ancient tower/server ATX case I bought in 1999

This server covers a variety of purposes utilizing the following software:

  • Ubuntu Linux 6.06 LTS (Dapper Drake)
  • ccXStream and ccXGui (for Xbox Media Streaming Protocol)
  • Samba (for file server and domain control)
  • Apache 2.0
  • MySQL 5.0
  • MythTV backend
  • MythWeb
  • ProFTPd
  • CUPS and Foomatic?
  • NFS
  • moblock (to block ‘bad’ IP addresses)
  • some form of UPnP Media Server (for an Omnifi DMS1)
    • TwonkyMusic?
    • GMediaServer?

D-Link’s DWL-G820 - Not bad… with a little effort

July 6th, 2006

Recently I’ve taken the initiative to SoftMod my v1.4 Xbox so that I could run Xbox Media Center (XBMC) on it, instead of using a media center PC in my living room. There’s just one problem with needing a network-connected Xbox in my living room: as of yet my house is not wired with Cat5e, and an ethernet port is the only network connection the Xbox supports. Fortunately, I do have a D-Link DI-624 wireless G router, but how to get the Xbox to connect wirelessly?

Here’s where D-Link’s DWL-G820 Wireless Gaming Adapter comes into the picture. The G820 is essentially a wireless bridge, meaning it can connect one wired portion of the network to another wired portion of the network via a wireless connection. Thus, the Xbox can connect to the G820, which connect it to the network.

Why the G820 and not something else? Well, I have a 3rd generation DI-624 D-Link wireless router, which happens to support “Super G” technology — up to 108 Mbps if connecting to compatible hardware. The DWL-G820 is “Super G” compatible. Because XBMC will be streaming music, pictures, and especially video from a network share, 11Mbps 802.11b simply will not get the job done. 54Mbps with 802.11g would probably suffice, but I thought that just to be safe (and since I already had the D-Link router) I ought to go with 108 Mbps 802.11 “Super G”. Unfortunately, since the 802.11n standard won’t be released until 2007, any implementation of 108 Mbps is vendor-specific, thus I needed a D-Link product to achieve that speed.

I purchased my G820 off eBay, taking it off the hands of someone who “couldn’t get it working.” It was a bit risky seeing that the item could actually have been malfunctioning, but I was willing to gamble that like most wireless product, the configuration was just a little bit above the average Joe’s understanding.

Indeed, configuration of the G820 was extremely convoluted. I spent at least two hours plugging the thing directly into my router and attempting to connect to it from a PC also connected to that router. I tried resetting it, thinking the previous owner may have used a custom IP address. I tried using the static IP on my PC as D-Link’s directions stated. I even tried disabling all the security on my wireless network hoping I could crawl before I walked. It all failed. I ended up calling D-Link tech support, and running through the same steps I’d just tried, hoping they might have an idea what I was doing wrong. Their conclusion — I had a faulty unit.

But I wasn’t ready to give up hope. I went digging around in my bag of cables and found an ethernet cross-over cable (meant to connect two PC’s directly together without a hub between them). Connecting the game adapter to the router via the cross-over cable didn’t yield any results, but when I connected the adapter to the PC via the cross-over cable, I noticed the status lights behaving differently. It was then that I assigned a static IP to my PC and was able to access the adapter’s configuration menu.

So in short, here’s what you have to do to get access to the DWL-G820’s configuration webpage:

1. Use an ethernet cross-over cable to connect the adapter to your PC
2. Change your computer’s TCP/IP settings to use a static IP of 192.168.0.51 and subnet mask 255.255.255.0 (disregard gateway and DNS info)
3. Use a web browser to navigate to 192.168.0.35
4. Login with username “admin” and no password
5. Configure the adapter as necessary for your wireless router/AP

But hold on, you’re not done yet. D-Link made another major mistake in the manufacture of this product. The case for the adapter is very poorly designed and facilitates frequent overheating of the adapter, which means it locks up. In the first week of use I had to restart the adapter and Xbox every time I sat down to use XBMC. It was extremely frustrating and inconvenient. In researching the problem I found countless others on the net that experience the same lock-ups, but no solution to the problem. I was again about ready to call D-Link again when I decided that maybe I could get the thing to cool off by modifying the case and possibly adding a chipset cooler.

The hardest thing about this idea was getting the case apart. It took a great deal of effort. The case can only be opened by unplugging the AC adapter and ethernet cable from the unit and removing the antenna. Once that is done, hold the unit in your strong hand such that your thumb is positioned on the seam infront of the rear “end cap” on one side of the adapter, and your index or middle finger is positioned in the corresponding spot on the other side of the adapter. Pince the case hard while using your other hand to pull on the darker colored rear “end cap”. Hopefully the cap will come off. The same procedure can be used to free the front “end cap”. Once that is done the top should come off the case.

After getting the case apart, I didn’t have time to go buy a chipset cooler, so I just left the top off and reassembled the rest of the case. Fortunately, that was enough to prevent the adapter from overheating and locking up. I’ve haven’t had to restart the DWL-G820 for over a week now! I have to admit, though, that I don’t like having all the electronics completely exposed to my living room. I am planning to modify the case by drilling holes into the top of it to facilitate better cooling.

I hope this helps anyone who has experienced similar difficulties. Please feel free to email me at “matthew” at this_domain_name_and_suffix if you have any questions.