Πέμπτη 6 Δεκεμβρίου 2007

Ubuntu Customization Guide v2

Ubuntu Customization Guide v2

gnome_apps.png

Changes are part of Nature so as with Technology.. Though this cannot be True for Windows and Mac cause the life cycle of a single Version is too much which is not the case with Linux.. Open Source evolve at very rapid rate and with evolution comes new & special changes … Today with a hike in Linux acceptance its pretty hard for competitors to provide similar solutions at free of cost. Open Source is known for User Interaction with Operating System which cannot be done with other OS. Linux user can customize, create, edit, add files according to his/her taste..and customization is the part where Linux is one step ahead of every OS.. You need not to search for poorly written Customization Packs.. What you need is just follow the guide and pimp up your desktop as you like. .. The guide will focus on a particular area but you can customize your desktop using the way mentioned and adding your own idea…
With Gusty Gibbon packed with latest tools and great support couple with new gGun Gnome 2.20, I was adamant to write another Customization Guide..Since M$ launched Vista and Apple launched Leopard quite a while ago so I’ll let you know how to customize your Ubuntu to Vista and Leopard.. Added with few new Customization that I used it…
I have tried to kept the guide as simple as I can so that even a newbie can understand how to make changes.There are few major changes in Ubuntu Themes and Icon Control Panel so please read carefully so that you can get everything..


Points to Ponder

This guide will let you pimp you Ubuntu latest Gusty Gibbon i.e Ubuntu 7.10 . If you don’t know how to get Ubuntu the head towards Ubuntu download and download a copy today which suits best your system.. There you will will be prompted to choose location and system type. After downloading, burn the image and boot through it and Install Ubuntu in 6 easy steps…

“The themes icon set , wallpaper ,desklets, fonts ,sounds
used while customization the Operating System are ® to their
respective owner. Copying, editing and use of those
application are free and can be distributed without
the owner permission.”

Though I had used few Icon Links and themes , but this does not meant that your are confined to those only .. You can always use your own choice themes and icons from Gnome-Look.org..

Note: Though this guide has been made to customize Ubuntu Gusty Gibbon but this can be used to Customize other OS which comes with Gnome 2.20 installed/optional..Though installation of particular software can be different.
So hold your breath and go through the complex customization made easy..

Installation / How To

Installation of the themes, icons, cursors have totally changed. Now the previous theme/icon control panel, Cursor Control panel has been merged into a single CP i.e Appearance Wizard .. This is available with new Gnome 2.20 .. The Appearance wizard lets you configure your theme,icon , cursor, metacity/gtk windows border, color if supported by theme.. Apart from that you can add wallpaper, change fonts, change Menu/Tool bar Interface, and select the Visual Style i.e Desktop with 3d Effects or without it..
Installation in Gnome 2.20 is very easy as compared to previous version so lets take a look on how to install themes, icon cursor and other customization stuffs..

Installing Theme/Icons/Cursor:- To install theme,icon or cursor just follow the give steps..There are mainly 2 methods of installing a GTK2.x themes,icons and cursor ….So lets take a quick look on both of the process.

1’st Installation Process:-

  • Download the theme/icon/cursor from given Source.. and Save it to Desktop..
  • Note that the theme or other pack must have following extension .tar.gz or .tar.bz2 .
  • If the theme did not come with the following extension you have to convert it into it… To do this open the Theme Archive by double clicking it.
  • Now Unzip the the archive only if has other extension the the mentioned above and Unzip it.. Place the Unzipped Folder to Desktop..
  • Note in case the theme comes in .rar pack then you cannot unzip it since default Ubuntu Archiver did not support .rar extraction .. To make your archiver able to do this open Terminal and type the following commands , make sure all the options .Under Software Sources are checked else it will not install via following command..

    Code:

    sudo apt-get install unrar
  • After you unzipped the non .tar.gz and .tar.bz2 archive.. Right click the Folder the is being Unzipped. and select Create Archive option.. Under this select .tar.gz or .tar.bz2 .

  • After you successfully created the desired archive Open Appearance by Right Clicking on empty Space and selecting Change Desktop background or navigate to System -> Preferences -> Appearance.
  • After that drag a Windows will open with several tabs.. navigate to Themes Tag. After the navigation drag the .tar.gz or .tar.bz2 archive in the Themes tab Windows.
  • The installation of themes/icons and Cursor will be finished and you willl be prompted to Apply the New Installed theme or Keep System with default/presently set theme.
  • You can always select and mix theme/icon and cursor by pressing Customize tab in the Themes option. Navigate to Controls, Windows Border , Icons and cursor to set your choice theme…

2′nd Installation Process:-

  • The second Installation process is simple too.. Download the Icon/Theme/Cursor from give source ..
  • The unzip the Archive … Save the folder to Desktop.
  • Now Paste the folder in these locations.
  1. Themes : - ~/.themes
  2. Icons : - ~/.icons
  3. Cursor :- ~/.icons
  • ~/ refers to /home/.. You cannot view extra content of your Home Folder..
  • To view all the contents Point towards View option in the 1’st toolbar and select “Show Hidden Files” or press Ctrl+H.
  • The Icon/Theme and Cursor option now can be seen under Theme Tab of Appearances.

Miscellaneous Installation : - This Installation Guide is based on Installation of different customization packs like GDM theme, Splash themes , Sounds , Fonts etc….

Log In/ GDM Theme Installation : - Installation of GDM theme is very easy .. Just download the GDM theme from given location and save it to your desktop. Now click on Main Menu and point towards System then towards Administration and open LogIn Windows. Click on Local tab and drag you GDM theme to Local Window. your theme will be automatically gets installed and you can select it by clicking on the desired screen/theme. After next reboot you can see a new Log In Screen..

Download : Start Up Manager



Splash Image Installation : - There are 3 types of Splash Part that are used in Linux .. I’ll let you know how to install and change splash of all 3 kinds. So lets take a look about Splashes :-

  • Grub Splash : - The 1’st Splash Screen that appear .. Its is mainly the Grub menu from where you select booting into multiple OS if has else will load Linux only.. Grub Splash place an image at the grub screen that add’s eye candy to it …The grub splash comes with extension .xpm.gz . To install a Grub Splash copy the ~.xpm.gz file to /boot/grub/splashimages since only root user can copy/edit Root File system your need to gain root privileged.

To do this Open terminal from Main Menu -> Accessories -> Terminal. Type

Code:

  sudo nautilus

and press enter. A new Window will open which will let you copy/edit modify files of root file system.. Copy the desired ~.xpm.gz to /boot/grub/splashimages . Now to change Grub Splash you need a software known as Startup Manager. To download click here . Download the latest .deb file so that you can easily install it.. After the download gets finished double click the .deb file and click install .. Note : You must be connected to net while installing it .. Few files will be downloaded to complete installation..

After the installation finished navigate to System -> Administartion -> Startup Manager. After it opens click on Boot Option and check “Show Boot Loader” & “Show Boot Splash” options under Misc..After you are done click on Appearance tab and check “Use Color In Boot Loader Menu” and “Use Background Image for BL” . Assuming you have already copied the ~.xpm.gz file select desired Grub Splash from drop down list under grub Splash Option.
Now Installation is finished you will see a Grub Splash after next reboot.

  • Boot Splash / Usplash : - Boot Splash or U Splash is boot screen.It is the 2′nd Splash Screen that appears. To change Usplash 1’st download the Usplash from give location. The Usplash themes comes with ~.so extension. To install it you need to copy the ~.so files to /usr/lib/usplash . Since only root user can paste and edit files under File system. gain root privileged.. To do this Open terminal from Main Menu -> Accessories -> Terminal. Type

    Code:

    sudo nautilus

    and press enter. A new Window will open which will let you copy/edit modify files of root file system.. Copy the desired ~.so to /usr/lib/usplash ..



