Miscellaneous bash one liners
April 26th, 2008bash script to monitor file/dir listing in a directory
while ((1)); do ls -l | wc -l; sleep 30; done
Commands to determine/change drive UUID's
April 26th, 2008Use one of these to determine drive UUID's.
vol_id /dev/sdc1
ls -l /dev/disk/by-uuid
blkid /dev/sda1
And use this to change the UUID change uuid of an ext3 partition
uuidgen
tune2fs /dev/hdaX -U numbergeneratedbyuuidgen
verification with
vol_id /dev/hdaX
Change uuid of an ext3 partition
Adding drivers to PE images
January 28th, 2008Recently I've had a need to perform work on newer systems which have SATA drives in them. Unfortunately, my trusty Super WinPE disks haven't been working since the SATA drivers aren't included on the disk. After some searching, I've found a couple of methods which should work and settled on this one (from here):
Copy the .sys file to i386\system32\drivers. If there are related .dll files (unlikely) copy these to i386\system32.
Navigate to i386 folder and open txtsetup.sif. Add controller information to the [HardwareIdsDatabase] section. Only the PCI Vendor and Device ID are required (normally contained in the inf file)
Example: PCI\VEN_8086&DEV_2652 = "iaStor"
Now add the controller information to [SCSI.Load] in order to have it load during the boot process.
Example: iaStor = iaStor.sys,4
Many of the WinPE bootable images end up reporting significantly larger image sizes if edited. It turns out that some iso creating programs allow for optimizing the image. This means that if there are multiple copies of the same file in the image, links will be created for all but 1 file so the data is only written to the drive one time. The Super WinPE disk I normally use balooned from 4.7 gig to 22 gig after I injected the drivers. Using the optimize option in UltraISO (under file->properties) resolved this issue.
NIC Bonding
October 21st, 2007Steps for setting up NIC bonding in debian/ubuntu
1. install ifenslave-2.6
2. make changes below
3. ran update-modules
4. run modprobe bonding
5. restart the network
/etc/network/interfaces
auto lo
iface lo inet loopback
# NIC Bonding Interface
auto bond0
iface bond0 inet static
hwaddress ether 00:04:7B:30:4A:AC
address 192.168.0.22
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
up infenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1
/etc/modprobe.d aliases (made the following add/remove)
# alias net-pf-10 ipv6
alias bond0 bonding
alias eth0 e100
alias eth1 e100
options bonding mode=0 miimon=100
/etc/modutils/actions
probeall bond0 eth0 eth1 bonding
Finally got LIRC to work under 2.6
September 10th, 2007One of my major hesitations about upgrading the myth frontends to kernel 2.6 was the LIRC modules. The modules are not included with the kernel source distributions and can be tough to compile. Well, since Zap2it discontinued their free guide data service and I had upgrade Myth to accomodate the new DataDirect service, I was forced to update libc6 and thus the kernel to 2.6. Getting the LIRC modules to compile has been every bit as fun as I had anticipated and we have spent several days using the wireless keyboard to control Myth since the remote control hasn't been working. With the help of the following 2 pages I was able to finally get the modules to compile and load.
This article describes the 'new' method of compiling the lirc modules. Basically use module-assistant to do it. It would have been fantastic if the documentation had mentioned this (fantastic meaning several days worth of frustration and effort could have been saved).
Version 8 of LIRC apparently needs to have the serial port configured properly as this page details. The command is "setserial /dev/ttyS1 uart none" and as illustrated, I have added this to the /etc/rc.local file so it is executed every time the system is started.
