Monday, July 12, 2010

Lazy Linux: 10 essential tricks for admins

The best systems administrators are set apart by their efficiency. And if an efficient systems administrator can do a task in 10 minutes that would take another mortal two hours to complete, then the efficient systems administrator should be rewarded (paid more) because the company is saving time, and time is money, right?

The trick is to prove your efficiency to management. While I won't attempt to cover that trick in this article, I will give you 10 essential gems from the lazy admin's bag of tricks. These tips will save you time—and even if you don't get paid more money to be more efficient, you'll at least have more time to play Halo.

Trick 1: Unmounting the unresponsive DVD drive

The newbie states that when he pushes the Eject button on the DVD drive of a server running a certain Redmond-based operating system, it will eject immediately. He then complains that, in most enterprise Linux servers, if a process is running in that directory, then the ejection won't happen. For too long as a Linux administrator, I would reboot the machine and get my disk on the bounce if I couldn't figure out what was running and why it wouldn't release the DVD drive. But this is ineffective.

Here's how you find the process that holds your DVD drive and eject it to your heart's content: First, simulate it. Stick a disk in your DVD drive, open up a terminal, and mount the DVD drive:

# mount /media/cdrom
# cd /media/cdrom
# while [ 1 ]; do echo "All your drives are belong to us!"; sleep 30; done

Now open up a second terminal and try to eject the DVD drive:

# eject

You'll get a message like:

umount: /media/cdrom: device is busy

Before you free it, let's find out who is using it.

# fuser /media/cdrom

You see the process was running and, indeed, it is our fault we can not eject the disk.

Now, if you are root, you can exercise your godlike powers and kill processes:

# fuser -k /media/cdrom

Boom! Just like that, freedom. Now solemnly unmount the drive:

# eject

fuser is good.

Trick 2: Getting your screen back when it's hosed

Try this:

# cat /bin/cat

Behold! Your terminal looks like garbage. Everything you type looks like you're looking into the Matrix. What do you do?

You type reset. But wait you say, typing reset is too close to typing reboot or shutdown. Your palms start to sweat—especially if you are doing this on a production machine.

Rest assured: You can do it with the confidence that no machine will be rebooted. Go ahead, do it:

# reset

Now your screen is back to normal. This is much better than closing the window and then logging in again, especially if you just went through five machines to SSH to this machine.

Trick 3: Collaboration with screen

David, the high-maintenance user from product engineering, calls: "I need you to help me understand why I can't compile supercode.c on these new machines you deployed."

"Fine," you say. "What machine are you on?"

David responds: " Posh." (Yes, this fictional company has named its five production servers in honor of the Spice Girls.) OK, you say. You exercise your godlike root powers and on another machine become David:

# su - david

Then you go over to posh:

# ssh posh

Once you are there, you run:

# screen -S foo

Then you holler at David:

"Hey David, run the following command on your terminal: # screen -x foo."

This will cause your and David's sessions to be joined together in the holy Linux shell. You can type or he can type, but you'll both see what the other is doing. This saves you from walking to the other floor and lets you both have equal control. The benefit is that David can watch your troubleshooting skills and see exactly how you solve problems.

At last you both see what the problem is: David's compile script hard-coded an old directory that does not exist on this new server. You mount it, recompile, solve the problem, and David goes back to work. You then go back to whatever lazy activity you were doing before.

The one caveat to this trick is that you both need to be logged in as the same user. Other cool things you can do with the screen command include having multiple windows and split screens. Read the man pages for more on that.

But I'll give you one last tip while you're in your screen session. To detach from it and leave it open, type: Ctrl-A D . (I mean, hold down the Ctrl key and strike the A key. Then push the D key.)

You can then reattach by running the screen -x foo command again.


Trick 4: Getting back the root password

You forgot your root password. Nice work. Now you'll just have to reinstall the entire machine. Sadly enough, I've seen more than a few people do this. But it's surprisingly easy to get on the machine and change the password. This doesn't work in all cases (like if you made a GRUB password and forgot that too), but here's how you do it in a normal case with a Cent OS Linux example.

First reboot the system. When it reboots you'll come to the GRUB screen. Move the arrow key so that you stay on this screen instead of proceeding all the way to a normal boot.

Next, select the kernel that will boot with the arrow keys, and type E to edit the kernel line.

Use the arrow key again to highlight the line that begins with kernel, and press E to edit the kernel parameters. When you get to the next screen, simply append the number 1 (or single) to the arguments already present.

Then press Enter, B, and the kernel will boot up to single-user mode. Once here you can run the passwd command, changing password for user root:

sh-3.00# passwd
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully

Now you can reboot, and the machine will boot up with your new password.

Trick 5: SSH back door

Many times I'll be at a site where I need remote support from someone who is blocked on the outside by a company firewall. Few people realize that if you can get out to the world through a firewall, then it is relatively easy to open a hole so that the world can come into you.

In its crudest form, this is called "poking a hole in the firewall." I'll call it an SSH back door. To use it, you'll need a machine on the Internet that you can use as an intermediary.

In our example, we'll call our machine blackbox.example.com. The machine behind the company firewall is called ginger. Finally, the machine that technical support is on will be called tech.