After the installation finished navigate to System -> Administartion -> Startup Manager. After it open click on Appearance tab . Assuming you have already copied the ~.so file, select desired USplash from drop down list under USplash Option.
Now Installation is finished you will see a new USplash after next reboot.

Note : - You can face few problem changing Usplash via Startup Manager. If you face problem that your Usplash did not change even after selecting different Usplash from Startup Manager.. To overcome this problem rename the Usplash you want to change to usplash-theme-ubuntu but this will replace default Ubuntu Splash so take backup before doing this step….

  • GTK Splash : - Gtk Splash is the last splash screen that comes after Log In Screen.GTK Splash are normal images thaT comes with ~.png extension .To Install download the GTK Splash images from give links and paste them under /usr/share/pixmaps/splash since its is under Root File System you need root privileged. To do this Open terminal from Main Menu -> Accessories -> Terminal. Type

    Code:

    sudo nautilus

    and press enter. A new Window will open which will let you copy/edit modify files of root file system.. Copy the desired image to /usr/share/pixmaps/splash ..

To Install GTK Splash Open Terminal and type

Code:

sudo apt-get install gtweakui

.This will install gtweakui which is a very handy tool.. Now after the installation gets finished open gtweak sessions from System -> Preferences -> gtweak sessions.. Check Show Splash Screen on Log-In click on big thumbnail and select desired image..
Installation is finished now you can view new GTK Splash after next Log-In..

Sounds Installation : - Sounds are beeps/music that are the reaction of computer towards user integration. You can install different sound to do this 1’st download the sound from given location. The unzip the folder to desktop.. Now Paste the Folder to /usr/share/sounds since its is under Root File System you need root privileged. To do this Open terminal from Main Menu -> Accessories -> Terminal. Type

Code:

sudo nautilus

and press enter. A new Window will open which will let you copy/edit modify files of root file system.. Copy the desired image to /usr/share/sounds . To change sound navigate to System -> Preferences -> Sound a new window will open Click on Sounds tab and change the cound you want to change.



Emerald Installation: Emerald provide windows border when 3d desktop manager is selected. Emerald provide huge set of beautiful windows border to match you wallpaper and themes.. To install Emerald Open Terminal and type

Code:

sudo apt-get install emerald

, this will install emerald. You can access emerald from System -> Preferences -> Emerald Theme Manager.
Emerald themes comes with .emerald extensions.. To install themes download from give location and Open Emerald theme Manager.. Click on Import and navigate to ~.emerald file and click open your new Emerald theme is installed .. In order to use the Emerald theme your 3d Composite Manager should be running just select the theme you want to use from Emerald theme Manager…

Terminal Hack :- To make Terminal transparent with/without Berly follow the steps Open Terminal click on Edit tab. Then select Current Profile, a new window will open click on Effects tab. Under effects tab you will notice background option. Select Transparency and adjust the amount of transparent desktop you need. You now has a transparent Terminal.

Customization to OSX

Apple latest OS that is full of eye candy and beautiful sets of icon and themes. Customization of OSX is very easy and selective in terms of icons and themes as there are plethora of themes and icons sets present to pimp you Ubuntu to OSX…So lets start the customization .. The new version of Ubuntu hasn’t changed in terms of UI by default so it pretty same customization in the beginning ..Here is the default Ubuntu desktop which has 2 Taskbars or Panel..The upper Panel is for navigation of Menus while the lower panel has option for navigation of Active Widows and Workspace..
Since OSX comes with One dock and sigle panel we have to configure Ubuntu like it only .. So lets follow the steps to configure ubuntu into OSX..

  • The 1’st thing is we have to delete the lower panel ..Right Click on lower panel and select Delete. After that your lower panel will be deleted..
  • The lower panel has 3 main applications . i.e Windows List, Workspace Switcher & Trash Icon.Apart from these three only Windows List is important.
  • To get Windows List in Upper Panel Right Click upper panel and select Add to Panel..
  • A new Windows will appear under Desktop & Windows option click on Window List and select add..
  • Now you have successfully created a new panel…

Customization of the panels have been successfully done. Now we should head towards customization of Looks, Feel and Sound of OSX..
Since OSX has 2 flavor one is old OSX and other is new Leopard so I has selected themes so that you can choose a particular theme for OSX according to your taste.. There are lots of other themes too but I’ll recommend you to use this at most and after you know how to change theme you can select theme by your own choice..

Fos OSX Old : -

For OSX Leopard Customization : -



Misc. Customization Pack : -

Customization to Vista

Vista is the latest OS from Microsoft camp.. Promised a lots Vista fails to stands even a single..Finding Gnome 2.20 Vista theme is pretty difficult since developers are least bothered about it .. but still I find something that will match the taste of it … So lets start the customization of Ubuntu to Vista.
Since Vista comes with One dock and single panel we have to configure Ubuntu like it only .. So lets follow the steps to configure Ubuntu into Vista..

  • The 1’st thing is we have to delete the lower panel ..Right Click on lower panel and select Delete. After that your lower panel will be deleted..
  • The lower panel has 3 main applications . i.e Windows List, Workspace Switcher & Trash Icon.Apart from these three only Windows List is important.
  • To get Windows List in Upper Panel Right Click upper panel and select Add to Panel..
  • A new Windows will appear under Desktop & Windows option click on Window List and select add..
  • You can change the position of panel just click on empty space of panel and drag where you want to place it..But I will suggest you to place the tab in the upper side only..

Now you have successfully created a new panel…and customization of Panel has been done . So head towards configuring theme and other parts of Ubuntu to make it look like Vista…

For Vista Leopard Customization : -

Miscellaneous Customization

Since I have been customizing Ubuntu from a long time I thought of giving few other and nice Customization. I have added few new customization : -

  1. New Human Customization.
  2. Dark Ubuntu Customization..
  3. Peace Ubuntu Customization.

So let me start with my newly added customization ..

New Ubuntu Customization :- This Customization part will be focusing on providing new Human Theme, better icon and will provide with you new and better goodies..Panel customization will remains the same as you have done with Vista and OSX .. So head towards configuring theme and other parts of Ubuntu to make it look like new and improved Ubuntu…

For New Ubuntu Customization : -



Dark Ubuntu Customization :-
This customization will customization will customize your Ubuntu to Dark Ubuntu providing your Ubuntu a new dark look that you will like a lot.Panel customization will remains the same as you have done with Vista and OSX .. So head towards configuring theme and other parts of Ubuntu to make it look like dark Ubuntu…

For Dark Ubuntu Customization : -

Peace Ubuntu Customization : - This customization will change the look of you Ubuntu and will provide a serene white look that will provide you peace while your work.Panel customization will remains the same as you have done with Vista and OSX .. So head towards configuring theme and other parts of Ubuntu to make it look like dark Ubuntu…

For Peace Ubuntu Customization : -

Docks and Desklets

