Monday, August 10, 2009

eee 901 hang during ubuntu linux suspend

My eee 901 was randomly hanging when entering a suspend mode. What would happen is when I try to resume it would just sit at a black screen. I would need to hard reset my system to bring it back online. Searching the web, I found the following that seems to be working for me.

  • vi /etc/pm/sleep.d/55hddpause
    • Add the following:

      #!/bin/bash
      case $1 in
      suspend)
      echo "Is my script running???"
      sync
      sleep 10
      esac
  • chmod +x /etc/pm/sleep.d/55pause
After creating that script which will run when your computer suspends I have not had anymore issues with resuming.

References:

hp ilo and self-signed certs with firefox 3

A very annoying thing I've encountered is that on our intranet we use to access hp iLOs the iLOs use self signed certs. Using firefox 3 to access these iLOs causes firefox to freak out and initiate a 4 step process to bypass the "unsecure" certificate. I got sick of wasting time for this since we manage hundreds of servers. I found the following plugin the brings the 4 click process down to 1 click:
Obviously (or maybe not), don't use this for a browser that you are using to serf the internet with ... only use it on a browser that you are using to access a secure and private network.

If someone knows of a way to eliminate the "Secure Connection Failed" warning page altogether, please leave a comment and let me know!

Monday, August 3, 2009

class com.hp.ilo2.remcons.remcons.class not found

Working on an HP system I administrate I ran into the following java error message when trying to pull up the remote console in firefox on my linux workstation
  • class com.hp.ilo2.remcons.remcons.class not found
