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
Build Your Own Cat5 Cable Tester – Introduction
We designed and built a device that will test the basic integrity of a straight through or crossover cable. All you have to do is plug the cable into the two ends of the box. The X LED will light if the cable tests OK for a crossover cable. The S LED will light if […]
Build Your Own Cat5 Cable Tester – Part 1
Part 1 – How to wire Cat5 cables, and how they work. There are many different schemes for wiring Category 5 cables, EIA/TIA 568A and 568B are the most common. We wrote up a couple pdf diagrams for these you can refer to: 568A, 568B . 568B is quite widely used, especially in the US; […]
Build Your Own Cat5 Cable Tester – Part 2
Part 2 – Circuit Design Now that we know how a Cat5 cable works, we can design a circuit to test the cable. We do know that for straight-through cables we need to ensure 1-1, 2-2, 3-3, and 6-6. For crossover cables we need to ensure 1-3, 2-6, 3-1, and 6-2. We also need to […]
Build Your Own Cat5 Cable Tester – Part 3
Part 3 – Creating the circuit board [ Note: There is an update on this process on Coprolite here that includes pictures and instructions for using a new press that is available. ] The first step to creating the circuit board is laying it out electronically. We use PCB, a program that runs on *NIX […]
Build Your Own Cat5 Cable Tester – Part 4
Part 4 – drilling the PC board and assembling Drilling the board is kind of tricky. I bought a really cheap drill press called an Octopus from Jameco. Here is a picture with a board ready to drill with the drill press: The drill bit size is key to a successful project. I use #69 […]