A cool desktop without Desklets and a cool Dock cannot be consider cool cause main eye candy if being provided by these Utils only.. In this part I’ll guide you Installing Dock and Desklets Manager.. The Dock I will install is the most stable and is frequently updated know as AWN or Avant Windows Navigator is the best dock available for Linux So lets take a look at the Installation Steps of AWN and Desklets manager I’ll use is Screenlets since Gusty comes with Compiz by default user will not face problem with transparency and all….

Note: Before you try to install any of them I’ll recommend you udate your system through Update Manager..

Installing Avant Windows Navigator in Gusty Gibbon: - AWN is a Fully customizable dock-like window navigator for GNOME. Awn is pretty stable and comes with some striking features so lets take a look on how to install AWN In Ubuntu Gusty Gibbon..To do this open Terminal and type the following codes..

Code:

 gksudo gedit /etc/apt/sources.list

At the end of the text add these lines

Code:

 deb http://download.tuxfamily.org/syzygy42/ gutsy avant-window-navigator

deb-src http://download.tuxfamily.org/syzygy42/ gutsy avant-window-navigator

Now copy and paste the following codes in Terminal ..

Code:

wget http://download.tuxfamily.org/syzygy42/reacocard.asc -O- | sudo apt-key add -

sudo apt-get update

sudo apt-get upgrade

For AWN BZR do:

Code:

 sudo apt-get install avant-window-navigator-bzr

You can install more applets for AWN by doing:

Code:

 sudo apt-get install awn-core-applets-bzr

Installation of AWN is finished you can Customize AWN from AWM Manager which you can Access from System -> Preferences -> AWN Manager

Here is a theme that you will need for AWM To install the theme open AWN Manager and under theme tab add the theme to AWN manager apply it and after next time you will open AWN theme will be activated..

Installing Screenlets in Gusty Gibbon: - Screenlets provide with some eyecatching desklets that pimp your desktop and give a much better look.. Screenlet provide a lot of desklets which work when 3d Composite Manager is turned On..So lets take a look how to install Screenlets :-
Open Terminal and type the following code :–

Code:

echo “deb http://download.tuxfamily.org/screenlets gutsy screenlets” | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install screenlets

Download Screenlets from www.screenlets.org/ .. Extract the archive and place the folder at desktop.. Now open Terminal and type following codes..

Code:

cd 

Then type this

Code:

sudo make install

Now you can access Screenlets from System ->Preferences -> Screenlets
Enjoy you have installed the best pimping utility …

Adding Screenlets in database : - To add a screenlets 1’st download the screenlet from gnome-look.org or Screenlet home page and follow the steps mentioned ..
To do this Open terminal from Main Menu -> Accessories -> Terminal. Type sudo nautilus and press enter. A new Window will open which will let you copy/edit modify files of root file system.. Copy the desired image to /usr/local/share/screenlets ..

Now download the Screenlets from Gnome-look.org and unzip them .. Open /usr/local/share/screenlets under root privileged and paste the folder under it you can now access your added Screenlets from Screenlets Manager i.e under System ->Preferences -> Screenlets

Conclusion

Well I am ending my customization guide now hope you must have liked it and I am sure it will help you pimp your Ubuntu / Linux Mint Desktop… So here Ubuntu Gusty Customization Guide or Linux Mint Customization Guide comes to an end…

This guide is free to use. No part or whole of this guide should be reproduced without my permission.

Thats all for now. Hope you all will like the hard work.. Keep the reply and suggestions coming. Any queries ask.

Κυριακή 11 Νοεμβρίου 2007

Sudo and gksudo

If you've used Linux for any amount of time, you might be used to running programs as root directly whenever you need to install packages, modify your system's configuration, and so on. Ubuntu employs a different model, however. The Ubuntu installer doesn't set up a root user -- a root account still exists, but it's set with a random password. Users are meant to do administration tasks using sudo and gksudo.

You probably already know how to use sudo -- just run sudo commandname . But what about running GUI apps that you want to run as root (or another user)? Simple -- use gksudo instead of sudo. For instance, if you'd like to run Ethereal as root, just pop open a run dialog box (Alt-F2) and use gksudo ethereal.

By the way, if you really must do work as root, you can use sudo su -, which will log you in as root. If you really, really want to have a root password that you know, so that you can log in as root directly (i.e., without using sudo), then run passwd when logged in as root, and set the password to whatever you want. I'd recommend using the pwgen package to create a secure password not only for root but for all your user accounts.

Ubuntu Related Books

If you are ubuntu user and if you are looking for some ubuntu related books for free check this

Book Title: Moving to Ubuntu Linux By Marcel Gagné

Publisher: Addison Wesley Professional

Brief Introduction

Discover Ubuntu, Today’s Hottest Linux

Everyone’s talking about Ubuntuit’s not just 100% free, it’s the most useful, practical desktop Linux ever! Now, Linux expert Marcel Gagné reveals Ubuntu’s amazing power and helps you migrate from Windows faster than you ever thought possible.

Moving to Ubuntu Linux will teach you how to do virtually anything with Ubuntuwrite documents, create spreadsheets, surf the Web, use email, listen to music, watch movies, and play games.

Install Ubuntu fast, with easy, step-by-step instructions

Take control, with the GNOME desktop environment and Nautilus file manager

Browse the Internet using Firefox, the powerful browser that’s quickly replacing Microsoft Internet Explorer

Find and install all the software you’ll ever need, with Ubuntu’s powerful Synaptic package manager

Send email, track contacts, create calendars, and manage all your personal information with Evolution

Organize digital photos, rip music, burn and play CDs, watch movies, create graphics, and more

Discover the world of Linux games, and learn how to run Windows games on your Ubuntu PC

Set up an efficient, convenient network for your home or small business

Customize your desktop so it’s perfectly comfortable and totally efficient

Free E-Book Check here

Book Title: The Official Ubuntu Book By Benjamin Mako Hill, Jono Bacon, Corey Burger, Jonathan Jesse, Ivan Krstic

Publisher: Prentice Hall

Brief Introduction

Ubuntu is a complete, free operating system that emphasizes community, support, and ease of use while refusing to compromise on speed, power, and flexibility. It’s Linux for human beings–designed for everyone from computer novices to experts. Ubuntu is the most in-demand Linux distribution, and this official guide will get you up and running quickly.

Learn how to seamlessly install and customize Ubuntu for your home or small businesses. Its open source power can be used in schools, government, or by corporations, and is suitable for both desktop and server use. The Ubuntu community is built on the premise that software should be available free of charge, and that people should have the freedom to customize and alter their software in whatever way they see fit.

Written by leading Ubuntu community members, this is the only book that you need to become a savvy Ubuntu user.

Covers the latest version of Ubuntu–Ubuntu 6.06LTS

Covers every standard desktop application from word processing, spreadsheets, Web browsing, e-mail, instant messaging, music, video, and, of course, games, all the way to software development, databases, and other server applications

Includes real-world troubleshooting advice contributed by Ubuntu users from around the world

Learn about the extended Ubuntu community, which includes translators; software developers; teachers; people who love to hand out CDs and help friends try free software; artists; people who write documentation, tips, and guides; accountants; and even a lawyer or two.

Covers both Ubuntu and Kubuntu desktop systems

Explains Ubuntu Server installation and basic administration, complete with advanced installer features like LVM and RAID

This book comes with a version of Ubuntu that can run right off the DVD, as well as the complete set of supported packages for Ubuntu, including Kubuntu. Try out Ubuntu on the DVD. If you want to keep it, install it directly from your desktop.

