Sunday, July 20, 2008

GRUB Splash Image

This howto shows how to install a fullscreen splash image in the GRUB-bootloader. The image is entirely eye-candy and doesn't have any function besides that.

First you have to get a splash image. A great start is to go and download it from the web. Later I'll show how to make your own splash image.

Here is some sites where you can download GRUB splash images:

You can also download the GRUB splash image seen above, which is based on the Zepto logo:
Zepto GRUB Splash

Find the splash image you like and download it.
Place the image in the folder /boot/grub
1. start a terminal
2. sudo gedit /boot/grub/menu.lst
3. Add the line "splashimage (hd0,1)/boot/grub/splashimage.xpm.gz"
4. Add the line "viewport 0 0 80 21"
5. Save the file and exit gedit
6. Restart your linux-box
Note: change (hd0,1) so it matches your system. Look in the menu.lst file for help, as Ubuntu has set this up under the installation.

Background and foreground color in GRUB
Default Ubuntu installs GRUB with the background color black and the text as white. You can change the background and text color with the color parameter in menu.lst.

color foreground/background [highlight foreground/background]
The colors must be specified by the following symbolic names:

Background colors
black, blue, green, cyan, red, magenta, brown, light-gray

Foreground colors
black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-margenta, yellow, white

add "blink-" to the foreground color if the text should blink.
eg. "color light-gray/blue blink-black/light-gray"

If you don't specify a highlight color, the inverted colors will be used.

How do I make my own GRUB Splash Image?
The are 3 important factors the image must comply to:
  • The image must be in X Pixmap format, .xpm /.xpm.gz

  • The image size must be 640x480

  • The image must have 14 colors, indexed

Here is 2 ways how to convert a random picture to a 14 color 640x480 spash image:

The quick way:
1. make sure you have ImageMagick installed.
$ sudo apt-get install imagemagick
2. convert image.jpg -resize 640x480! -colors 14 -depth 8 splash-image.xpm.gz

The GIMP way:
1. Open the image in GIMP, click Image>Mode>Indexed...".
2. Choose "Generate optimal Palette" and choose 14 in number of colors. Set colordithering to nothing.
3. After the converting, save the image as filename.xpm. The GIMP automaticly saves the image in the correct format based on the filename extension.

If you want to compress the image with gzip:
$ gzip splash-image.xpm

This will create a gzip file with the filename splash-image.xpm.gz

Widescreen tip
If you have a widescreen monitor, like the Zepto 3215W's Crystal Clear, stretch the logo and text vertically by about 15%. The grub bootsplash will be stretched horizontally onscreen distorting your graphic. In effect, a perfect square becomes a rectangle. By stretching vertically now it will be rendered onscreen proportionally at boot time.

Thursday, June 19, 2008

Preload - Prefetching Daemon

If you want to improve startup time of your applications and the overall performance of your desktop, Preload is the right application for you. Preload is an adaptive prefetching/readahead daemon. Preload will determine common used applications and will keep the libraries in your RAM before you even load them up - this leads to a faster startup time. Preload is also adaptive enough to determine if you change your working habits as well.

Preload is in the Ubuntu software repositories, so you can install it this way:
sudo apt-get install preload

Preload doesn't need to be configured as it is adaptive and relies on a count of the number of times an application is launched. The configuration file for Preload is kept in /etc/preload.conf and the default values should be fine for most people.

Monitoring Preload
You can monitor Preload and see what files it holds in your RAM and how much RAM it uses.

sudo tail -f /var/log/preload.log
sudo less /var/lib/preload/preload.state

Wednesday, May 14, 2008

HUAWEI E220 3G modem HOWTO

Finally I got my HUAWEI E220 HSDPA USB 3G MODEM to work in Ubuntu. I've tried lots of things in Ubuntu 7.10, but it just wouldn't work.

Now that I've installed Ubuntu 8.04 I gave it a try again, and I figured it out pretty easily. Next to follow is a HOWTO to get the USB modem to work. Notice this guide is based on my experience with a modem from the Danish part of the mobile telephone company 3.


  • Use the short USB to USB mini cable provided in the package. The long cable with 2 USB sticks is said not to work. I haven't tried my configuration with the long cable yet, so I don't know if it will work. Stick to the short cable to start with.
  • Open a terminal (xterm is nice and have a small font) and type tail -f /var/log/kern.log . Now you have a window where you can see what the kernel is fiddling with. This window I now call Kernel status window.
  • Open a new terminal. This is where you'll be working in the next steps.
Edit /etc/wvdial.conf with nano, gedit, or your favourite text editor so it looks like this:
sudo gedit /etc/wvdial.conf
- - -
[Dialer Defaults]
Phone = *99***1#
Username = username
Password = password
Stupid mode = 1
Dial Command = ATDT

[Dialer hsdpa]
Modem = /dev/ttyUSB0
Baud = 460800
Init2 = ATZ
Init3 = ATE0V1&D2&C1S0=0 +IFC=2,2
ISDN = 0
Modem Type = Analog Modem
Init5 = AT+CGDCONT=1,"IP","";