Here's how to proceed:

  1. Check that what you're doing is allowed, but make sure you ask the right people. Most people will cringe that you're opening the firewall, but what they don't understand is that it is completely encrypted. Furthermore, someone would need to hack your outside machine before getting into your company. Instead, you may belong to the school of "ask-for-forgiveness-instead-of-permission." Either way, use your judgment and don't blame me if this doesn't go your way.

  2. SSH from ginger to blackbox.example.com with the -R flag. I'll assume that you're the root user on ginger and that tech will need the root user ID to help you with the system. With the -R flag, you'll forward instructions of port 2222 on blackbox to port 22 on ginger. This is how you set up an SSH tunnel. Note that only SSH traffic can come into ginger: You're not putting ginger out on the Internet naked.

    You can do this with the following syntax:

    ~# ssh -R 2222:localhost:22 thedude@blackbox.example.com

    Once you are into blackbox, you just need to stay logged in. I usually enter a command like:

    thedude@blackbox:~$ while [ 1 ]; do date; sleep 300; done

    to keep the machine busy. And minimize the window.

  3. Now instruct your friends at tech to SSH as thedude into blackbox without using any special SSH flags. You'll have to give them your password:

    root@tech:~# ssh thedude@blackbox.example.com .

  4. Once tech is on the blackbox, they can SSH to ginger using the following command:

    thedude@blackbox:~$: ssh -p 2222 root@localhost

  5. Tech will then be prompted for a password. They should enter the root password of ginger.

  6. Now you and support from tech can work together and solve the problem. You may even want to use screen together! (see #4); you can also set it up so they are put into a screen you can monitor.

Trick 6: Remote VNC session through an SSH tunnel

VNC or virtual network computing has been around a long time. I typically find myself needing to use it when the remote server has some type of graphical program that is only available on that server.

For example, suppose in trick 5, ginger is a storage server. Many storage devices come with a GUI program to manage the storage controllers. Often these GUI management tools need a direct connection to the storage through a network that is at times kept in a private subnet. Therefore, the only way to access this GUI is to do it from ginger.

You can try SSH'ing to ginger with the -X option and launch it that way, but many times the bandwidth required is too much and you'll get frustrated waiting. VNC is a much more network-friendly tool and is readily available for nearly all operating systems.

Let's assume that the setup is the same as in Trick 5, but you want tech to be able to get VNC access instead of SSH. In this case, you'll do something similar but forward VNC ports instead. Here's what you do:

  1. Start a VNC server session on ginger. This is done by running something like:

    root@ginger:~# vncserver -geometry 1024x768 -depth 24 :99

    The options tell the VNC server to start up with a resolution of 1024x768 and a pixel depth of 24 bits per pixel. If you are using a really slow connection setting, 8 may be a better option. Using :99 specifies the port the VNC server will be accessible from. The VNC protocol starts at 5900 so specifying :99 means the server is accessible from port 5999.

    When you start the session, you'll be asked to specify a password. The user ID will be the same user that you launched the VNC server from. (In our case, this is root.)

  2. SSH from ginger to blackbox.example.com forwarding the port 5999 on blackbox to ginger. This is done from ginger by running the command:

    root@ginger:~# ssh -R 5999:localhost:5999 thedude@blackbox.example.com

    Once you run this command, you'll need to keep this SSH session open in order to keep the port forwarded to ginger. At this point if you were on blackbox, you could now access the VNC session on ginger by just running:

    thedude@blackbox:~$ vncviewer localhost:99

    That would forward the port through SSH to ginger. But we're interested in letting tech get VNC access to ginger. To accomplish this, you'll need another tunnel.

  3. From tech, you open a tunnel via SSH to forward your port 5999 to port 5999 on blackbox. This would be done by running:

    root@tech:~# ssh -L 5999:localhost:5999 thedude@blackbox.example.com

    This time the SSH flag we used was -L, which instead of pushing 5999 to blackbox, pulled from it. Once you are in on blackbox, you'll need to leave this session open. Now you're ready to VNC from tech!

  4. From tech, VNC to ginger by running the command:

    root@tech:~# vncviewer localhost:99 .

    Tech will now have a VNC session directly to ginger.

While the effort might seem like a bit much to set up, it beats flying across the country to fix the storage arrays. Also, if you practice this a few times, it becomes quite easy.

Let me add a trick to this trick: If tech was running the Windows® operating system and didn't have a command-line SSH client, then tech can run Putty. Putty can be set to forward SSH ports by looking in the options in the sidebar. If the port were 5902 instead of our example of 5999, you would set the source port to 5902 and set the destination of localhost:5902 under the tunnels section. If this were set up, then tech could VNC to localhost:2 just as if tech were running the Linux operating system.

Trick 7: Checking your bandwidth

Imagine this: Company A has a storage server named ginger and it is being NFS-mounted by a client node named beckham. Company A has decided they really want to get more bandwidth out of ginger because they have lots of nodes they want to have NFS mount ginger's shared filesystem.

The most common and cheapest way to do this is to bond two Gigabit ethernet NICs together. This is cheapest because usually you have an extra on-board NIC and an extra port on your switch somewhere.

So they do this. But now the question is: How much bandwidth do they really have?

Gigabit Ethernet has a theoretical limit of 128MBps. Where does that number come from? Well,

1Gb = 1024Mb; 1024Mb/8 = 128MB; "b" = "bits," "B" = "bytes"

But what is it that we actually see, and what is a good way to measure it? One tool I suggest is iperf. You can grab iperf like this:

# wget http://dast.nlanr.net/Projects/Iperf2.0/iperf-2.0.2.tar.gz

You'll need to install it on a shared filesystem that both ginger and beckham can see. or compile and install on both nodes. I'll compile it in the home directory of the bob user that is viewable on both nodes:

tar zxvf iperf*gz
cd iperf-2.0.2
./configure -prefix=/home/bob/perf
make
make install

On ginger, run:

# /home/bob/perf/bin/iperf -s -f M

This machine will act as the server and print out performance speeds in MBps.

On the beckham node, run:

# /home/bob/perf/bin/iperf -c ginger -P 4 -f M -w 256k -t 60

You'll see output in both screens telling you what the speed is. On a normal server with a Gigabit Ethernet adapter, you will probably see about 112MBps. This is normal as bandwidth is lost in the TCP stack and physical cables. By connecting two servers back-to-back, each with two bonded Ethernet cards, I got about 220MBps.

In reality, what you see with NFS on bonded networks is around 150-160MBps. Still, this gives you a good indication that your bandwidth is going to be about what you'd expect. If you see something much less, then you should check for a problem.

I recently ran into a case in which the bonding driver was used to bond two NICs that used different drivers. The performance was extremely poor, leading to about 20MBps in bandwidth, less than they would have gotten had they not bonded the Ethernet cards together!

Trick 8: Command-line scripting and utilities

A Linux systems administrator becomes more efficient by using command-line scripting with authority. This includes crafting loops and knowing how to parse data using utilities like awk, grep, and sed. There are many cases where doing so takes fewer keystrokes and lessens the likelihood of user errors.

For example, suppose you need to generate a new /etc/hosts file for a Linux cluster that you are about to install. The long way would be to add IP addresses in vi or your favorite text editor. However, it can be done by taking the already existing /etc/hosts file and appending the following to it by running this on the command line:

# P=1; for i in $(seq -w 200); do echo "192.168.99.$P n$i"; P=$(expr $P + 1);
done >>/etc/hosts

Two hundred host names, n001 through n200, will then be created with IP addresses 192.168.99.1 through 192.168.99.200. Populating a file like this by hand runs the risk of inadvertently creating duplicate IP addresses or host names, so this is a good example of using the built-in command line to eliminate user errors. Please note that this is done in the bash shell, the default in most Linux distributions.

As another example, let's suppose you want to check that the memory size is the same in each of the compute nodes in the Linux cluster. In most cases of this sort, having a distributed or parallel shell would be the best practice, but for the sake of illustration, here's a way to do this using SSH.

Assume the SSH is set up to authenticate without a password. Then run:

# for num in $(seq -w 200); do ssh n$num free -tm | grep Mem | awk '{print $2}';
done | sort | uniq

A command line like this looks pretty terse. (It can be worse if you put regular expressions in it.) Let's pick it apart and uncover the mystery.

First you're doing a loop through 001-200. This padding with 0s in the front is done with the -w option to the seq command. Then you substitute the num variable to create the host you're going to SSH to. Once you have the target host, give the command to it. In this case, it's:

free -m | grep Mem | awk '{print $2}'

That command says to:

  • Use the free command to get the memory size in megabytes.
  • Take the output of that command and use grep to get the line that has the string Mem in it.
  • Take that line and use awk to print the second field, which is the total memory in the node.

This operation is performed on every node.

Once you have performed the command on every node, the entire output of all 200 nodes is piped (|d) to the sort command so that all the memory values are sorted.

Finally, you eliminate duplicates with the uniq command. This command will result in one of the following cases:

  • If all the nodes, n001-n200, have the same memory size, then only one number will be displayed. This is the size of memory as seen by each operating system.
  • If node memory size is different, you will see several memory size values.
  • Finally, if the SSH failed on a certain node, then you may see some error messages.

This command isn't perfect. If you find that a value of memory is different than what you expect, you won't know on which node it was or how many nodes there were. Another command may need to be issued for that.

What this trick does give you, though, is a fast way to check for something and quickly learn if something is wrong. This is it's real value: Speed to do a quick-and-dirty check.

Trick 9: Spying on the console

Some software prints error messages to the console that may not necessarily show up on your SSH session. Using the vcs devices can let you examine these. From within an SSH session, run the following command on a remote server: # cat /dev/vcs1. This will show you what is on the first console. You can also look at the other virtual terminals using 2, 3, etc. If a user is typing on the remote system, you'll be able to see what he typed.

In most data farms, using a remote terminal server, KVM, or even Serial Over LAN is the best way to view this information; it also provides the additional benefit of out-of-band viewing capabilities. Using the vcs device provides a fast in-band method that may be able to save you some time from going to the machine room and looking at the console.

Trick 10: Random system information collection

In trick 8, you saw an example of using the command line to get information about the total memory in the system. In this trick, I'll offer up a few other methods to collect important information from the system you may need to verify, troubleshoot, or give to remote support.

First, let's gather information about the processor. This is easily done as follows:

# cat /proc/cpuinfo .

This command gives you information on the processor speed, quantity, and model. Using grep in many cases can give you the desired value.

A check that I do quite often is to ascertain the quantity of processors on the system. So, if I have purchased a dual processor quad-core server, I can run:

# cat /proc/cpuinfo | grep processor | wc -l .

I would then expect to see 8 as the value. If I don't, I call up the vendor and tell them to send me another processor.

Another piece of information I may require is disk information. This can be gotten with the df command. I usually add the -h flag so that I can see the output in gigabytes or megabytes. # df -h also shows how the disk was partitioned.

And to end the list, here's a way to look at the firmware of your system—a method to get the BIOS level and the firmware on the NIC.

To check the BIOS version, you can run the dmidecode command. Unfortunately, you can't easily grep for the information, so piping it is a less efficient way to do this. On my Lenovo T61 laptop, the output looks like this:

#dmidecode | less
...
BIOS Information
Vendor: LENOVO
Version: 7LET52WW (1.22 )
Release Date: 08/27/2007
...

This is much more efficient than rebooting your machine and looking at the POST output.

To examine the driver and firmware versions of your Ethernet adapter, run ethtool:

# ethtool -i eth0
driver: e1000
version: 7.3.20-k2-NAPI
firmware-version: 0.3-0


You can also use sysreport to collect a lot of information about your system and gather it into one place.

Human Foods that Poison Pets

Feeding pets food that we enjoy is not only wrong, it can also be fatal. There are some foodstuffs that humans relish which cause illness and death if eaten by pets.

Chocolate, macadamia nuts and onions are good examples. Each of these foods contains chemicals which rarely cause problems for humans, but for dogs, these same chemicals can be deadly.


Chocolate toxicity
Chocolate contains theobromine, a compound that is a cardiac stimulant and a diuretic.

When affected by an overdose of chocolate, a dog can become excited and hyperactive. Due to the diuretic effect, it may pass large volumes of urine and it will be unusually thirsty. Vomiting and diarrhoea are also common. The effect of theobromine on the heart is the most dangerous effect. Theobromine will either increase the dog’s heart rate or may cause the heart to beat irregularly. Death is quite possible, especially with exercise.

After their pet has eaten a large quantity of chocolate, many pet owners assume their pet is unaffected. However, the signs of sickness may not be seen for several hours, with death following within twenty-four hours.

Cocoa powder and cooking chocolate are the most toxic forms. A 10-kilogram dog can be seriously affected if it eats a quarter of a 250gm packet of cocoa powder or half of a 250gm block of cooking chocolate. These forms of chocolate contain ten times more theobromine than milk chocolate. Thus, a chocolate mud cake could be a real health risk for a small dog. Even licking a substantial part of the chocolate icing from a cake can make a dog unwell.

Semi-sweet chocolate and dark chocolate are the next most dangerous forms, with milk chocolate being the least dangerous. A dog needs to eat more than a 250gm block of milk chocolate to be affected. Obviously, the smaller the dog, the less it needs to eat.


Onion and garlic poisoning
Onions and garlic are other dangerous food ingredients that cause sickness in dogs, cats and also livestock. Onions and garlic contain the toxic ingredient thiosulphate. Onions are more of a danger.

Pets affected by onion toxicity will develop haemolytic anaemia, where the pet’s red blood cells burst while circulating in its body.

At first, pets affected by onion poisoning show gastroenteritis with vomiting and diarrhoea. They will show no interest in food and will be dull and weak. The red pigment from the burst blood cells appears in an affected animal’s urine and it becomes breathless. The breathlessness occurs because the red blood cells that carry oxygen through the body are reduced in number.

The poisoning occurs a few days after the pet has eaten the onion. All forms of onion can be a problem including dehydrated onions, raw onions, cooked onions and table scraps containing cooked onions and/or garlic. Left over pizza, Chinese dishes and commercial baby food containing onion, sometimes fed as a supplement to young pets, can cause illness.

Onion poisoning can occur with a single ingestion of large quantities or with repeated meals containing small amounts of onion. A single meal of 600 to 800 grams of raw onion can be dangerous whereas a ten-kilogram dog, fed 150 grams of onion for several days, is also likely to develop anaemia. The condition improves once the dog is prevented from eating any further onion

While garlic also contains the toxic ingredient thiosulphate, it seems that garlic is less toxic and large amounts would need to be eaten to cause illness.


The danger of macadamia nuts
Macadamia nuts are another concern. A recent paper written by Dr. Ross McKenzie, a Veterinary Pathologist with the Department of Primary Industries, points to the danger of raw and roasted macadamia nuts for pets.

The toxic compound is unknown but the affect of macadamia nuts is to cause locomotory difficulties. Dogs develop a tremor of the skeletal muscles, and weakness or paralysis of the hindquarters. Affected dogs are often unable to rise and are distressed, usually panting. Some affected dogs have swollen limbs and show pain when the limbs are manipulated.

Dogs have been affected by eating as few as six macadamia kernels (nuts without the shell) while others had eaten approximately forty kernels. Some dogs had also been given macadamia butter.

Luckily, the muscle weakness, while painful, seems to be of short duration and all dogs recovered from the toxicity. All dogs were taken to their veterinary surgeon.

Pets owners should not assume that human food is always safe for pets. When it comes to chocolate, onions, garlic and macadamia nuts, such foods should be given in only small quantities, or not at all. Be sure that your pets can’t get into your stash of chocolates, that food scraps are disposed of carefully to prevent onion and garlic toxicity and that your dog is prevented from picking up macadamia nuts if you have a tree in your garden.


Other potential dangers
  • Avocado (all parts) - the toxic ingredient in avocado is called persin (toxic amount unknown). Mmost documented cases of poisoning have been in livestock that have eaten all parts of the avocado and in large amounts. The toxin may be confined to the leaves, bark, skin or seed but the flesh is thought to be poisonous to birds.
  • Pear pips, the kernels of plums, peaches and apricots, apple core pips (contain cyanogenic glycosides resulting in cyanide posioning)
  • Potato peelings and green looking potatoes
  • Rhubarb leaves
  • Mouldy/spoiled foods (keep garbage lid firmly on)
  • Alcohol
  • Yeast dough
  • Coffee grounds, beans & tea (caffeine)
  • Hops (used in home brewing)
  • Tomato leaves & stems (green parts)
  • Broccoli (in large amounts)
  • Raisins and grapes
  • Cigarettes, tobacco, cigars
  • Xylitol (sweetener often found in sugar-free gum)
  • Cooked bones - they can splinter and cause gut perforation, as well as blockages in the intestine, tooth fractures, and cooked chop bones can get stuck across the roof of the mouth
  • Corn cobs - a common cause of intestinal blockage requiring surgical removal
  • Saturday, July 10, 2010

    A for effort


    Man these guys are creative...the latest scam I received. I guess I am rich now! YAY Me!

    Sunday, July 04, 2010

    Bad Sports

    I guess now even the world of hot dog eating has its share of bad sports. We have seen it in Tennis, Baseball, Football, Hockey, Soccer and even Golf.

    Competitive eater Joey Chestnut has held on to his title at the annual July Fourth hot dog eating contest at New York's Coney Island, but one of his biggest rivals tried to crash the celebration and was taken into custody.

    Chestnut chomped down on 54 hot dogs in 10 minutes on Sunday to win the annual Nathan's International Hot Dog Eating Contest for the fourth year in a row.

    Watching from the crowd was six-time champion Takeru Kobayashi, who has not signed a contract with Major League Eating to be free to compete in contests sanctioned by other groups.

    But Kobayashi went on stage after the competition. Police officers grabbed him, and he tried to hold onto police barricades as they took him into custody.

    Wednesday, June 30, 2010

    Puppy Mill bill

    Puppy Mill bill could die without YOUR help!! PLEASE CALL NOW!Make
    a short phone call to STEVE TROXLER (919) 733-7125.Leave this
    message:......“Hello, my name is _________. I live in
    ________ county. I’m calling to ask that STEVE TROXLER do the right
    thing for North Carolina dogs, consumers and tax payers. Support the
    REGULATION OF COMMERCIAL BREEDERS. Thank you!

    job hunt day 3

    bought a new suit
    applied for more jobs

    Tuesday, June 29, 2010

    job hunt

    Day two: applied for unemployment
    Took dog to the park, they love it...I realized how much I miss getting stuck in an office.
    Applied for several jobs
    Wished I was the old man on the park bench who was retired...

    Monday, June 28, 2010

    job hunt

    Well I am back to the job hunt again.

    Day one: updated my resume, talk to a few recruiters and setup an interview for tomorrow.

    Tuesday, June 22, 2010

    Speeding Up Firefox

    Speeding up Firefox seems to be a meme going around the blogsphere lately. Most of the tips I’ve seen, though, are only for broadband connections with the latest hardware and only include some of the settings that would affect performance.

    The Firefox Tweak Guide has the full details on how to speed up Firefox regardless of your connection or hardware, reprinted in part below. Don’t forget that the easiest way to tweak user files is with chromEdit extension.

    Common to all configurations

    These are the settings that seem to be common to all configuration files regardless of connection speed or computer speed with a couple of additions - plugin paths can be found with about:plugins and the bookmark menu delay is turned off.

    user_pref("network.http.pipelining", true);
    user_pref("network.http.proxy.pipelining", true);
    user_pref("network.http.pipelining.maxrequests", 8);
    user_pref("content.notify.backoffcount", 5);
    user_pref("plugin.expose_full_path", true);
    user_pref("ui.submenuDelay", 0);

    Fast Computer Fast Connection

    user_pref("content.interrupt.parsing", true);
    user_pref("content.max.tokenizing.time", 2250000);
    user_pref("content.notify.interval", 750000);
    user_pref("content.notify.ontimer", true);
    user_pref("content.switch.threshold", 750000);
    user_pref("nglayout.initialpaint.delay", 0);
    user_pref("network.http.max-connections", 48);
    user_pref("network.http.max-connections-per-server", 16);
    user_pref("network.http.max-persistent-connections-per-proxy", 16);
    user_pref("network.http.max-persistent-connections-per-server", 8);
    user_pref("browser.cache.memory.capacity", 65536);

    A couple settings of note - Firefox is allocated 4096 KB of memory by default and in this configuration we give it roughly 65MB as denoted by the last line. This can be changed according to what is used.

    Fast Computer, Slower Connection

    This configuration is more suited to people without ultra fast connections. We are not talking about dial up connections but slower DSL / Cable connections.

    user_pref("content.max.tokenizing.time", 2250000);
    user_pref("content.notify.interval", 750000);
    user_pref("content.notify.ontimer", true);
    user_pref("content.switch.threshold", 750000);
    user_pref("network.http.max-connections", 48);
    user_pref("network.http.max-connections-per-server", 16);
    user_pref("network.http.max-persistent-connections-per-proxy", 16);
    user_pref("network.http.max-persistent-connections-per-server", 8);
    user_pref("nglayout.initialpaint.delay", 0);
    user_pref("browser.cache.memory.capacity", 65536);

    Fast Computer, Slow Connection

    user_pref("browser.xul.error_pages.enabled", true);
    user_pref("content.interrupt.parsing", true);
    user_pref("content.max.tokenizing.time", 3000000);
    user_pref("content.maxtextrun", 8191);
    user_pref("content.notify.interval", 750000);
    user_pref("content.notify.ontimer", true);
    user_pref("content.switch.threshold", 750000);
    user_pref("network.http.max-connections", 32);
    user_pref("network.http.max-connections-per-server", 8);
    user_pref("network.http.max-persistent-connections-per-proxy", 8);
    user_pref("network.http.max-persistent-connections-per-server", 4);
    user_pref("nglayout.initialpaint.delay", 0);
    user_pref("browser.cache.memory.capacity", 65536);

    Slow Computer, Fast Connection

    user_pref("content.max.tokenizing.time", 3000000);
    user_pref("content.notify.backoffcount", 5);
    user_pref("content.notify.interval", 1000000);
    user_pref("content.notify.ontimer", true);
    user_pref("content.switch.threshold", 1000000);
    user_pref("content.maxtextrun", 4095);
    user_pref("nglayout.initialpaint.delay", 1000);
    user_pref("network.http.max-connections", 48);
    user_pref("network.http.max-connections-per-server", 16);
    user_pref("network.http.max-persistent-connections-per-proxy", 16);
    user_pref("network.http.max-persistent-connections-per-server", 8);
    user_pref("dom.disable_window_status_change", true);

    One of the changes made for this particular configuration is the final line where the status bar is disabled for changing web pages to save processor time.

    Slow Computer, Slow Connection

    We have entered the doldrums of the dial-up user

    user_pref("content.max.tokenizing.time", 2250000);
    user_pref("content.notify.interval", 750000);
    user_pref("content.notify.ontimer", true);
    user_pref("content.switch.threshold", 750000);
    user_pref("nglayout.initialpaint.delay", 750);
    user_pref("network.http.max-connections", 32);
    user_pref("network.http.max-connections-per-server", 8);
    user_pref("network.http.max-persistent-connections-per-proxy", 8);
    user_pref("network.http.max-persistent-connections-per-server", 4);
    user_pref("dom.disable_window_status_change", true);

    New species of tiger!


    Wow! a new species of tiger has been found.

    The Mud Hole

    A motorist, after getting his car stuck in a big mud hole, paid a passing farmer five dollars to pull him out with his tractor. After he was back on dry ground, he said to the farmer, 'At those prices, I should think you would be pulling people out of the mud night and day.'

    'Can't,' replied the farmer. 'At night I haul water for the mud hole.'

    The Australian and the Texan

    A Texas farmer on vacation in Australia met an Aussie farmer and they started talking. The Aussie showed off his biggest wheat field and the Texan says, 'Oh! We have wheat fields that are at least twice as large.'

    Then they walk over to the pasture and the Aussie shows off his herd of cattle. The Texan immediately says, 'We have longhorns that are at least twice as large as your cows.'

    The conversation has, meanwhile, almost died when the Texan sees a herd of kangaroos hopping through the field. Astonished, he asked, 'What are those?!?'

    The Aussie replied with an incredulous look, 'Don't you have any grasshoppers in Texas?'

    Site design

    Everyone once in awhile you just run across a site that makes you go "WTF!". This is one of those sites. This has got to be the best website ever made.

    http://yvettesbridalformal.com/index.htm

    I am rather disappointed in the lack of blink tags though.

    Friday, June 18, 2010

    Oil Spill

    BP Oil Spill: Daily Dead Wildlife Tally

    Days since spill: 60

    dead birds
    885
    dead sea turtles
    363
    dead mammals
    44
    oiled but alive
    665
    oiled but alive
    75
    oiled but alive
    1
    cleaned and released
    42
    cleaned and released
    3
    cleaned and released
    1

    World Cup Crap Call Costs U.S. Win Over Slovenia

    What was up with that crappy call during the US vs Slovenia today? Come on seriously? From every angle that was clearly a bum call. Now we shouldn't have fallen so far behind in the first place. But clearly the ref made a bad call. We got robbed of that win.

    Animal Abuse

    Yesterday I saw a new commercial for animal cruelty on T.V. There was this one part where they showed a cage filled to the top with dogs. It was so horrible that it made me cry. How can people do that to poor innocent animals. They should be shot. I think that whatever someone does to an animal gets done to them in return. What have these poor creatures ever done to the humans that abuse them. What kind of person would do that. I think their punishment should be more severe. I mean some people just drop dogs off on the side of the road to fend for themselves. That is how my brother-in-law found his little dog. She was just a puppy. Someone just dumped her off. She would not have survived if by brother-in-law have not found her. People can be so mean and cruel.

    Cat issue

    Ok so my cat has been urinating on the carpet. I don't know why she does this. I keep her litter box clean which she will defecate in but not urinate. It is always by or near the same spot. By the back door. I can't seem to get the stains and odor out of the carpet. Anyone have any ideas? I have tried resolve powder, nature's miracle, and many others. My entire living room smells like cat urine. I need to find a way to get rid of it. The thing is, it is very hard to get rid of the smell. If anyone has any ideas then please let me know for I will try anything.

    Thursday, June 17, 2010

    3ware Hardware RAID vs. Linux Software RAID

    As part of a project we are building a iSCSI storage server. It has 16 500GB SATA disks and to provide redundancy we needed some sort of RAID controller. So we went with the well known 3ware controllers. More specifically a 9550SXU 16ML. The server itself is running CentOS 5 with 2 Dual-Core Intel Xeon processors. This post is just to share my experiences with this controller.

    First, everybody that uses a ext3 filesystem on top of this controller should upgrade to firmware 9.4.2. It improves the write performance. In our case we went from around 55MB/s to around 75 MB/s for sequential I/O. That is not bad for a simple firmware upgrade.

    But we were having one issue. On initial tests with a iSCSI exported logical volume we did a copy of a directory tree (on the same volume) with a total size of 1GB. And this test took around 6 minutes, that is even less then 3MB/s. To be fair, this structure contains a lot of smaller files, different directories. So a copy also involves a lot of metadata activity. So we did the same test on the storage server itself and we got around 3 minutes there. Mmm, and this should be a top end RAID controller, but we are only getting 6MB/s in this test.

    So, just for fun I decided to let the RAID controller export each disk individually and use the Linux software RAID and see what performance that would give. Well, for this specific test the time was 2'50". And for all the other tests I did software RAID outperformed the hardware RAID.

    So what did we learn here. First, do not let the numbers of all the different hardware RAID controller vendors foul you. They are sequential I/O test. But most day-to-day I/O patterns are different.
    Second, always test yourself. Benchmarks found online can be indicators, but always test everything yourself for your specific case. Third, when using RAID always give software RAID a change. It may save you some money.

    As a final note. If we mounted the filesytems as ext2 in this specific test the copy would only take 1 minute (in both HW and SW RAID). So do not forget about ext2, it still has it's advantages.

    Tuesday, March 23, 2010

    Revolution

    Every election cycle we are treated to candidates who promise us "change," and 2008 was no different. But in the American political lexicon, "change" always means more of the same: more government, more looting of Americans, more inflation, more police-state measures, more unnecessary war, and more centralization of power.

    Thursday, February 18, 2010

    Yankees fan

    A Mets fan, a Braves fan, a Yankees fan, and a Red Sox fan are climbing a mountian. On the way to the top, each is arguing about how loyal they are to their team and what they would do for that team.

    Upon reaching the top, the Mets fan shouts, "This is for the Mets!!!" and throw’s himself off the top of the mountian.

    Next the Braves fan yells, "I love Atlanta....This is for you Braves!!" and he, too, jumps off.

    And then the Red Sox fan reaches the top and screams, "This is for EVERYONE!!" and pushes the Yankee fan off the mountian.

    Hunter & the frog

    A hunter was crossing a road one day when a frog called out to him and said, "If you kiss me, I'll turn into a beautiful princess." He bent over, picked up the frog and put it in his pocket.

    The frog spoke up again and said, "If you kiss me and turn me back into a beautiful Princess, I will stay with you for one week."

    The hunter took the frog out of his pocket, smiled at it and returned it to the pocket. The frog then cried out, "If you kiss me and turn me back into a Princess, I'll stay with you and do anything you want."

    Again the hunter took the frog out, smiled at it and put it back into his pocket.

    Finally the frog asked, "What is it? I've told you I'm a beautiful Princess, that I'll stay with you for a week and do anything you want. Why won't you kiss me?"

    The hunter said, "Look, I'm a avid hunter and when I'm not hunting, I'm fishing, so I don't have time for girlfriends, but a talking frog is really cool!"

    Mother Nature

    A husband and wife were out playing golf. They tee off and one drive goes to the right and one drive goes to the left. The wife finds her ball in a patch of buttercups. She grabs a club and takes a mighty swing at the ball. She hits a beautiful second shot, but in the process she hacks the hell out of the buttercups.

    Suddenly a woman appears out of nowhere. She blocks her path to her golf bag and looks at her and says, "I'm Mother Nature, and I don't like the way you treated my buttercups. From now on, you won't be able to stand the taste of butter. Each time you eat butter you will become physically ill to the point of total nausea."

    The mystery woman then disappears as quickly as she appeared. Shaken, the wife calls out to her husband "Hey, where's your ball?"

    "It's over here in the pussy willows."

    The wife screams back, "DON'T HIT THE BALL!!!! DON'T HIT THE BALL!!!!"

    Tech support

    THESE PEOPLE VOTE—YOU DECIDE?

    Technical Support
    Oh.... Some People Are Truly STUPID


    Customer: I'm trying to connect to the Internet with your CD, but
    it just doesn't work. What am I doing wrong?
    Tech support: OK, you've got the CD in the CD drive, right?
    Customer: Yeah....
    Tech support: And what sort of computer are you using?
    Customer: Computer? Oh no, I haven't got a computer. It's in the
    CD player and all I get is weird noises. Listen.....
    Tech support: Aaaarrrrgggghhhh!!!
    ------------------------------------------------------------------------------------------------------------
    Customer: Hi, this is Celine. I can't get my diskette out.
    Tech support: Have you tried pushing the button?
    Customer: Yes, sure, it's really stuck.
    Tech support: That doesn't sound good; I'll make a note.
    Customer: No .. wait a minute... I hadn't inserted it yet... it's
    still on my desk... sorry....
    ------------------------------------------------------------------------------------
    Tech support: Click on the 'my computer' icon on to the left of the screen.
    Customer: Your left or my left?
    ------------------------------------------------------------------------------------------------------
    Tech support: Good day. How may I help you?
    Male customer: Hello... I can't print.
    Tech support: Would you click on "Start" for me and...
    Customer: Listen pal; don't start getting technical on me! I'm not Bill Gates .
    ------------------------------------------------------------------------------------------------------
    Customer: Hi, good afternoon, this is Martha, I can't print. Every time I try, it says
    'Can't find printer'. I've even lifted the printer and placed it in front of the
    monitor, but the computer still says he can't find it...
    ------------------------------------------------------------------------------------------------------
    Customer: I have problems printing in red...
    Tech support: Do you have a color printer?
    Customer: Aaaah.................thank you.
    -------------------------------------------------------------------------------------------------------
    Tech support: What's on your monitor now, ma'am?
    Customer: A teddy bear my boyfriend bought for me in the
    supermarket.
    -------------------------------------------------------------------------------------
    Customer: My keyboard is not working anymore.
    Tech support: Are you sure it's plugged into the computer?
    Customer: No. I can't get behind the computer.
    Tech support: Pick up your keyboard and walk 10 paces back.
    Customer: OK
    Tech support: Did the keyboard come with you?
    Customer: Yes
    Tech support: That means the keyboard is not plugged in. Is there
    another keyboard?
    Customer: Yes, there's another one here. Ah...that one does work!
    ------------------------------------------------------------------------------------------------
    Tech support: Your password is the small letter a, as in apple, a
    capital letter V as in Victor, the number 7.
    Customer: Is that 7 in capital letters?
    ------------------------------------------------------------------------------------------------
    Customer: I can't get on the internet.
    Tech support: Are you sure you used the right password?
    Customer: Yes, I'm sure. I saw my colleague do it.
    Tech support: Can you tell me what the password was?
    Customer: Five stars.
    -----------------------------------------------------------------------------------------------
    Tech support: What antivirus program do you use?
    Customer: Netscape.
    Tech support: That's not an antivirus program.
    Customer: Oh, sorry...Internet Explorer.
    -----------------------------------------------------------------------------------------------
    Customer: I have a huge problem. A friend has placed a screen saver
    on my computer, but every time I move the mouse,
    it disappears.
    -----------------------------------------------------------------------------------------------
    Tech support: How may I help you?
    Customer: I'm writing my first e-mail.
    Tech support: OK, and what seems to be the problem?
    Customer: Well, I have the letter 'a' in the address, but how do I
    get the circle around it?
    ----------------------------------------------------------------------------------------------
    A woman customer called the Canon help desk with a printer problem.
    Tech support: Are you running it under windows?
    Customer: "No, my desk is next to the door, but that is a good
    point. The man sitting in the cubicle next to me is under
    a window, and his printer is working fine."
    --------------------------------------------------------------------------------

    And last but not least:

    Tech support: "Okay Bob, let's press the control and escape keys at
    the same time. That brings up a task list in the middle
    of the screen. Now type the letter "P" to bring up the
    Program Manager."
    Customer: I don't have a P.
    Tech support: On your keyboard, Bob.
    Customer: What do you mean?
    Tech support: "P".....on your keyboard, Bob.
    Customer: I'M NOT GOING TO DO THAT!!

    Monday, February 15, 2010

    Modern day Noah

    And the Lord spoke to Noah and said, "In six months I'm going to make it rain until the whole Earth is covered with water and all the evil people are destroyed. But I want to save a few good people and two of every kind of living things on the planet. I am ordering you to build an Ark." In a flash of lightning He delivered the plans and specifications for the Ark.

    "Okay," said Noah, trembling in fear and fumbling with the blueprints.

    "Six months and it starts to rain," thundered the Lord. "You'd better have the Ark completed, or learn how to swim for a very long time." ... and six months passed

    The skies began to cloud up and rain began to fall. The Lord looked down and saw Noah sitting in his front yard, weeping. There was no Ark.

    "Noah," shouted the Lord. "Where is the Ark?" A lightning bolt crashed to the ground next to Noah.

    "Lord, please forgive me!" begged Noah. "I did my best, but there were too many problems. First I had to get a building permit for the Ark's construction, and your plans did not meet code. So I had to hire an engineer to redraw the plans. Then I got into a big fight over whether or not the Ark needed a fire sprinkler system. My neighbors objected, claiming I was violating the zoning setback by building the Ark in the front yard, so I had to get a variance from the Zoning Board of Adjustment. Then I had a problem getting enough wood for the Ark because there was a ban on cutting trees to save spotted owls. I finally got permission to cut the trees, but I was denied permission to take two of the owls. Then the carpenters formed a union and went on strike. I had to negotiate a settlement with the National Labor Relations Board before anyone would pick up a hammer or saw. Now we have 16 carpenters going on the boat ... but no owls.

    Then I started gathering up animals, and got sued by an animal rights group. The objected to my taking only two of each kind. Just when I got that suit dismissed, the EPA notified me that I couldn't complete the Ark without filing an Environmental Impact Statement on your proposed flood. They didn't take kindly to the idea that they had no jurisdiction over the conduct of the Supreme Being. Then the Army Corps of Engineers demanded that I file a Map Amendment depicting the expanded flood plain; I sent them a globe. Right now, I am still trying to resolve a complaint over how many Croatians I'm supposed to hire based on Affirmative Action goals, and the IRS has seized all my assets claiming I'm trying to avoid paying taxes by leaving the country. I don't think I'll be able to finish your Ark for at least another five years," Noah wailed.

    The sky began to clear. The sun began to shine. A rainbow arched across the sky.

    Noah looked up and smiled. "You mean you're not going to destroy the Earth?" he asked, hopefully.

    "Wrong!" thundered the Lord. "But being the Lord of the Universe has its advantages. I fully intend to smite the Earth, but with something far worse than a flood. Something that man invented himself."

    "What is that?" asked Noah.

    There was a long pause, then the Lord spoke His Last Word: "Government."

    Thursday, February 11, 2010

    Not so dumb professor

    Two law students are spending their Friday night studying for their big Constitutional Law exam on Monday morning. They studied from 6:00PM to 8:30PM, when they decide to take a break.

    They walk down to the nearest bar and have a drink. While there, the two meet a group of girls who invite them to a party.

    The law students figure they will have time over the weekend to study, so they go to the party with the girls. They stay up all night partying and sleep all day Saturday.

    Before they have a chance to get back home to spend their Sunday studying, the girls invite them to another party. The girls make a convincing argument, and the two law students decide to go to the next party.

    On Monday morning, their heads are pounding. They can't make it out of bed in time for the exam. They wake up Monday afternoon and hurry to the Professor's office to beg for a makeup test.

    They tell the Professor they were on their way to class when their car got a flat tire. They plead their case and eventually, the Professor agrees to give them a makeup exam. The two law students share a devious grin, knowing they had duped the Professor. The Professor puts the two students in separate rooms and administers the makeup exam, which has only two questions:

    1. Explain the significance of habeus corpus in contemporary U.S. law. (Value - 5%)
    2. Which tire? (Value - 95%)

    Tuesday, February 02, 2010

    Where pets come from

    A newly discovered chapter in the Book of Genesis has provided the answer to, "Where do pets come from?"

    Adam said, "Lord, when I was in the garden, you walked with me everyday. Now I don't see you anymore. I'm lonesome here and it's difficult for me to remember how much you love me."

    And God said, "No problem! I will create a companion for you that will be with you forever and who will be a reflection of my love for you, so that you will love me even when you cannot see me. Regardless of how selfish or childish or unlovable you may be, this new companion will accept you as you are and will love you as I do, in spite of yourself."

    And God created a new animal to be a companion for Adam. And it was a good animal. And God was pleased. And the new animal was pleased to be with Adam and he wagged his tail. And Adam said, "Lord, I have already named all the animals in the Kingdom and I cannot think of a name for this new animal."

    And God said, "No problem, because I have created this new animal to be a reflection of my love for you. His name will be a reflection of my own name, and you will call him 'Dog.'"

    And Dog lived with Adam and was a companion to him and loved him.

    And Adam was comforted.
    And God was pleased.
    And Dog was content and wagged his tail.

    After a while, it came to pass that Adam's guardian angel came to the Lord and said, "Lord, Adam has become filled with pride. He struts and preens like a peacock and he believes he is worthy of adoration. Dog has indeed taught him that he is loved, but perhaps too well."

    And the Lord said, "No problem! I will create for him a companion who will be with him forever and who will see him as he is. The companion will remind him of his limitations, so he will know that he is not always worthy of adoration."

    And God created CAT to be a companion to Adam. And Cat would not obey Adam.

    And when Adam gazed into Cat's eyes, he was reminded that he was not the Supreme Being. And Adam learned humility.

    And God was pleased.
    And Adam was pleased.
    And the Dog was pleased.
    And the Cat didn't care one way or the other.

    3 legged chicken

    A man was driving down a country road one day at 45 miles per hour when suddenly he noticed a 3-legged chicken running at the same speed beside his truck.

    Though he thought this odd, the man decided to speed up so he wouldn't cause an accident with the chicken.

    The man sped up to 55 miles per hour, but low and behold, so did the 3-legged chicken.

    The man then sped up to 65 miles per hour only to again be equaled in speed by the 3-legged chicken.

    As the man watched in amazement, the chicken suddenly made a sharp left turn and took off down a side road toward a small farm.

    The man quickly also made the left turn and followed the chicken to the small farm, parking out front.

    Looking around the man found the farmer around back in the midst of many 3-legged chickens.

    After greeting the farmer, the man asked him why he was raising 3-legged chickens.

    "Well we figure," said the farmer, "that with an average family of 3 people, only 2 can have a chicken leg with an average chicken. But with a three legged chicken, each member of the family can enjoy a chicken leg of their own."

    "That's pretty wise," said the man, who then asked "Well how do your 3-legged chickens taste?"

    "I don't know," said the farmer. "We've never been able to catch one."

    Tickle me Elmo

    A woman looking desperately for work goes to the toy plant where they make Elmo dolls. The Personnel Manager goes over her resume and tells her that he regrets that he has nothing worthy of her background that he might offer her.

    The woman replies that she really needs work and will take almost anything.

    The Personnel Manager thinks about it and then says that he does have one job that requires very low level skills -- on the Tickle Me Elmo production line. The woman is thrilled at the opportunity and happily accepts the job. Then the manager takes her down to the assembly line and explains her duties to her. She replies that she thinks can handle the job, and agrees to report for work at 8:00 a.m. next morning.

    The next day at 8:45, there's a knock on the Personnel Manager's door. The Tickle Me Elmo line manager comes in and starts ranting about the woman just hired. After the line manager screaming for 15 minutes about how badly backed up the assembly line is, the Personnel Manager suggests that the line man show him the problem.

    Together they head down to the line and, sure enough, Elmos are backed up from here to kingdom come, as far as the eye can see. Right at the end of the line is the woman just hired. She has pulled over a roll of material used for Elmo's furry exterior and she has a big bag of marbles at her side.

    Both managers watch as she cuts out a small swatch of the material, takes two marbles and begins sewing them between Elmo's legs.

    The Personnel Manager starts to kill himself laughing, and finally, after about 20 minutes of rolling around in hysterics, he pulls himself together and walks over to his newest employee. "I'm sorry," he says to her. "I guess you misunderstood me yesterday. What I wanted you to do was give each Elmo two test tickles."

    Wife Needs Help

    Carlson goes to see his supervisor in the front office. "Boss," he says, "we're doing some heavy house-cleaning at home tomorrow, and my wife needs me to help with the attic and the garage, moving and hauling stuff."

    "We're short-handed, Carlson" the boss replies. "I can't give you the day off."

    "Thanks, boss," says Carlson "I knew I could count on you!"

    Pushing Buttons

    On a flight to Los Angeles, a gentleman had made several attempts to get into the men's restroom, but it had always been occupied. The flight attendant noticed his predicament. "Sir, she said, "You may use the ladies room if you promise not to touch any of the buttons on the wall."

    He did what he needed to, and as he sat there he noticed the buttons he had promised not to touch. Each button was identified by letters: WW,WA,PP, and a red one labeled ATR.

    Who would know if he touched them? He couldn't resist. He pushed WW. Warm water was sprayed gently upon his bottom. What a nice feeling, he thought. Men's restrooms don't have nice things like this. Anticipating greater pleasure, he pushed the WA button. Warm air replaced the warm water, gently drying his underside. When this stopped, he pushed the PP button. A large powder puff caressed his bottom adding a fragile scent of spring flowers to this unbelievable pleasure. The ladies restroom was more than a restroom, it is tender loving pleasure. When the powder puff completed its pleasure, he couldn't wait to push the ATR button which he knew would be supreme ecstasy.

    Next thing he knew he was in a hospital as soon as he opened his eyes. A nurse was staring down at him with a smirk on her face. "What happened?!" he exclaimed. "You pushed one too many buttons," replied the nurse. The last button marked ATR was an Automatic Tampon Remover. Your privates are under your pillow."