Procinfo gathers system data from /proc and prints it to the screen. The program has been around since the infancy of Linux. There are some patches for procinfo here. Now, Red Hat has been patching this for a long time. Here is a change log for the current patches. The original sources were a bit […]
Procinfo
LVM Support for the Linux 2.4 Kernel – Device Mapper
We decided to build a very small box to serve up an iSCSI target using LVM for the storage device. We used the root filesystem from here, which means that we are starting from a very basic system. We are using version 2.4.32 of the Linux kernel. Do consider Openfiler if you have more sophisticated […]
LVM Support for the Linux 2.4 Kernel – Compiling and Configuring LVM
Now that the device mapper is all happy (see this article), let’s install the LVM software. Grab the source from here. Extract, configure, compile, and install: sv-1# tar -xzf LVM2.2.01.15.tgz sv-1# cd LVM2.2.01.15 sv-1# ./configure –prefix=/usr checking build system type… i686-pc-linux-gnu checking host system type… i686-pc-linux-gnu checking target system type… i686-pc-linux-gnu checking for gawk… gawk […]
Rename and Increment Files with Bash
Doing a visual audit of a data center with a digital camera is a quick and easy way to help get your bearings when assisting remote hands. We have a bunch of pictures we took of our server racks. Notice that some pictures that weren’t very good are already deleted: $ ls IMG_0918.JPG IMG_0925.JPG IMG_0931.JPG […]
Determining GTK Version
We had a program, mcjl, that appeared to run on GTK 2.6, but the vendor said it needed GTK 2.8. To show what libraries the program uses, use ldd: root:~/newmcj# ldd mcjl linux-gate.so.1 => (0xb808d000) libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb7daf000) libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb7d43000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7d3f000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7cbd000) libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7cb8000) […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 1
We tried installing Ubuntu 9.04 on our MacBook. That worked OK, but the mouse (touch pad) acted a little bit wonky. Now, when things are wonky, “use the source, Luke!”. At least, dig down enough into the source to tailor to the hardware and just do what you need. NoNIC V3 has a distribution that […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 2
Stop! Before you do anything, realize that you might just render your MacBook unbootable. Make sure you have a full backup and your original install DVDs. See this site’s Terms of Use. Still with us? Well… let’s continue. The first step is to run boot camp: This will create an extra partition on your hard […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 3
Stop! Before you do anything, realize that you might just render your MacBook unbootable. Make sure you have a full backup and your original install DVDs. See this site’s Terms of Use. Here is what our partitions look like after installing. This is what Partition Inspector, the tool that comes with rEFIt says: *** Report […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 4
Stop! Before you do anything, realize that you might just render your MacBook unbootable. Make sure you have a full backup and your original install DVDs. See this site’s Terms of Use. Still with us? Well, we need to boot up using SystemRescueCD. Now, one thing that is really strange is that if you get […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 5
You still with us? If you tuned in part way through this article, or happened to miss it, let us just say… Stop! Before you do anything, realize that you might just render your MacBook unbootable. Make sure you have a full backup and your original install DVDs. See this site’s Terms of Use. When […]
Installing GNU/Linux on a MacBook Intel Core 2 Duo – 6
The system should all be live and happy after you reboot. Here is the lilo bootloader: We are particularly fond of using X style copy/paste. This sequence of commands will remap the 2nd and 3rd mouse buttons to F11 and F12: sysctl -w dev.mac_hid.mouse_button_emulation=1 sysctl -w dev.mac_hid.mouse_button3_keycode=174 sysctl -w dev.mac_hid.mouse_button2_keycode=176 setxkbmap -layout us xkbset m […]
Using Tar to Extract a Single File or Directory
It may just be me… but… One thing I tend to do is extract entire tarballs, find the file I want, and then copy the file. Tar can be used to extract a single file from the archive. Further, it will extract the tree. Let’s take a peek at the archive using head and the […]
Renaming a Bunch of Files to Random Names
Say you have a bunch of files in a directory and you want to turn them all into random file names. Run this command from Bash: for fname in *; do mv “$fname” $RANDOM.fil; done
Split Large Files Into Smaller Pieces
Use the split command to carve up a large file into multiple pieces, and put them back together again with cat. Use md5sum to double check your results: split -n 2 bigfile.tar.bz2 mkdir tmp mv bigfile.tar.bz2 tmp ls xaa xab cat xa* > bigfile.tar.bz2 md5sum bigfile.tar.bz2 08d860e55381aa87b2084449589d2dce bigfile.tar.bz2 md5sum tmp/bigfile.tar.bz2 08d860e55381aa87b2084449589d2dce tmp/bigfile.tar.bz2 You can also […]
Rename All Filenames With Spaces to Underline
If you want to just rename a space to an underline in all filenames in a directory, try: for fname in *; do mv “$fname” `echo $fname | tr ‘ ‘ ‘_’`; done
Extending a Logical Volume
In this article, we set up Logical Volume Manager for GNU/Linux. We created a 12 GB device from 3 4 Gig drives, but only assigned 5 GB for our logical volume. Now, we are going to extend that volume. [Note: Before you do anything involving your partitions or volumes, make a complete backup. Make sure […]