[Dialer pin]
Init1 = AT+CPIN=****
- - -
replace **** with your own personal PIN code. Alternatively you can disable the PIN code with the modem driver application in Windows. I disabled my PIN code, and now the USB modem blinks a blue color as soon as its connected to a USB port and signal strength is good.

You can tweak your security by changing your Init5 command string. I recommend that you type all the strings in as comments (with a "#" first), and leave the one you need uncommented.
Like this:
Init5 = AT+CGDCONT=1,"IP",""; //bag en firewall
#Init5 = AT+CGDCONT=1,"IP",""; //delvis bag firewall
#Init5 = AT+CGDCONT=1,"IP",""; //ingen firewall

Now that you've set up all the basic stuff its time to plug the USB modem into an empty USB port in your PC.

The USB modem is both a modem and an CD-ROM drive. In Linux we don't need the CD-ROM part, that only contains the Windows drivers and applications.

When in modem state, the box offers three serial USB devices:

You should see the devices being created in the Kernel status window.
If there is more ttyUSB devices created its still fine.

Alternativly you can unplug your USB modem, remove the usb-storage kernel module, and reconnect your USB modem:
sudo rmmod usb-storage

Now its time to wake up the modem and get connected to the internet:
if you specified your PIN code in the wvdial.conf you'll have to execute the PIN code command string first. Otherwise skip this step.
sudo wvdial pin

run the following command and keep an eye on the LED on the USB modem:
sudo wvdial hsdpa

You'll notice a lot of reply information from the modem over the serial link.

If the LED stays constant blue you're connected to the 3 network. Open your browser and try to access a web page.

If you get a brand new HUAWEI E220 modem you somehow need to initiate it in Windows first. This sets up some default modem settings.

Firefox starts in offline mode
Workaround 1:
This workaround works on Firefox 3.0.1 or greater.
1. open Firefox
2. type in "about:config" in the address line
3. type in "toolkit." in the Filter box
4. find "toolkit.networkmanager.disable, and set it to "true" by double clicking on it

Workaround 2:
This workaround makes NetworkManager to be always online as we add a non existing interface. Firefox will then be in online mode when it starts.
1. open a terminal
2. sudo nano /etc/network/interfaces
3. add "iface eth1000 inet dhcp" to the end of the file
4. save and quit

Monitor applications
If you want to monitor signal strength and network statistics you can play around with these applications:

Saturday, May 10, 2008

PC Speaker disable

I've just installed Ubuntu 8.04 LTS on my Zepto 3215W, and everything works out-of-the-box. All the previously issues I've been writing about now works perfect.

One thing that still is annoying is the PC speaker, and it is very LOUD on a Zepto 3215W. Why is'nt the PC speaker disabled by default in a modern operating system?

To disable the PC speaker in Ubuntu do the following:

To disable the PC speaker immediately and only during this session, remove the kernel module:
sudo modprobe -r pcspkr

To disable and blacklist the kernel module from the startup scripts, edit /etc/modprobe.d/blacklist and add this line::
blacklist pcspkr

Monday, April 14, 2008

BIOS update 1.16

Today I updated/flashed the BIOS firmware on my Zepto 3215W to version 1.16. It went good, and i hasn't caused any trouble yet. See the Changelog.txt and howto at the link below.

I've installed Ubuntu 8.04 Beta and it runs very stable.

Monday, January 7, 2008

CPU Frequency Scaling Monitor

If you want to prolong the battery time on the laptop you have to make the CPU use as little power as possible. This can be done by forcing the CPU to run at its lowest clock frequency. By default Ubuntu uses the Ondemand frequency scaling policy, and you have no control over that. The CPU will alternate between 2 to 3 different clock frequencies depending on the CPU load.
If you follow this howto you can get control over the clock frequency scaling policy of your CPU with a few mouse clicks.

You can enable the applets full potential by doing one of the these:

Change the permissions on the program cpufreq-selector:
sudo chmod +s /usr/bin/cpufreq-selector

sudo dpkg-reconfigure gnome-applets
and answer “Yes” to the question regarding setting the suid of the cpufreq-selector executable.

If you left click on the CPU Frequency Monitor Applet, you can now select a clock frequency or choose the modes Conservative, Ondemand, Performance, or Powersave.

Sunday, January 6, 2008

BIOS update 1.13

A couple of days ago I updated/flashed the BIOS firmware on my Zepto 3215W to version 1.13. It went good, and i hasn't caused any trouble yet. See the Changelog.txt at the link below.

WARNING: Updating the BIOS wrong can brick your laptop. Update only if you have a problem or know what you are doing.

  1. Download the CD-image (.ISO) from Zepto's FTP-server here.
  2. Burn the image to a CD. I use a CD-RW for that purpose.
  3. Make sure your laptop have a fully charged battery and are connected to the AC-mainline.
  4. Reboot your laptop and boot from the CD. Try hitting F12 if your CD-drive isn't first in the boot device priority.
  5. When the CD boots up it will automatically overwrite the old firmware without any confirmation.
  6. To confirm that you are running the new firmware, go into the BIOS-menu and check the current version.