The fusion of technology, business, and life

Archive for March, 2009

Saving time and bandwidth with apt-cacher

Saving time and bandwidth are two things every system administrator loves. Implementing apt-cacher could save you a considerable amount of both, depending on the number of servers you have. As the name implies, apt-cacher caches packages and package lists for apt packaging systems on Debian or Debian-like systems. Here's how I recently implemented apt-cacher:

apt-get install apt-cacher

I edited /etc/apt-cacher/apt-cacher.conf

cache_dir=/path/to/cache/directory
admin_email=your@email.com
daemon_addr=IPADDRESS

I also edited /etc/default/apt-cacher and set:

AUTOSTART=1

Then ran:

/etc/init.d/apt-cacher start

I imported the existing files apt-get had locally archived:

/usr/share/apt-cacher/apt-cacher-import.pl -r /var/cache/apt/archives

Finally, I edited /etc/apt/sources.list on the apt-cacher server, and each client server:

deb http://hostname:3142/ftp.us.debian.org/debian/ lenny main non-free contrib
deb-src http://hostname:3142/ftp.us.debian.org/debian/ lenny main non-free contrib

deb http://hostname:3142/security.debian.org/ lenny/updates main non-free contrib
deb-src http://hostname:3142/security.debian.org/ lenny/updates main non-free contrib
2 comments

2008 Infiniti M35 Auxiliary Inputs: Non-Nav Video "Hack"

As I previously discussed, I recently got a 2008 Infiniti M35 and am building a carputer to put in it. On the base model M35 (without navigation), there are auxiliary RCA inputs located behind the center armrest; however, when the car is moving or the parking brake is off, the auxiliary video input is disabled.

Since the carputer will use the auxiliary video input to display its content on the car's monitor, I needed to enable the auxiliary video input when the car is in motion. Although there are several great posts about enabling advanced navigation features while the M35 is moving, the "navigation hack" (registration required), doesn't apply to my non-nav/base M35.

Since I couldn't find any specific information about non-nav 2008 M35 models, and the wiring harnesses shown in the "navigation hack" are different, I had to do some research and testing to determine how to enable the auxiliary video inputs while the vehicle is moving. (On the positive side, I didn't need to add a switch in the glove box or cabin since my AV control unit doesn't use the vehicle speed sensor for navigation, which makes my mod more simple than the "navigation hack".) From the existing "navigation hack" descriptions, I knew I needed to look at two wires: the parking brake signal, and the vehicle speed sensor.

In order to access the AV control unit, I had to remove the cup holder, seat heater controls, shifter area, and the clock panel. For more detailed instructions on removing those items, with pictures, check the "navigation hack" thread. At first, I thought that simply cutting the parking brake signal wire and vehicle speed sensor would be sufficient; however, I eventually realized that they both actually had to be grounded. After cutting those two wires ~3" from the harness, I stripped 3/4″ off the ends still attached to the harness and used a wire nut to tie the two wires together with a piece of speaker wire, which I attached to a Torx bolt on the AV control unit’s metal frame.

Here's the wiring harnesses attached to the AV control unit, with the ones I modified marked in yellow, and the description of the parking brake signal and vehicle speed sensor wires (click to view the full-size images):

Disclaimer: This post is for educational purposes only. Although I have attempted to present accurate information, I can't guarantee the information is correct or applicable to your specific car. Modifying your M35 in this manner may void part or all of your warranty, cause damage to your car, cause unintended effects in your car's operation, cause injury to yourself or others, or be illegal in your jurisdiction.

17 comments

Debian NAS using AoE (Part 2)

As I mentioned in Debian NAS using AoE (Part 1), I recently needed to implement a low-cost, enterprise grade storage system for backups and to provide network attached storage for vserver-based Debian servers. I was able to build a suitable storage server with 13TB of raw storage for a reasonable price, and decided to use Debian with LVM2 and AoE to divide and share it across the network.

Before getting to the OS installation, I had to setup and build the RAID arrays in the HighPoint 3540 BIOS. I set up a RAID 1 mirror of the two 300GB drives to use for the OS. Then, I created a 6-disk RAID6 and a 7-disk RAID6, which left me with 4GB and 5GB of usage storage.

Next, I installed Debian Lenny from the Lenny netinst ISO onto the 300GB RAID 1 mirror I created, with no additional packages/package groups selected. After the installation was complete, I rebooted the server to install openssh server, lvm2, and AoE. Since I wanted to be able to use the storage server to run vserver instances if needed, I also installed the vserver kernel and tools:

apt-get update
apt-get install vserver-debiantools linux-image-2.6-vserver-amd64 lvm2 vblade vblade-persist aoe-tools

I configured LVM to recognize the physical volumes:

pvcreate /dev/sdb
pvcreate /dev/sdc

I created the volume groups data1 and data2 on the physical volumes:

vgcreate data1 /dev/sdb
vgcreate data2 /dev/sdc

I created two 1TB LVM logical partitions (/dev/data1/backups, /dev/data1/backups2):

lvcreate -L 1TB -n backups data1
lvcreate -L 1TB -n backups2 data1

I made the ext3 filesystem on them so they would be usable:

mkfs.ext3 /dev/data1/backups
mkfs.ext3 /dev/data1/backups2

I configured AoE (ATA over Ethernet):

modprobe aoe

vblade-persist setup 0 1 eth0 /dev/data1/backups
vblade-persist setup 0 2 eth0 /dev/data1/backups2

vblade-persist start 0 1
vblade-persist start 0 2

Finally, I verified they were up and available using:

aoe-discover
aoe-stat

Output from aoe-stat… :

e0.1 1099.511GB eth1 up
e0.2 1099.511GB eth1 up

To mount an AoE export on a remote server, I used the following (on the remote server):

modprobe aoe
apt-get install aoetools
aoe-discover
aoe-stat (should show the available AoE exports)
mkdir /mountpoint
mount /dev/etherd/e0.1 /mountpoint (replace e0.1 with the appropriate device from aoe-stat)
3 comments