How I got Suspend and Hibernate working in Linux (Ubuntu 11.04, Mint 11)

Suspend and hibernate have always been screwed up with Linux. Luckily if you absolutely need this feature there is hope. I got mine working after scouring google. In this tutorial I will share with you what I learned, and how I solved the “linux insomniac” problem for my laptop.

First, here’s what I’m running.
Linux Mint 11 (a derivative of Ubuntu 11.04)
Kernel Version
Asus G53SW (Very similar to any ASUS G73/G Series)

If you are running something different than I am above, don’t panic this still have a good chance of working for you. Regardless of what you do I encourage you to test your suspend and hibernate after everything you try. I know, you’ll have to hold the power button down a lot for a cold reset, but it’s worth it.

My Symptoms Before I got it Working

When I sent my computer in Hibernate the computer would look like it was doing what I told it to up until the part where the screen and the CPU fan turn off. I just got a screen of black that would not respond. The hibernate was very similar except there was a white cursor frozen at the top left of the screen. The only option I had was to hold the power button until it turned off.

An Easy Fix for Suspend

I scoured the web looking for something that might help me. I ran into an article which gives instructions on installing a script that may fix the problem. There are dozens of people who have left comment in the article as to whether it worked for them or not and what system they were running. Most of them left comments said that the script worked perfectly well for them.

The Fix
1. Create a new script. The scripts in the sleep.d directory get executed when your computer suspends and hibernates. The “20” has something to do with the script load order and the name currently _custom-echi_hcd can be changed to anything you like

sudo gedit /etc/pm/sleep.d/20_custom-ehci_hcd 

2. Enter the following script into gedit.

#inspired by
# tidied by tqzzaa :)
# Comments added by

DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd

#This function executes when the computer is going
#into sleep/hibernation. It looks for all devices
#in /sys/bus/pci/drivers with the ehci_hcd, etc
#and adds them to the unbind list
unbindDev() {
  echo -n > $DEV_LIST 2>/dev/null
  for driver in $DRIVERS; do
    for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
      echo -n "$dev" > $DDIR/unbind
      echo "$driver $dev" >> $DEV_LIST

#Executed on a resume/thaw attempts to rebind the stored drivers
bindDev() {
  if [ -s $DEV_LIST ]; then
    while read driver dev; do
      while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
          echo -n "$dev" > $DDIR/bind
          if [ ! -L "$DDIR/$dev" ]; then
            sleep $BIND_WAIT
    done < $DEV_LIST
  rm $DEV_LIST 2>/dev/null

case "$1" in
  hibernate|suspend) unbindDev;;
  resume|thaw)       bindDev;;

3. You’re done. You shouldn’t need to restart your computer. Try a suspend. Cross your fingers. Remember to check to make sure that your USB devices are still working after a resume/thaw.

Unfortunately for me and some others it didn’t work perfectly. In my case it was bitter sweet, my suspend worked, but my hibernate still didn’t work. However, it did change the way that suspend didn’t work. Now instead of a black screen, the computer just acted as if it was a normal restart. On power up instead of continuing the session it just restarted. If you have this same problem continue on getting article on getting hibernation. working.

The website and the script I originally found are located here.

Posted in ASUS G53SW Setup, Everything Penguin Related, Uncategorized | 37 Comments

Linux is so Customizable — GL Matrix Cyan Color Screen Saver Mod

I have always liked the Matrix screen saver that is packaged with most linux distributions. However I have a blue backlight keyboard and when the green martix screensaver came on it really clashed with the keyboard. If only there was a way to change the color… wait this is Linux and Linux is all about being able to change anything!

The Old Green

Green Matrix

The Origional Green Matrix

The New Blue

Blue Matrix

The modded blue matrix.

I must thank for giving me the most crucial information I needed to create my screensaver. I basically followed his tutorial to figure out how to get the source code for the GLMatrix screensaver change it and compile it.