Free E-Book Check here

Book title: Ubuntu Hacks By Bill Childers, Jonathan Oxer, Kyle Rankin

Publisher: O’Reilly

Brief Introduction

The Ubuntu distribution simplifies Linux by providing a sensible collection of applications, an easy-to-use package manager, and lots of fine-tuning, which make it possibly the best Linux for desktops and laptops. Readers of both Linux Journal and TUX Magazine confirmed this by voting Ubuntu as the best Linux distribution in each publication’s 2005 Readers Choice Awards. None of that simplification, however, makes Ubuntu any less fun if you’re a hacker or a power user.

Like all books in the “Hacks” series, Ubuntu Hacks includes 100 quick tips and tricks for all users of all technical levels. Beginners will appreciate the installation advice and tips on getting the most out of the free applications packaged with Ubuntu, while intermediate and advanced readers will learn the ins-and-outs of power management, wireless roaming, 3D video acceleration, server configuration, and much more.

Free E-Book Check here

Book Title : Ubuntu Unleashed By Andrew Hudson, Paul Hudson

Publisher: Sams

Brief Introduction

Incorporating an advanced approach to presenting information about Ubuntu, Ubuntu Unleashed aims to provide the best and latest information that intermediate to advanced Linux users need to know about installation, configuration, system administration, server operations, and security. Written by renowned open source authors, Paul and Andrew Hudson, it includes detailed information on hot topics in Ubuntu Linux, such as wireless networks, and programming in PHP, Perl and others. It thoroughly covers all of Ubuntu’s software packages, including up-to-date material on new applications, Web development, peripherals, and programming languages. It also includes updated discussion of the architecture of the Linux kernel 2.6, USB, KDE, GNOME, Broadband access issues, routing, gateways, firewalls, disk tuning, GCC, Perl, Python, printing services (CUPS), and security. The included DVD comes with a complete Ubuntu Linux distribution.

Free E-Book Check here

Howto Setup Bluetooth Keyboard and Mouse in Ubuntu

If you have a Bluetooth Keyboard and Mouse here is the procedure to follow howto setup in ubuntu

We need the MAC address (e.g. 00:00:00:00:00) of the mouse and keyboard.You can use KEYBOARD_ADDR and MOUSE_ADDR where you should find the addresses for the keyboard and mouse respectively. Press the button on the mouse that makes it visible to be found by the computer. Do the same for the keyboard. Now open a terminal window and run the following command

hcitool scan

Scanning …
KEYBOARD_ADDR Microsoft Wireless Keyboard
MOUSE_ADDR Microsoft Mouse

Adding the Keyboard and Mouse

Now we need to add the keyboard and mouse to the bluetooth configuration files. Run the following command to pop up GEdit

sudo gedit /etc/bluetooth/hcid.conf

You may be asked for your password, this is because we used sudo.

At the end of the file, add the following (replacing KEYBOARD_ADDR and MOUSE_ADDR for the keyboard and mouse MAC addresses as found earlier)

device KEYBOARD_ADDR {
name “Microsoft Wireless Keyboard”;
auth enable;
encrypt enable;
}

device MOUSE_ADDR {
name “Microsoft Mouse”;
}

Now you need to restart the bluetooth subsystem so that it refreshes it’s configuration file.

sudo /etc/init.d/bluez-utils restart

* Restarting Bluetooth services… [ ok ]

Pairing the Devices

You now need to pair the devices with the computer. Do not press any buttons on the keyboard as we’ll need to use it to enter a passcode so we can pair. Run the following command

sudo hidd --search

Searching …
Connecting to device MOUSE_ADDR
Connecting to device KEYBOARD_ADDR

They could pair with the computer in any order, you will need to remember which one is the keyboard. As soon as Connecting to device KEYBOARD_ADDR appears you must enter a PIN code into the keyboard. It must consist of numbers not using the numpad, somewhere between 4 and 8 should be fine. Type this number in to the keyboard and press Return.

A window should pop up on your computer asking you for the number you just entered on the keyboard.

You should now be set up. The devices should automatically reconnect when they go to sleep and when your computer boots up.

Troubleshooting

If you have followed all the steps above and you find your mouse or keyboard don’t automatically reconnect, we can fix it. Run the following command in a terminal

sudo gedit /etc/default/bluez-utils

Find the following lines

HIDD_ENABLED=0
HIDD_OPTIONS=”…”

Change them to

HIDD_ENABLED=1
HIDD_OPTIONS=”--master --connect KEYBOARD_ADDR --connect MOUSE_ADDR --server

Now reboot and hopefully they’ll automatically connect (give them a few seconds to connect after you move the mouse/press a key)

Numlock activate at startup in login screen

It is very annoying that the numlock is not activated at startup in the login screen GDM, especially when using a password that contains numbers.

Make sure that the universe repository is enabled.

Execute the following commands in a terminal

sudo apt-get install numlockx

sudo gedit /etc/X11/gdm/Init/Default

Add the following lines at the end before the line “exit 0″:

if [ -x /usr/bin/X11/numlockx ]; then
/usr/bin/X11/numlockx on
fi

Put off your numlock and restart X by pressing Ctrl+Alt+Backspace

The numlock should be activated now and every time when you reboot

How-To Recover password under Ubuntu

If you forgot you password for your ubuntu system you can recover using the following steps

Turn your computer on.

Press ESC at the grub prompt.

Press e for edit.

Highlight the line that begins kernel ………, press e

Go to the very end of the line, add rw init=/bin/bash

press enter, then press b to boot your system.

Your system will boot up to a passwordless root shell.

Type in passwd username

Set your password.

Type in reboot

Παρασκευή 26 Οκτωβρίου 2007

Font Management in Linux

Fonts in Linux are crazy. Most Linux distributions ship with a big blob of serif, sans serif, and monospaced fonts, and there's barely a pixel's worth of difference between them.

Fonts on computers are crazy. Sometimes I pine for the olden days of swapping out the type balls on IBM Selectric typewriters to get different fonts. You always knew what you were getting with those.

Many fonts are copyrighted, so you cannot legally copy them and give them away to all of your friends. Some applications come with their own sets of fonts and rendering libraries. The GIMP does this because it thinks it can handle fonts more competently than your X server; it uses FreeType and Pango. OpenOffice.org also comes with its own set of fonts, for what reasons I know not.

The good news is your system is probably already set up to share all these fonts system-wide, and FreeType and Fontconfig are becoming standard. So the GIMP and OpenOffice.org can use your system fonts, and other applications can use the GIMP and OpenOffice.org fonts. If this is not so you can easily fix it. Just find the directories where the fonts are stored and add them to.

/etc/fonts/conf.avail/51-local.conf


Then, as root, run fc-cache to rebuild the fonts cache. Et voilá, and done! Some howtos say to edit /etc/fonts/fonts.conf but you shouldn't do this. local.conf is for your own customizations, and /fonts.conf will be overwritten when Fontconfig is updated.

There is one more peril: duplicate fonts in different font formats. if you have the same font in two different formats, you'll get inconsistent behavior. There can be only one.