What ended up being the solution was removing a cache directory that firefox has (clearing the cache from firefox did not work ...):

  • Close All Firefox Windows
  • cd $HOME/.mozilla/firefox/*.default/
  • rm -rf Cache
Now start firefox back up and try it again, should be working (or at least it did for me).

Tuesday, July 14, 2009

Ubuntu linux hibernation to file

The most recent project on my netbook was to get Ubuntu to hibernate correctly. Since netbooks are made for portability and conserving battery as much as possible is important I wanted to get this working badly. However, whenever I pressed the "Hibernate"button in the power options, it would just complain of not enough swap. So I decided to try and setup a file to use to hibernate to. In my situation this may not be the best option, but it was fun figuring it out. Here is what I ended up doing to get it to work.

Setup swapfile and some configuration for hibernation
Instead of rewriting a huge section, follow the instructions from: http://ubuntuforums.org/showpost.php?p=6570140&postcount=1

Additional configuration items
You can try to hibernate your system at this point now if you want. However, for me there was more work to be done. Here are the additional steps I had to take to take hibernation to completion.

Enable swap for hibernate then disable it after resume
  1. Create file /etc/acpi/suspend.d/01-swapctl.sh with the following:
    • #!/bin/sh
      swapon
    • Make sure to make it executable:
      • chmod +x /etc/acpi/suspend.d/01-swapctl.sh
  2. Create file /etc/acp/resume.d/99-swapctl.sh with the following:
    • #!/bin/sh
      swapoff
    • Make sure to make it executable:
      • chmod +x /etc/acpi/resume.d/99-swapctl.sh
Disable need for keyring password for Network Manager on resume
  1. Create file /etc/acpi/suspend.d/56-kill-wpa_supplicant.sh with the following:
    • #!/bin/sh

      killall wpa_supplicant
      sleep 5
    • Make sure to make it executable:
      • chmod +x /etc/acpi/suspend.d/56-kill-wpa_supplicant.sh
  2. Open gconf-editor:
    • gconf-editor
      • uncheck gnome_keyring_hibernate under path /apps/gnome-power-manager/lock
Restart Network Manager to refresh wireless
  1. Create file /etc/acpi/suspend.d/63-NetworkManager.sh with the following:
    • #!/bin/sh
      /etc/init.d/NetworkManager restart
    • Make sure to make it executable:
      • chmod +x /etc/acpi/suspend.d/63-NetworkManager.sh
Edit Shutdown Menu "hibernation button" script
  1. First we'll make a backup of the original script:
    • cp /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux.orig
  2. Now we will wipeout the original:
    • > /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux
  3. Now put the following contents into /usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux:
    • #!/bin/sh

      /etc/acpi/hibernate.sh

      exit $RET
References:

Something I started to look into that I may try in the future:

Thursday, July 2, 2009

Tethering blackberry 8830 on Ubuntu Linux with Bluetooth

Figuring out how to get my blackberry to tether with Ubuntu linux was a pain. I had to reference several different websites and take a little information from each to come up with a working solution. Here are the steps I took in order to get it to work for me. Some steps may be 'extras' as I did a lot of different things before coming to a working solution. I have not went through to figure out exactly what got it working. I may come back to clean this up a little later.

Pairing your blackberry with your computer over bluetooth
  1. Install Blueman Bluetooth manager (replacing bluez):
    • echo "deb http://ppa.launchpad.net/blueman/ppa/ubuntu jaunty main" | sudo tee -a /etc/apt/sources.list
    • gpg --no-default-keyring --keyring /tmp/awn.keyring --keyserver keyserver.ubuntu.com --recv 947C4F7371932C794B153F0F6B15AB91951DC1E2 && gpg --no-default-keyring --keyring /tmp/awn.keyring --export --armor 947C4F7371932C794B153F0F6B15AB91951DC1E2 | sudo apt-key add - && rm /tmp/awn.keyring
    • sudo apt-get update
    • sudo apt-get install blueman bluetooth bluez bluez-alsa bluez-cups bluez-gstreamer bluez-utils libbluetooth3 libbluetooth-dev bluez-compat bluez-pcmcia-support
  2. run blueman-manager or reboot if you don't know how
  3. Make sure bluetooth is enabled on your blackberry
  4. Make sure your blackberry is discoverable
  5. Right-click on the bluetooth icon in the taskbar, select Setup New Device…
  6. Click "Forward" button to proceed with searching for bluetooth devices
  7. Find your blackberry, select it and then click the "Forward" button
  8. Select "Don't connect" and click the "Forward" button
  9. Choose a pin to send to blackberry
  10. Enter pin on blackberry
  11. This should pair your blackberry with your computer
The steps above may not be needed. You may be able to utilize bluez-gnome for your pairing needs. I did the above steps (based off of the following blogpost of someone else: http://lnxg.wordpress.com/2009/05/26/tethering-a-blackberry-curve-and-linux/) hoping that blueman would go all the way on automatically configuring the DUN part also (the part I had you skip). However, for me, it was saying that I did not have a GPRS/CDMA capable device. However, I kept blueman because I liked it more then bluez functionality wise.

Figuring out device MAC with blueman:
  1. Click on the blueman applet
  2. You will see a list of bluetooth devices. Each displays a MAC address. Write down the MAC address for your blackberry
Figure out device MAC with hcitool:
  1. On the host (the computer that will connect to the BlackBerry), run:
    • hcitool scan
  2. The output will return a MAC address and device name. Write down the MAC address for your blackberry.
You can also get the MAC by checking around the blackberry bluetooth menus/options.

Configuring rfcomm.conf
  1. We need to get the channel for the DUN service provided by your blackberry:
    • sdptool search DUN
    • You should see something similar to the following output:
      Service Name: Dialup Networking
      Service RecHandle: 0x10000
      Service Class ID List:
      "Dialup Networking" (0x1103)
      "Generic Networking" (0x1201)
      Protocol Descriptor List:
      "L2CAP" (0x0100)
      "RFCOMM" (0x0003)
      Channel: 1
      Profile Descriptor List:
      "Dialup Networking" (0x1103)
      Version: 0x0100
  2. From the example above, we would use Channel 1. Yours may be different.
  3. Now let's edit /etc/bluetooth/rfcomm.conf. It should by similar to the following, replacing the channel and MAC with your values:
    • //Change to rfcomm1, rfcomm2, etc., if necessary
      rfcomm0 {
      # Automatically bind the device at startup
      bind yes;

      # Bluetooth address of the blackberry device
      device 00:11:22:33:44:55;

      # RFCOMM channel for the connection
      # This should match the channel number from the sdptool output
      channel 1;

      # Description of the connection (whatever you want to call it)
      comment "BlackBerry DUN";
      }
  4. Now restart bluetooth:
    • /etc/init.d/bluetooth restart
  5. Check that /dev/rfcomm0 exists:
    • ls -l /dev/rfcomm0
  6. If it doesn't, create it manually:
    • rfcomm bind 0 your-phone-mac-address your-phone-rfcomm-channel
      • You can then release it (delete /dev/rfcomm0) by:
        • rfcomm release 0
Configuring PPP
  1. First we will create the chatscript that PPP will use. The following steps should work for ATT/Cingular. Different providers will require different contents for the chatscript. You can reference the following link for some ideas for other carriers: https://help.ubuntu.com/community/BluetoothDialup#Carrier%20specific%20configuration%20info
    1. Start editting a file
      • vi /etc/chatscripts/att
    2. Add the following to the file:
      • # Activate the device and pause before sending additional AT commands.
        '' AT+CFUN=1
        '' AT

        # Verify GPRS Attach prior to attempting PDP Context negotiation.
        '' AT+CGREG=1

        # Define the PDP context. THIS WILL BE DIFFERENT FOR DIFFERENT CARRIERS.
        OK AT+CGDCONT=1,"IP","isp.cingular"

        # Set the dialing string and specify which PDP Context definition to use.
        # THIS WILL BE DIFFERENT FOR DIFFERENT CARRIERS.
        OK ATDT*99***1#

        # Attempt to connect.
        '' CONNECT
  2. Now we will setup the PPP password file(s) to authenticate with the provider over the tether. Again, this information is specific to ATT/Cingular as a provider:
    1. vi /etc/ppp/chap-secrets
    2. Add the following information:
      • WAP\@CINGULARGPRS\.COM  *       CINGULAR1
    3. vi /etc/ppp/pap-secrets
    4. Add the following information:
      • "WAP@CINGULARGPRS.COM" * "CINGULAR1"
  3. Now we will setup the PPP script that, again specific to ATT/Cingular:
    1. vi /etc/ppp/peers/att
    2. Add the following information:
      • lcp-echo-failure 0
        lcp-echo-interval 0
        hide-password
        noauth
        connect "/usr/sbin/chat -v -f /etc/chatscripts/att"
        debug
        /dev/rfcomm0 115200
        defaultroute
        noipdefault
        user "WAP@CINGULARGRPS.COM"
        remotename att.new
        ipparam att.new
        usepeerdns
All configuration items should now be complete. We can now try to initialize a tether with our blackberry.

Initiate Blackberry Tether
  1. Check if you have any routes setup
    • route -n
      • If you have routes in your routing table, disable all of the devices (under column Iface). We need a clear routing table to have this work correctly.
  2. Now we will turn on the PPP for att.net
    • pon att.new
      • You can watch /var/log/messages to see if it works correctly or errors with a code/description
  3. If everything worked, you should now have a pan0 and ppp0 interface in your network list
    • ifconfig -a | grep -P 'ppp|pan'
  4. Check your routing table to make sure routes are setup for this new ppp device:
    • route -n
  5. Take your connection on a test drive!
Disconnecting
  1. To disconnect you need to turn off ppp:
    • poff att.new
References

Listed are the links that I referenced and combined information from to get to this point.

Thursday, June 5, 2008

gam_server High CPU usage

I run RHEL 4 ES on my workstation at work and have noticed there are times when I am doing work that involves high I/O on my harddrive that gam_server will use excessively high amounts of memory and CPU.

I have searched high and low on a way to disable this process and could not find one that worked for me. There is however the following the may work for you:

http://ubuntuforums.org/showthread.php?t=210329&highlight=gam_server

Like I said, it did not work for me. What I ultimately did to disable it was rename the gam_server binary and kill the gam_server process. When it tries to respawn, the binary is "no longer there".

  • mv /usr/libexec/gam_server /usr/libexec/gam_server.old
EDIT: One thing I noticed when disabling gam_server when using "Open..." in programs to open files, it could be really slow. Since gam_server is used to monitor file alterations and is no longer running I think that caused the system to do scans instead of hitting some cache. Not positive, but know there are risks.

Thursday, May 29, 2008

vpnc on Cygwin

vpnc is a nice VPN client to use because it lets you setup routes specifically for the VPN network, instead of globally. I like this because I have file servers that my computer access that I "loose access" to whenever I create a VPN connection normally.

Here are the steps I needed to take to install vpnc on Cygwin to allow it to work in Windows.

Requirements:
  • Download vpnc source
    • I used version 0.5.1
  • Download Cygwin Install file
  • Download OpenVPN
Steps for Installation
  1. Install Cygwin with the packages:
    • Base (everything)
    • Devel: make
    • Devel: gcc
    • Perl: perl
    • Libs: libgcrypt
      • Source also
    • Libs: libgpg-errors
    • Libs: libiconv
    • Libs: libiconv2
    • Editors: vim
  2. Install OpenVPN. During the install just have “TAP-Win32 Virtual Ethernet Adapter” and “Add Shortcuts to Start Menu” checked.
  3. Start the Cygwin shell by executing the "Cygwin" icon on your desktop
  4. copy the vpnc source gzipped tarball to /var/tmp
  5. Copy libgcrypt source to /var/tmp
    • cp /usr/lib/src/libgcrypt-[version].tar.bz2 /var/tmp
  6. cd /var/tmp
  7. "Unzip" libgcrypt source file
    • bunzip2 libgcrypt-[version].tar.bz2
  8. Untar libgcrypt source file
    • tar -xvf libgcrypt-[version].tar
  9. cd libgcrpyt-[version]
  10. Compile libgcrypt
    • make
  11. cd /var/tmp
  12. "Unzip" vpnc source file
    • gunzip vpnc-[version].tar.gz
  13. Untar vpnc source file
    • tar -xvf vpnc-[version].tar
  14. cd vpnc-[version]
  15. Edit Makefile file
    • vi Makefile
  16. Add bulletted line after "LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)"
    • LDFLAGS += -L/var/tmp/libgcrypt-[version]/src/.libs
  17. Compile vpnc
    • make
  18. Install vpnc
    • make install
Configuration
  1. First you will need to rename the TAP connection you created when you installed OpenVPN to not contain any spaces:
    1. Open "Network Connections"
    2. Rename your TAP Virtual Adapter from "Local Connection #" to "my-tap"
  2. When you try to use vpnc it will want port 500 open by default. This port is used by the IPSEC service in windows (if the service is started). You can either
    • Use a different port by configuring "Local Port" in the vpnc config file which we will look at in step 2
      • This may be required to work with your concentrator depending
    • Stop the IPSEC service (if its running) to make port 500 available
      • This may be required to work with your concentrator depending
  3. You will need to setup your config file for vpn now. This file is located at /etc/vpnc/default.conf You can setup the following variables
    • vi /etc/vpnc/default.conf
      • Required:
        • IPSec gateway [gateway-ip]
        • IPSec ID [group-id]
        • Xauth username [username]
      • Optional:
        • Xauth password [password]
        • IPSec secret [group-psk]
        • Local Port [portNumber]
        • NAT Traversal Mode [mode]
        • Interface name [intName]
        • Interface mode [mode]
      • My settings are:
        • IPSec gateway [notTelling]
        • IPSec ID [notTelling]
        • Xauth username [notTelling]
        • Xauth password [notTelling]
        • IPSec secret [notTelling]
        • NAT Traversal Mode cisco-udp
        • Interface name my-tap
        • Interface mode tap
Running vpnc
  1. /usr/local/sbin/vpnc --no-detach
Running vpnc with routing
As stated in the beginning, the nice thing about vpnc is you can have "vpn traffic" have a seperate gateway from "normal traffic". All you should need to do is add a specific route/gateway to use from your normal traffic. Do this after creating the vpnc connection.
  1. route add [networkip] mask [networknetmask] [gatewayip] metric 1
    • Example:
    • route add 50.0.0.0 mask 255.0.0.0 50.0.0.1 metric 1