I had trouble getting the dependencies for the source installed. I got errors such as,

  • Note: The OpenGL 3D library was not found.Those demos which use 3D will not be built or installed.
    You might want to consider installing OpenGL and
    re-running configure. If your vendor doesn’t ship
    their own implementation of OpenGL, you can get a free
    version at <>. For general OpenGL
    info, see <>.
  • /usr/bin/ld: cannot find -lXext
  • `XmuPrintDefaultErrorMessage'”

I was able to fix all of these errors by tracking the following dependencies down and installing them using the synaptic package manager.

libxmu-dev, libgl1-mesa, bc, libglade2-dev, libjpeg8-dev

As for modifying the source code to make the cyan color, I edited the file hacks/glx/glmatrix.c and changed line 771 to g = 0xCC; b = 0xFF; essentially setting the color to #00CCFF.

It makes a great addition to my Starace Tron Theme.

Posted in ASUS G53SW Setup, Everything Penguin Related, Uncategorized | 5 Comments

How to set up an SSD on Linux

I recently bought an awesome new ASUS G53SW and to go along with it I purchased a 128 Gb Plextor SATA III SSD. I wanted to use the SSD for the Mint Linux OS.

It seems that there are a ton of older articles that talk about getting an SSD correctly configured in Linux. I perused through them, and I found several conflicting and incorrect instructions. In the following tutorial I am going to try to present what I have learned, both how to configure and why it is configured that way.

These instructions should work for all Debian based Linux Distros (Ubuntu Mint). Some of the commands may need to be tweaked for Fedora or others.

Before I begin let me just gloss over the paradigms behind SSD drives. SSD drives are fast compared to the traditional hard drives. Traditional hard drives (7200 rpm) get less than 100 Mb/s read rate which degrade over time. SSD’s with SATA III have seen read and write speeds at 500 MB/s. So with SSD’s your application load times are reduced by 80%. However SSD’s are more expensive, smaller, and as they are written to they lose disc space, leading to a short life time if they are written to too much.

Hard Drive Speeds:
More on SSD Technology:

Before you Buy — Is the SSD compatible with your Hardware?

If your computer is new chances are it supports SATA III for its hard drives. If your computer is older check to see what SATA your computer supports. No sense in buying a SATA III device if your computer only supports SATA II. SATA III is completely backwards compatible with SATA I, II but will only get speeds at the SATA I, II levels.

Before you Install — Linux Partition Type

Before you install Linux you will want to consider the partition type. The partition types for a Linux install are ext2, ext3, ext4. There is a fair amount of dispute as to which is best. There are a lot of fans of ext2 and ext4. The default install of most (or all?) linux distros is ext4. Ext4 is a journaled file system. The journal is there for redundancy in the event of hard drive error/failure. It is a lot easier to recover your data with and ext4 system, however the journal adds writes to your SSD. The ext2 partition type does not have a journal so the life of the SSD is lengthened, but it loses the recovery features. Ext3 is a journaled file system with less features than ext4 so it is typically rejected in favor of ext4.

More info on ext2, ext3, ext4:

In the article listed below a pro ext4 person explains his viewpoint that the lifespan of the SSD is so long that having a journaled file system won’t be a big deal unless you plan on using the drive for more than 10 years. I would suggest that for any desktop user ext4 is a good choice. If you are installing the ssd for a server then you might think about ext2 as long as you keep good backups.

Ext4 suppoter:

After Linux Installation — Know Your Hard Drives

If you have multiple hard drives connected to your Linux machine you will want to know which hard drive the name of the hard drive. If you go to your terminal and type in “df -h” you should see something like this.

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb6 89G 9.2G 76G 11% /
none 4.9G 588K 4.9G 1% /dev
none 4.9G 536K 4.9G 1% /dev/shm
tmpfs 4.9G 1.6M 4.9G 1% /tmp
none 4.9G 396K 4.9G 1% /var/run
none 4.9G 0 4.9G 0% /var/lock
tmpfs 4.9G 0 4.9G 0% /var/tmp
/home/chris/.Private 89G 9.2G 76G 11% /home/chris
/dev/sda2 466G 54G 413G 12% /media/Windows Starace
/dev/sdb1 26G 9.5G 16G 38% /media/Windows SSD
/dev/sda1 100M 25M 76M 25% /media/System Reserved

Looking at this screen you can tell that I have two hard discs and a couple partitions on each disc. The entries with /dev/sda and then some number are partitions that are on my 7200 rpm Seagate traditional hard drive while entries with /dev/sd2 are partitions on my 128 Gb Plextor SSD. Knowing that the the ssd’s name is “sdb” is important for the upcoming steps. Most people will probably have their ssd name be sda so I will use that in the rest of the tutorial.

After Installation – Benchmark Your Computer’s Speed

Benchmarking the capability of your computer is an important thing to to to know if the changes you made affected the speed.

A simple utility to benchmark the read speed of your ssd is under the administration Gnome menu and is called “Disc Utility.” You can start it from the command “palimpsest”. Click on the ssd and click benchmark.

Note that benchmarking the write speed of your SSD should be done sparingly, it will use up a lot of writes. If you are concerned then perhaps you should skip benchmarking your computer.

I recommend a utility called Bonie++ for testing the write speed of your ssd. It should be available under your package/software manager. Once it is installed run theses commands.

bonnie -d . >ssdtest.mark
#wait for the benchmark process to finish takes some time
bon_csv2html ssdtest.mark > ssdtest.html
firefox ssdtest.html

This should popup your bonnie++ specs in firefox.

After Installation — Changing the Linux Disc Scheduler

The hard drive scheduler attempts to organize hard drive requests in a way that is efficient. However organization is so old school. With SSD’s the memory access is instantaneous and many of the schedulers that were designed for spinning hard drives will only get in the way of SSD performance.

There are four types of schedulers in the Linux World. Anticipatory, Completely Fair Queuing, Noop, and Deadline. Anticipatory scheduling tries to arrange hard drive reads in a way that will maximize efficiency on a spinning disc. Completely Fair Queuing (cfq) is an anticipatory scheduler that adds in a ranking system for important disc reads. Neither of these are suited for an SSD.

The noop is a simple first in first out queue. The deadline is a biased noop queue that allows an application to get some access to the disc even if another application has already requested it.

The deadline is the best scheduler because it has more features than the noop and doesn’t worry about a rotating disc like cfq. To see what scheduler you are currently using go to your command line and look at this file

cat /sys/block/sda/queue/scheduler

You should get something that looks like this

noop deadline [cfq]

The option in brackets is the scheduler that is currently being used by your system, notice that this is currently the cfq. We want to change this to deadline. To do this we are going to edit the file /etc/default/grub. Type “sudo gedit /etc/default/grub” to edit the file. There should be a line of code that looks like this

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash elevator=deadline"

To make the scheduler add in the elevator=deadline option that is highlighted in red. Be sure to put a space after the previous option. You may have more options than I do and that is perfectly fine. After you make this change reboot your computer. Run the “cat /sys/block/sda/queue/schedule” command and deadline should be bracketed.

Wikipedia on Schedulers:
Tombuntu on Grub:

Changing Hard Drive Parameters

There are a slew of hard drive parameters to change. To change your hard drive parameters you can edit the file “/etc/fstab.” Some articles suggest adding several parameters to the drive options. However I only implemented the most common ones in my parameters. Edit the /etc/fstab file, and add the following parameters in red (this time separated by commas.)

/dev/sdb6 / ext4 noatime,nodiratime,discard,errors=remount-ro 0 1

If your SSD supports trim, adding the discard option will enable the use of trim. Trim helps keep your SSD from fragmenting (yes you can fragment SSD’s read the article below for more info).

noatime, nodiratime
By default the ext4 partition keeps track of when files were las accessed. This is write intensive and bad for jump drives.
Below are links to blogs that have more information about several more of the hard drive parameters.

The hard drive parameters with the exception of the discard option for SSD’s that are on an ext4 partition. So if you chose ext2 then you only need to implement the discard option.

More Options:
What is Trim:

Moving Temporary Files to RAM – Less SSD writes

Temporary files such as images loaded from web pages or parts of files that are being download cause heavy disc usage. They are usually composed of many small files. Since we don’t care if temporary files disappear if we restart the computer it would be a good idea to move them to your RAM– as long as you have RAM to spare. There are two main directories that temporary files are stored in /tmp and /var/tmp.

So to make files stored in these directories get put into ram we are again going to edit the /etc/fstab file. At the end of the /etc/fstab file add the following lines of text.

tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0

Restart your computer. Enter the command “df” and you should see two tmpfs entries and their associated directories.


I was hoping I would speed up my ssd a little after configuring it. Looking at the Bonnie++ tests it appears that there was very little change in the numbers. I do think that the effort to reduce ssd writes was beneficial. My final specs on the Plextor Sata III128 Gb SSD

Min Read Speed: 244.7 Mb/s
Max Read Speed: 423.1 Mb/s
Average Read Speed: 356.7 Mb/s

Bonnie++ Test Results

Version 1.96 Sequential Output Sequential Input Random
Sequential Create Random Create
Size Per Char Block Rewrite Per Char Block Num Files Create Read Delete Create Read Delete
K/sec % CPU K/sec % CPU K/sec % CPU K/sec % CPU K/sec % CPU /sec % CPU /sec % CPU /sec % CPU /sec % CPU /sec % CPU /sec % CPU /sec % CPU

Pre Tweaks20G42199618218413166023229911357294230245316221414++++++++1409045802151++++++++2508671


After Tweaks20G42899551336426646024889910619991231742916797749++++++++2833588859552++++++++3116989


Posted in ASUS G53SW Setup, Everything Penguin Related, Uncategorized | 8 Comments

Starace – Tron Inspired Beryl Theme For Linux

I’ve been working on making eye candy for my new Linux laptop. I decided to go with a Tron like theme. The first thing I did is make an emerald beryl window decorator theme called Starace.

I am releasing the Starace Theme under the creative commons license share alike license. Feel free to download and mix up the theme! All I ask is that if you have a facebook, please “like” my website.

Download Starace Emerald Beryl Theme



Starace Tron Inspired Beryl Emerald Theme


  1. Be sure you have emerald and compiz installed on your computer.
  2. Use alt-F2 and enter “fusion-icon –no-start”. A new icon should appear in your main panel
  3. Right click on the icon go to select window decorator and select emerald.
  4. Use alt-F2 and type “emerald-theme-manager -i %f”. This pops up the emerald themer window.
  5. Select import and find the Starace.emerald file you downloaded above
  6. Type alt-F2 and type the command “emerald –replace”

Starace should now be the beryl windows decorator theme.

On the newer versions of Ubuntu and Mint there is an issue with the emerald in the sofware manager being corrupt. In this case see this article to use a different ppa. You can know if you have this issue if you get a “segmentation fault” error if you type in “emerald –replace” into the terminal.


I credit the divergence theme for the initial inspiration for Starace along with the original button graphics that I modified.

Posted in Everything Penguin Related, Uncategorized | 1 Comment

C, C++ compiler and editor on Windows – Easy How To

In this tutorial I am going to show you how to get a C/C++ compiler/editor on your computer plus as an added bonus you’ll also get Java and Fortran compilers without any extra effort.

Windows is not a developer platform and is not out of the box ready for programming, especially when it comes to C/C++. So we are going to need to download and configure a few programs.

The first program we need is called Cygwin. Cygwin is a Linux emulator that contains our compilers. The second is called NetBeans. It is an IDE (Integrated Development Environment) that takes the compilers and makes them easy to use with tools like code completion and project management.

Installing Cygwin

  1. Download the Cygwin installer and download the setup.exe file
  2. Run the setup.exe file. Follow the default “next” install sequence until it asks you to select a download site, just pick any download site you feel like. Click next…
  3. The next step is where things get a little more complicated. Cygwin comes with a whole slew of Linux programs. All we really want are the compilers.
    • As shown circled in red in the picture below type “gcc”
    • Click the “Devel” tab plus mark
    • Click on the black ‘s’ looking thing to install a package. This should make the package say install.
    • Click on each of the packages I have outlines in red along with any other packages/compilers you feel like.
    Cygwin Package Manger

    Select the Compilers You Need

    • We need to do the same thing for “make” as we did for “gcc” following the same process. The picture below show you which package to get.
    Cygwin Package Manager

    Get the Make Package

    After selecting your packages click “Next.” Go watch a few youtube clips while it installs the packages and finish the installation.

Installing Netbeans

Netbeans is usually know as a Java IDE. However it has support for C/C++ and because you have installed Cygwin you could create c/c++ programs.

Netbeans needs the Java SDK to run. Get the JDK here (or google Java JDK download) and install it.

Download NetBeans Be sure to get the C/C++ version or the “all” version. Install NetBeans.

Getting Netbeans and Cygwin to Play together

Now that you have installed NetBeans start it up. Go to tools -> options and click on the C/C++ tab. After a few seconds of loading you should see a screen similar to the picture below.

If You See this Screen You’re Golden. Make sure you have the C Compiler, C++ Compiler and make commend.

If you see this screen that means you should be able to make and compile c/c++, Java, Fortran, and even assembly programs. Congratulations! Everything worked!

C/C++ Hello World!

Now that you have it “working” you probably want to get started. For the rest I will guide you through a basic hello world program.

  1. Go to File -> New Project
  2. Select C/C++ and select C/C++ application under projects and click “Next”
  3. Give the project a name and click “Finish”
  4. Some folders should appear on the left hand side. Click on the source files tab and double click on “main.cpp”
  5. See the picture below and enter the changed code to print “Hello World!”
  6. Click Run -> Run Main Project
  7. Congratulations!!! You now have a working compiler and a working first program… hopefully.You should see your programs output at the bottom of the IDE.

  8. If you have any questions or problems comment below.
Posted in Uncategorized | Comments Off on C, C++ compiler and editor on Windows – Easy How To

How to Add Social Networking to your WordPress Site

I have now added social networking to my blog. For anyone who has a wordpress website and wants to become “social” listen up because I am going to explain what I have done and how you can do it. Here’s what I have done,

  1. Facebook Comments can be left on any wordpress page or post where comments are enabled.
  2. Facebook “Like” Buttons are now on all posts
  3. A Facebook fan Page has been created which allows the ability to “Like” this website.
  4. A twitter news feed has been set up

1. Facebook Comments

Comments are like a jar of candy. Everyone has an opinion and the only thing keeping them from expressing it is that the jar is a little out of reach. However the jar of facebook comment candy is the easiest form of candy to reach and website viewers may not be able to resist leaving a comment.
Continue reading

Posted in Build Your Website, Uncategorized | Leave a comment

Manually Upgrade WordPress

This video and article explains how to easily manually upgrade wordpress.

  1. Download the new wordpress
    • Go to and download the new wordpress. As of writing this article the current version is 3.1.2.
  2. Upload the wordpress zip file to your server
    • Get a ftp client (I recommend FileZilla for all operating systems)
    • Login to your ftp account and find the wordpress root directory of your website. You’ll know its the root directory if you see a lot of wp-this and wp-that files.
    • Upload the wordpress zip file.
  3. Unzip and install the new wordpress
    • Get an ssh client. For Linux and Mac I recommend just using the “ssh” command line just like in the video. For windows I recommend either installing Cygwin and using the ssh command in it or there is the SSH Secure Shell.
    • Login to the ssh client.
    • Run the following code putting the paths that are correct for your server.

      #Change directory to the wordpress root directory.
      cd /path/to/root/
      #Unzip the wordpress file this will unzip the components in a
      #new folder titled wordpress
      #Go into the new wordpress folder
      cd wordpress
      #Copy all of the new wordpress files into the parent directory
      #make sure you are in the correct directory
      #/path/to/root/wordpress/ You can type in "pwd" to know what
      #directory you are in
      cp -Rf * ../
      #wordpress software is now updated, now just to clean up the
      #extra files. Go to the parent directort
      cd ../
      #remove the wordpress zip file and the extra directory make
      #sure you are in the /path/to/root/ directory
      rm -R wordpress
Posted in Build Your Website, Uncategorized | Leave a comment

Elon Musk Makes Rocket Science Affordable

Just as Henry Ford made the Automobile affordable it looks like Elon Musk will make the rocket affordable.

Check out this article

Posted in Uncategorized | Leave a comment


Project Counter Spin is ready and we launch tomorrow! After launch there will be a hike to recover it. The balloon will be filled to go to about 85,000 ft and land approximately 50-80 miles from the launch location.

I have lots of pictures, diagrams, and fun project related stuff to put up after finals are over.

(The original launch date was delayed one week from April 7th to April 14th on account of wind).

Posted in Counter Spin, Uncategorized | Leave a comment

E-Glass Structure

I got to get my hands dirty making an e-glass test structure.

E-glass is a fiberglass cloth that is sopped with epoxy. The fiberglass cloth makes it strong in tension and the epoxy makes it more rigid.

The awesome thing about e-glass is that is can be molded to make almost any shape: airplane wings, rocket fuselages, car bodies. It is also very light weight, and extremely strong in tension and moderately strong in compression.

The cloth used in E-Glass Composite.

To create our E-Glass structure we first cut the e-glass fiber into the shape we wanted. We used a 6 inch PVC tube tube, laying out the E-Glass into a cylinder shape around the pipe. We then used paint brushes to apply the epoxy mixture over the fiber. We were very careful to not allow the epoxy to bond the PVC pipe to the e-glass material.

Painting the Epoxy onto the E-Glass Fiber

Here you can see us painting epoxy onto E-Glass Fiber that has been wrapped around a 6 in pipe.

Before we allowed the epoxy to dry we placed another layer of the E-Glass material directly on top of the first layer and painted it on as we had for the first layer. This second layer gave the structure even more strength.

After it dried the E-Glass structure easily slid off of the PVC pipe.

After performing a basic “smoosh test” we decided to add a third layer of E-Glass to further increase the rigidity of the structure. Because we added the third later after the first and second layers had dried we got a few air bubbles in the epoxy but it wasn’t an issue.

Acrylic Heat Bending

Here you can see the acrylic heat bending and the c clamps that were used to press the acrylic into place.

In order for the camera to see we had to create a “window.” This window consisted of a piece of clear acrylic plastic that we heated to a high temperature and bent around the 6 inch PVC pipe. Also, in the background of the picture you can also see the finished e-glass cylinder.

Finished Outer Structure

This is the finished outer structure, still waiting for that painted flame design.

After finishing the window and the e-glass we cut the pieces to size and we used hot glue to connect them together. We added sandwich foam end caps for the cylinder and cut holes out of the caps for the brass connection rod.

After a long couple days fabrication the outer structure is done. Except it needs a paint job. Someone suggested an R2-D2 design, but I’m thinking black with blue flames – like a meteor careening through Earth’s atmosphere :).

Posted in Counter Spin, Uncategorized | Leave a comment