Font Formats De-Mystified
The three main font formats are TrueType, OpenType, and PostScript. TrueType fonts have a .ttf extension on Linux/Unix, Windows, and Mac OS X, plus .ttc on the Mac. TrueType fonts scale up and down in size gracefully without jagged edges or inconsistencies in line thickness; you don't need a separate file for each size, but only for different styles like italic or bold.
PostScript fonts need two files each: .pfb is the printer font. This is specific to Linux and Unix; Windows PostScript fonts are .pfm and .pfb. Mac OS X handles PostScript fonts in a number of different ways that I don't even want to get entangled in, involving suitcases and forks and other oddments.
OpenType is a newer font format developed jointly by Microsoft and Adobe, their "can't we all just get along" format. Its file extension is .otf, and it works on both Windows and Mac.
Bitmap fonts are an old format. You need a separate font file for each size and style, so as you can imagine hardly anyone uses them anymore.
Most Linuxes these days come with both TrueType and PostScript Type 1 fonts. Finicky desktop publishers insist on using PostScript fonts with genuine PostScript printers, but these are becoming rare. Most printers support some form of PostScript emulation. Ghostscript is a PostScript interpreter that comes standard on most Linux distributions, so you should always be able to read and print PostScript documents.

Font Managers
Linux is lacking in good font managers. KDE's font installer is decent; it finds and displays the fonts on your system that Fontconfig knows about, and installs and removes fonts. It also displays the font type, and you can print a catalogue of all fonts or selected fonts. Use Ctrl+left-click to select non-contiguous fonts, and Shift+left-click to select a batch of contiguous fonts. Each font takes up two lines, so you can cram a lot onto a single page. On ordinary KDE you'll find the font installer in kcontrol. Kubuntu puts it in System Settings -> Appearance.
Gnome users can go into Nautilus, navigate to the folders that hold TrueType fonts, and click on individual fonts to generate a preview. But it won't work for other font formats. OpenOffice.org Writer and KWord both have nice font previewers, so at least you can quickly see what they look like.

Ubuntu Fonts: The Horror

Ubuntu installs over 200 fonts, the majority of them foreign-language fonts that only the most gifted linguist would ever be able to use. They're useless anyway since most of them don't render correctly. Those odd-looking ae_ fonts that have so many Ubuntu users scratching their heads? Those are all part of the ttf-arabeyes package. A quick way to find out which package a font belongs to is using the locate command to search on the font name:

$ locate -i ae_cortoba
/usr/share/fonts/truetype/ttf-arabeyes/ae_Cortoba.ttf


Go into Adept or Synaptic, search for installed fonts, and you'll see at a glance which ones are relevant to you. Do not remove:

Any xfonts or xfont utilities
  • x-tccidfont-conf
  • ttf-opensymbol
  • ttf-dejavu
  • anything that starts with lib
  • fontconfig
  • defoma
  • anything that starts with console
  • gsfonts

Ηow to Create PDF Documents in Ubuntu

Εάν χρησιμοποιήτε το OpenOffice είναι πολύ εύκολο να δημιουργήσετε έγγραφα PDF. Υπάρχει στο μενού File η επιλογή ‘Export as PDF’. Για τις υπόλοιπες εφαρμογές θα χρειαστεί η παρακάτω διαδικασία.

Πρέπει να εγκαταστήσετε το cups-pdf. Αυτή η εφαρμογή δημιουργεί έγγραφα PDF σε ένα ετερογενές δίκτυο δημιουργώντας ενα εκτυπωτή PDF στον κεντρικό διακομιστή. Είναι διαθέσιμο κάτω από την GPL και υπάρχουν πακέτα για αρκετές διανομές ή μπορείτε να τα δημιουργήσετε από το πηγαίο κώδικα.

Εγκατάσταση cups-pdf

sudo apt-get install cups-pdf

Χρειάζετε να δώσετε τα παρακάτω δικαιώματα

sudo chmod +s /usr/lib/cups/backend/cups-pdf

Ρύθμιση CUPS για τον εκτυπωτη PDF.

  • Επιλέξτε SYSTEM > ADMINISTRATION > PRINTERS > NEW PRINTER
  • Επιλέξτε LOCAL PRINTER
  • Χρησιμοποιήστε τον εκτυπωτή: PDF PRINTER
  • Επιλέξτε Print Driver:
  • Κατασκευαστής: Generic
  • Μοντέλο: Postscript Color Printer
  • Όνομα: postscript-color-printer-rev3b
  • Επιλέξτε APPLY

Όταν τυπώνετε από οποιαδήποτε εφαρμογή, επιλέξτε τον εκτυπωτή postscript-color-printer-rev3b για να δημιουργήσετε αρχεία PDF.

Τα αρχεία αποθηκεύονται στο φάκελο /home κάτω από το φάκελο /PDF.

Για να αλλάξετε το προκαθορισμένο φάκελο αποθήκευσης

Διορθώστε το αρχείο /etc/cups/cups-pdf.conf

gksudo gedit /etc/cups/cups-pdf.conf

βρείτε τη γραμμή

Out ${HOME}/PDF

και αλλάξτε το σε

Out ${HOME}/my_print_to_pdf_folder

όπου /my_print_to_pdf_folder είναι ο φάκελος της επιλογής σας
και κάντε επανεκκίνηση

sudo /etc/init.d/cupsys restart

How to set up Apache virtual hosting

Managing one site on a Web server can be tough enough, and the job is even harder if you have to host multiple client sites on a badly configured setup. If you're running Apache, you can make things easier by setting up virtual hosts, which let you control multiple domains on one IP address, allowing you to specify URLs like http://clientsdomain.com/file_name.html instead of http://yoursite.com/hosted/clients_directory/file_name.html, and letting you forgo setting up domain forwarding with a /srv/www/htdocs/hosted/clients_directory file.

If Apache is installed correctly, you can set up virtual hosting easily by editing Apache configuration files. The main .conf files in /etc/apache2 include httpd.conf, error.conf, server-tuning.conf, and a bunch more. These files are set for read-only access for normal users; you must gain root access with the sudo or su command to change them.

Edit /etc/apache2/httpd.conf and find this line:

Include /etc/apache2/vhosts.d/*.conf

Replace it with a line that specifies a .conf file we will create and call vhost.conf:

Include /etc/apache2/vhosts.d/vhost.conf

When you've made the change, save the file. Now, again as root, create the vhost.conf by renaming the vhost.template file in /vhosts.d/:

mv vhost.template vhost.conf

Now edit the file to set it to allow multiple name-based Web sites on a single IP address. First add in the virtual host directive with NamevirtualHost *. The asterisk is a wild card character that allows any address to be set. Under that directive you can add your first virtual host:

NamevirtualHost *


ServerAdmin youremail@yoursite.com
DocumentRoot /srv/www/htdocs/directory_of_your_choice/
ServerAlias yourdomain.com *.yourdomain.com

The first part is the opening tag for the defined virutal host block. ServerAdmin lets you display the administrator email address when an error such as a 404 occurs. DocumentRoot is the root directory for the defined site; for example, sites I have hosted in the past all had accounts set up within /srv/www/htdocs/hosted/sitename/. Next is the ServerAlias or ServerName, which controls what names people can use to see and access a site. You could set this to a directory within the main NameVirtualHost or the domain of the site so the server can display the content associated with the domain name. The reason for the two ServerAlias entries above is that servers are often called from more than one ServerName, so you set up a ServerAlias with more than one address listed. The wild card allows for any domain request with anything in front of .yourdomain.com.

What if you want to have multiple virtual hosts set up under two different NameVirtualHost blocks, with one being the server's main IP address and the other being for the localhost? The code would look like this:

NameVirtualHost *


ServerAdmin admin@mixfevers.com
DocumentRoot /srv/www/htdocs/
ServerAlias mixfevers.com *.mixfevers.com



ServerAdmin admin@snapnshare.com
DocumentRoot /srv/www/htdocs/snapnshare/
ServerAlias snapnshare.com *.snapnshare.com



ServerAdmin admin@boomerwebzine.com
DocumentRoot /srv/www/htdocs/~/boomer/
ServerAlias boomerwebzine.com *.boomerwebzine.com


NameVirtualHost 127.0.0.1


DocumentRoot /srv/www/htdocs/
ServerName localhost

Once you've saved the configuration file, you need to restart Apache as root in order for your change to take effect:

# /etc/init.d/apache2 restart

The setup above works well for a small company hosting multiple sites on one server, or for a hobbyist who designs sites and wants to host them. It allows you point your domains at a static or dynamic IP address, letting the server figure out what shows up for the domain.

Apache provides more information on setting up and maintaining different setups of virtual host in its documentation.

James Lees is a Web site developer who hopes to go to college for network engineering and Web development. He is a die-hard Linux user.

Get Wireless working in Ubuntu 7.04 Feisty Fawn

Non-working wireless internet is a common problem which can be easily resolved. All you need is
1 ) Ubuntu 7.04 Feisty Fawn installed ( how obvious )
2 ) Internet access - can be on another computer if not the one on which you have Ubuntu.

So lets get working!

First download the following packages
ndiswrapper-common
ndiswrapper-utils-1.9
ndisgtk

Now transfer these files to the system with Ubuntu installed - use a USB Flash Drive if you have to. Just get the files there.

Place them in the same folder and run the following commands in the terminal ( have the folder opened in it ). Change the * to the right text and run in the same order given below.

sudo dpkg -i ndiswrapper-common_*.deb
sudo dpkg -i ndiswrapper-utils-1.9_*.deb
sudo dpkg -i --force-depends ndisgtk_*.deb

When installing ndiswrapper-utils-1.9, it will ask for the Ubuntu 7.04 Feisty Fawn Install CD ( if you haven't played with the repositories ) If it doesn't ask for it, most probably you have been playing with the repositories and it will use the internet instead of the CD.
Once installed, you have to blacklist the open source bcm43xx that comes with Ubuntu. The file /etc/modprobe.d/blacklist contains the blacklisting information. Just open it in gedit with root rights.

gksudo gedit /etc/modprobe.d/blacklist

And add
to it...

blacklist bcm43xx

Now do a lspci in the terminal and find the name of your wireless card there. If you are using a USB wireless card, do a lsusb instead. Note it down because you will need it later. Like for me it says

03:00.0 Network controller: Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card (rev 01)

Now what you need is the windows driver for the card. Go to this page and find your card in the list(s) and get the required driver. Now you might need cabextract or unshield to get the real files from the setup. So install both of them

cabextract
unshield

Once you have the installed, open the folder where you have the setup in terminal and use the above given tools to extract it. In my case the command was...

cabextract -d drivers sp34152.exe
The "-d drivers" tells it to extract files into a new folder and call it drivers

And also do a ls *.inf in the folder where the files are extracted. It will list all files that end with a ".inf". Most probably there will be only one - note its name down. If there are more than one, go to this list again and see if it helps.

Go to System >> Administration >> Windows Wireless Drivers and press the Install New Driver button. Now browse to the folder where the files from the setup were extracted and point it to the inf file in it and you are done.

Now you just have to confirm if it installed correctly, start it and make it start at startup each time.

To confirm do a ...
ndiswrapper -l

If done right, it should say that the drivers are installed and stuff.
Now run it by...

sudo depmod -a
sudo modprobe ndiswrapper

And in the network settings, set it to "Roaming mode enabled"
Now we get it to start at startup, you have to add "ndiswrapper" to the /etc/modules file.
gksudo gedit /etc/modules

And add "ndiswrapper" to its bottom ( without quotes ), save it and restart. Enjoy wireless internet!

How-To Recover password under Ubuntu

If you forgot you password for your ubuntu system you can recover using the following steps
  • Turn your computer on.
  • Press ESC at the grub prompt.
  • Press e for edit.
  • Highlight the line that begins kernel ………, press e Go to the very end of the line, add
    rw init=/bin/bash
    press enter, then press b to boot your system.
Your system will boot up to a passwordless root shell.
Type in passwd username
Set your password
Type in
reboot

Πέμπτη 25 Οκτωβρίου 2007

Move your home directory to its own partition

There are some reasons why you may need to move your home directory to its own partition, it could be because you run out of space, or because you may want to share it with another distro in a dual Linux boot installation, well lets start.

Preparing the new partition
This may be different in your environment, in my case I will do in the same disk, just in another partition, but you can use a complete new and different disk for you /home directory.

Gparted
If you do not have gparted, install it with
sudo apt-get install gparted

the call it with:
gksudo gparted

then use gparted to create and format your new partition.
Once created and formated, it is time to move your /home

You may need to resize your / "root" partition to make enough room for your /home partition, or use another disk for it.

Moving your home directory

First logout from GNome or KDE, press Alt+F1 and login as root.
Follow this steps
mv /home /home.bak
mkdir /home
mount -t ext3 /dev/sda3 /home
cp -a /home.bak/* /home

Remember to change /dev/sda3 and ext3with your own data

We need one final step,
Open your /etc/fstab file, and add this line, in my case it is /dev/sda3 but could be different for you.
/dev/sda3 /home ext3 defaults,errors=remount-ro 0 1
It there were a line for /home in you /etc/fstab file replace it with the new data.
with this finished, just reboot your system and enter as usually.

Important note

Remember to back up before using gparted if you are resizing your disk to make room for the new partition

Convert .flv (Google Videos) to .mpg using ffmpeg

FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. FFmpeg is developed under Linux, but it can compiled under most operating systems, including Windows. In ubuntu This package contains the ffplay multimedia player, the ffserver streaming server and the ffmpeg audio and video encoder. They support most existing file formats (AVI, MPEG, OGG, Matroska, ASF, …) and encoding formats (MPEG, DivX, MPEG4, AC3, DV, …).

ffmpeg Features

  • ffmpeg is a command line tool to convert one video file format to another. It also supports grabbing and encoding in real time from a TV card.
  • ffserver is an HTTP (RTSP is being developped) multimedia streaming server for live broadcasts. Time shifting of live broadcast is also supported.
  • ffplay is a simple media player based on SDL and on the FFmpeg libraries.
  • libavcodec is a library containing all the FFmpeg audio/video encoders and decoders. Most codecs were developped from scratch to ensure best performances and high code reusability.
  • libavformat is a library containing parsers and generators for all common audio/video formats.

Install ffmpeg Ubuntu

sudo apt-get install ffmpeg

convert .flv to .mpg using ffmpeg

First you need to download your .flv file to a folder and you need to Open a terminal window and go in to the .flv file folder and type the following command

ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg

jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.

-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)

-ab bitrate: set the audio bitrate in kbit/s (default = 64)

-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)

-s size: set frame size. The format is WxH (default 160×128 )

Load Applications Quicker in UBUNTU Using Preload

Preload is an adaptive read-ahead daemon. It monitors applications that users run, and by analyzing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times.

It runs as a daemon in the background so it is unobtrusive to your desktop. To install Preload open up Terminal and type in;

sudo apt-get install preload

For example, if you run Firefox, GAIM, and OpenOffice everyday Preload will determine these are common 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 does not need to be configured, it is adaptive and merely relies on a count of the number of times an application is launched to perform the preload.

Do not confuse Preload with Prefetch which is still under development and is expected to be part of Gutsy Gibbon in October 2007.

Nor is it to be confused with squid-prefetch which preloads web-pages.

The source article here

Using initrd

If you’ve ever looked into recompiling your Linux kernel, you’ve probably seen advice to include critical boot drivers (for your hard disk controller and root partition’s filesystem) in the kernel itself. Omitting the boot drivers is likely to result in an inability to boot the computer. The kernel loads and begins doing some checks, but then stops because it can’t read the root filesystem.

The kernels provided by most Linux distributions, however, lack the drivers for most disk hardware. These same distributions can install and boot on all of this hardware, though. How is that possible? The answer is that the kernels use an initial RAM disk (initrd for short) to hold the relevant drivers as modules. When the computer boots, the boot loader passes the initrd to the kernel, which loads it into RAM and treats it like a disk. The kernel can then load modules stored in the RAM disk, keeping the kernel size small while still providing a wide variety of drivers.

When you compile your own kernel, it’s usually easier to bypass the initrd and instead build the relevant drivers into your main kernel file. Sometimes, though, you might want to build your own initrd. Let’s see how.

Why Use initrd?

The average desktop or server system running a custom kernel doesn’t need initrd. However, it can be useful in several situations:

*Most distributions use initrd because the distributions’ designers can’t predict what hard disk controller you’ve got.

*Using initrd enables you to design a custom emergency system or specialized boot CD-R that will run on a variety of systems. This could be handy if you want to have an emergency system for use in a work environment with many different system configurations.

*If you maintain several Linux systems, you may want to custom-build a single kernel for all of them. Rather than tweak each system’s kernel for its specific hardware or build kernels with multiple sets of disk drivers, you can place the necessary drivers as modules in initrd.

*In certain embedded and specialized Linux systems, initrd may be used as the final root filesystem. This enables Linux to run on a read/write filesystem even when the only permanent storage is read-only in nature.

*Even if you don’t want to build a completely new initrd, you might want to modify the one provided by your distribution maintainer, say, to add a new or updated driver.

Getting to Know initrd

Before delving into initrd configuration, you should understand a bit about how it works.

When a Linux system boots, the computer reads a boot loader, which in the case of an x86 or x86-64 Linux system is likely to be the Linux Loader (LILO) or the Grand Unified Boot Loader (GRUB). LILO and GRUB are both very simple programs. They can read data from the hard disk using BIOS calls, so they don’t need disk drivers such as those used by the Linux kernel. Using BIOS calls, LILO or GRUB loads the Linux kernel into memory and executes it. When given appropriate options, LILO or GRUB also loads an initrd image, which is typically stored on disk in your /boot directory along with the kernel file. When the boot loader loads an initrd image, it passes its address in memory to the kernel when it starts the kernel.

Once the kernel is running, it mounts the initrd image and executes the /linuxrc or /init program on the RAM disk. (Most initrd documentation refers to /linuxrc, but some systems expect a file called /init.) This program acts something like the normal Linux startup program (/sbin/init), in that it controls what the kernel does with the initrd contents. Typically, /linuxrc or /init is a shell script that loads the drivers necessary for accessing your hard disk, swaps out the RAM disk filesystem for the root filesystem on the hard disk, releases the memory used by the RAM disk, and then continues the boot process using the hard disk’s root filesystem. In principle, this RAM disk boot script could do much more than this, but in practice additional steps are usually performed by /sbin/init on your hard disk and the programs it calls, such as SysV startup scripts. Using on-disk programs and utilities makes for easier system maintenance.

One problem with using initrd is that the RAM disk image must be maintained using utilities. You can’t just copy files in and out of a directory. In the past, initrd image files were typically filesystem images, holding ext2, romfs, or other filesystems. Today, they’re more often compressed cpio archives. As a result, the process of creating or modifying an initrd image involves extracting data from an existing image file, replacing and modifying files, and creating a new archive with your new or changed files. You can then modify your boot loader configuration to access the new files. Chances are you’ll need to reconfigure your kernel before you do any of these things, though.

Configuring Your Kernel

In most cases, the whole point of using initrd is to slim down your kernel. Therefore, you should peruse your kernel options, changing drivers you normally build into the kernel to build as modules. Typically, such options are restricted to filesystems and hard disk drivers.

Of course, you can do the same to other drivers, such as sound card drivers, network drivers, and frame buffer video drivers; however, such drivers are not typically required to boot the computer (with the exception of network drivers for network boot configurations), so you can perform such slimming even if you don’t use initrd.

One notable caveat exists: If you intend to create an initial RAM disk as a disk image file (rather than as a cpio archive file), you must build support for the filesystem you use into your kernel. You could build a RAM disk image using ext2, romfs, the Minix filesystem, or various others. Chances are ext2 would be the most convenient, but you can use your own judgment on this matter. Creating a cpio archive instead of using a conventional filesystem enables you to build all your standard filesystems as modules.

Two options that must be present in your kernel to use an initial RAM disk are the RAM Disk Support and Initial RAM Filesystem and RAM Disk (initramfs/initrd) Support options, both of which are in the “Block Devices” subsection of the Device Drivers kernel configuration area. Be sure these options are both built into the kernel itself!

Once you’re done configuring your kernel via make xconfig, make menuconfig, or similar tools, you can compile it in the normal way. Remember to install your kernel modules via make modules_install and copy your main kernel file to /boot.

Using initrd Preparation Tools

The easiest way to create an initrd is to use a preparation tool. Most distributions include a program called mkinitrd to do this job. To use it, pass it the name of the file in which you want to store your initrd image and the kernel version number you want to use:

# mkinitrd /boot/initrd-2.6.18.cpio.gz 2.6.18

This example creates an initrd image for the 2.6.18 kernel. Here, the .cpio.gz filename extension is used because this is what it really is, but most distributions give it no extension or an .img extension instead.

Although mkinitrd and similar tools (such as yaird, http://alioth.debian.org/projects/yaird/) are handy, they’re inflexible. If you want to create an unusual initrd, you’ll need to dig into the standard file and modify it.

Preparing an initrd Image from Scratch

One way to create a custom or unusual initrd is to start with a working image. You can begin with a standard initrd image or create one with mkinitrd. Locate the original file, copy it to a convenient directory, and create a subdirectory to hold the RAM disk’s extracted files. The original file is typically called /boot/initrd-* or /boot/initrd-*.img, where * is a version number and perhaps additional distribution-specific codes. Although many distributions do not include a .gz extension in their initrd filenames, these files are almost always compressed with gzip. Thus, you should rename the copy to include a .gz extension. Suppose it’s called initrd.img.gz. If the file is a cpio archive, you can uncompress it with cpio and gunzip, after changing into the working directory for your RAM disk files:

# gunzip -c ../initrd.img.gz | cpio -iv

The result should yield a copy of the files from the initrd image file you specified.

If you’re working from a disk image rather than a cpio archive, you can uncompress the copy and mount it using the loopback device, after changing into the directory that holds the initial RAM disk image file:

# gzunip ./initrd.img.gz

# mount -o loop initrd.img ./workdir

This pair of commands makes the working files available under the workdir subdirectory of the current directory. One caveat about this approach is that initial RAM disk images may contain little or no extra space for adding files. Thus, you may need to copy these files to another subdirectory, modify them there, and then create a cpio archive from your changed files. Alternatively, you could create a larger filesystem image file and copy the files there.

In either case, you can begin modifying the RAM disk’s files. Precisely how you proceed depends on what you want to accomplish, but some things you may want to do include:

*Replace kernel modules (files with the .ko extension) in the RAM disk’s lib directory with their equivalents from your newly compiled kernel, as stored in the /lib/modules/version directory tree, where version is your kernel version number.

*Add kernel modules for any drivers or filesystems you want to have available during the boot process, perhaps including proprietary or non-standard drivers.

*Modify the init or linuxrc file to perform additional tasks. You may need to add insmod lines to load new kernel modules, for instance. This startup script is normally a shell script, so you can edit it with a text editor.

*Depending on your distribution and from where you acquired your kernel source, you may need to rename the init file to linuxrc or vice-versa. To hedge your bets, create a symbolic link so that it may be called by either name.

*More ambitious changes may require you to add programs to bin, add device nodes to dev, or make more extensive changes to the startup script. If you’re creating an emergency boot system or other standalone boot CD-R, you may want to disable the last few lines of a standard initrd startup script, which pass control over to the on-disk boot partition. Instead, substitute a call to bash or some other shell.

One potentially frustrating aspect of preparing or modifying a startup script is that it can be tricky to get the order in which you load kernel modules right. You can use the modinfo command on the kernel module files to spot dependencies, which can help you figure out what needs to be loaded first (or at all).

When you’re finished making changes, you must create a new initial RAM disk file. If you’ve used a loopback device, unmount and recompress it to do the trick:

# umount ./workdir

# gzip -9 initrd.img

If you want to create a cpio archive as your initrd carrier, you can

do so with cpio and gzip:

# cd workdir

# find ./ | cpio -o -H newc | gzip -9 > ../initrd.cpio.gz

In either case, you should probably copy your new initrd image file to /boot, perhaps renaming it with an appropriate version number.

Reconfiguring Your Boot Loader

At this point, you should have a new kernel in /boot and a new initrd image in the same location. Your task now is to reconfigure your boot loader (LILO or GRUB) to use both.

If you use LILO, load the /etc/lilo.conf file into a text editor. This file contains global options followed by a series of stanzas, each of which describes one kernel or non-Linux OS. Linux stanzas begin with a line that starts with the string image= followed by the kernel’s filename. Subsequent lines in the stanza are usually indented and describe options.

Copy your current working stanza and modify the copy to point to the new kernel. Locate the line in the stanza that begins initrd= and point it to your new initrd image file. When you’re done, save your changes and type lilo at a root prompt to re-install LILO.

In the case of GRUB, edit the file called /boot/grub/grub.conf or /boot/grub/menu.lst. Locate your current boot stanza, copy it, and modify the copy to point to the new kernel and initrd image. The relevant lines begin with the strings kernel and initrd, respectively. Once you’ve made the changes, you don’t need to re-install GRUB; this boot loader reads the configuration file from disk whenever the system boots.

Rebooting to Use Your initrd Image

At this point, you should reboot your computer to test the new kernel and initrd configuration. If all goes well, your computer will start normally, providing access to all your devices. If there’s a problem, it should show up fairly early in the boot process.

The most common problem is that the kernel can’t mount a root filesystem (either the initial RAM disk or the hard disk’s root filesystem). If this happens, you’ll see a note to that effect. Read all the kernel messages on the screen; they may provide clues about what went wrong. The usual cause is a missing or out-of-place insmod call in the initrd startup script.

Once your system is working, you can tweak it. You can add drivers to your startup script to support multiple hardware configurations, or create separate startup scripts and RAM disk images to support these configurations. Attempting to load a driver for a nonexistent device is normally not a problem, so you may be able to get by with a single RAM disk image for multiple hardware configurations. Because the kernel releases the initrd memory when it switches to the hard disk root partition, there’s no memory penalty for providing a big RAM disk with lots of drivers.

How to test your firewall

The firewall is our gateway to the Internet. It is a piece of software or hardware that manages Internet connections to and from your computer. It monitors the applications that try to initiate connection with your computer from the Internet, and it controls which programs are allowed to use the Internet.

Nowadays, Internet users are exposed to several kinds of Internet threats, such as software vulnerabilities, automated worms, viruses and random Internet attackers. Properly configured personal firewalls are the first line of defense to answer these threats.

But how do you test your personal firewall? Security researchers have developed small, non-destructive, leak testers, that deliberately attempt to test different firewall capabilities. The idea behind them is simple: if the test can bypass your computer’s security, then so can a hacker.

There are many leak-testing programs available. Each one designed to test a particular flaw and each using a particular technique to bypass a firewall’s standard protection mechanisms. We’ve compiled a list of tools we believe will be of value to both home users and advance users.

  1. PCFlank Leaktest - PCFlank Leaktest is a small utility that tests any firewall’s ability to protect against unauthorized or illegal transmissions of data from a user’s computer that is connected to the Internet. It uses a special technique to impersonate another program, which your firewall has been set to trust. Get PCFlank Leaktest here.
  2. Breakout - Breakout sends to the IE’s or Firefox’s address bar the URL to launch, via the ‘SendMessage’ Windows API. No code is injected. Usually very hard to detect by firewalls. If the test is a success, this means that your firewall does not check for the ‘messages’ sent to your applications windows. Get BreakOut here for IE / Firefox.
  3. DNSTester - Starting from Windows 2000, a Windows service DNS client is running and handles all DNS requests. Thus, all DNS requests coming from various applications will be transmitted to the DNS client which will, itself, do the DNS request. This feature can be used to transmit data to a remote computer by crafting a special DNS request without the firewalls notice it. DNStester uses this kind of DNS recursive request to bypass your firewall. Get DNSTester here.
  4. MBTest - MBtest send packets directly to the network interface to try to bypass firewall. To do this, it sends differents kind of packet of different size/protocoles/type. If the test is a success, this means that your firewall is stuck in high level network and doesn’t check low level. Get MBTest here.
  5. Atelier Web Firewall Tester - AWFT probes the protection provided by your Personal Firewall software using six different tests. Each test uses a different technique for gaining access to the outside world. Techniques are differently rated, according to their sophistication, and your Personal Firewall is doing a great job if is able to score 10 points in total. Get Atelier Web Firewall Tester here.
  6. ZABypass - Originaly was developed to bypass old versions of ZoneAlarm, but it may work against many other firewalls today. It uses a special technique called Direct Data Exchange to transfer data between Internet Explorer and the Internet. Get ZABypass here.
  7. FireHole - FireHole attempts to launch the default web browser, inject its own DLL and try to establish a connection to the Internet. Get FireHole here.
  8. Thermite - Thermite injects it’s code into the target process directly, by creating an additional malicious thread within that process. If the test is a success, this means that your firewall is vulnerable to process injection. Get Thermite here.

Leak tests are designed to help identify security flaws and provide the invaluable function of informing the user whether or not their firewall is providing adequate protection. Unfortunately, malware programs are evolving rapidly. Many of such programs (will) have very advanced techniques to conceal their malicious activities so that they easily bypass firewalls and other protection mechanisms.

Edit: Matousec has a list of tested personal firewalls and their final score.