Devstack in single system


How to configure Devstack in a single system-

 DevStack is an opinionated script to quickly create an OpenStack development environment.

Installation Steps

Add your user

We need to add a user to install DevStack. (if you created a user during install you can skip this step and just give the user sudo priviledges below)
adduser stack
Since this user will be making many changes to your system, it will need to have sudo priviledges.
apt-get install sudo -y
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
From here on you should use the user you created. Logout and login as that user.

Download DevStack

We'll grab the latest version of DevStack via git
sudo apt-get install git -y
git clone git://github.com/openstack-dev/devstack.git
cd devstack

Configure localrc


Your devstack/localrc file should be like this

FLOATING_RANGE=192.168.1.224/27
FIXED_RANGE=10.240.14.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=root
RABBIT_PASSWORD=rabbit
SERVICE_PASSWORD=cdac
SERVICE_TOKEN=admin


Configure devstack/stackrc

Around line no 184,You have to put the image location (mainly from prebuilt OS image). You can add multiple images separated by ,

Here my line is like this

IMAGE_URLS="http://cloud-images.ubuntu.com/releases/oneiric/release/ubuntu-11.10-server-cloudimg-amd64.tar.gz","http://cloud-images.ubuntu.com/releases/10.04/release/ubuntu-10.04-server-cloudimg-i386.tar.gz","http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz","http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-i386.tar.gz"

Building Cloud:-

Now run
$./stack.sh

This will build the devstack cloud.

Setting environment variables

After successfully done building,you have to configure these environment variables

export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://10.240.8.29:5000/v2.0/

Available images

See the images available in your system

nova image-list

+--------------------------------------+-------------------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-------------------------------------------+--------+--------+
| d51df08c-57e4-4dcb-9b7b-bbe2df425095 | cirros-0.3.1-x86_64-uec | ACTIVE | |
| f35cd538-4c4f-4744-ad4b-9c628af1a7b9 | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| 13c37dd1-fd88-4c93-9606-646c6a121c74 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
| 0c02b817-f15a-4763-bcfd-c4b1a296dd32 | precise-server-cloudimg-i386 | ACTIVE | |
| 478b7945-2d40-4f21-bfad-05f451d4f7f5 | precise-server-cloudimg-i386-kernel | ACTIVE | |
| 0292ca63-3ae6-46ae-bab1-5457c134b2d1 | ubuntu-10.04-server-cloudimg-i386 | ACTIVE | |
| c23433a6-c7d6-4794-8273-2e025a542d3d | ubuntu-10.04-server-cloudimg-i386-kernel | ACTIVE | |
| 3d4c05ea-8f46-4228-91a6-92a73a85b552 | ubuntu-11.10-server-cloudimg-amd64 | ACTIVE | |
| 1ac4d04b-83b7-4c94-876f-148148f23076 | ubuntu-11.10-server-cloudimg-amd64-kernel | ACTIVE | |
+--------------------------------------+-------------------------------------------+--------+--------+

Create Keypair

Create a keypair so you can ssh to the instance:
$nova keypair-add testkousik > test.pem
$chmod 600 test.pem

Run (boot) a test instance:
nova boot --image precise-server-cloudimg-i386 --flavor m1.small --key_name testkousik testubuntu

    --image: the name or ID of the image we want to launch, as shown in the output of nova image-list
    --flavor: the name or ID of the size of the instance to create (number of vcpus, available RAM, available storage). View the list of available flavors by running nova flavor-list
    -key_name: the name of the key to inject into the instance at launch.





Login to your instance


ssh -i test.pem -l ubuntu 10.240.14.2


Reference


Bugzilla Setup on CentOS


Bugzilla Setup


Download latest stable bugzilla version from the website.


#wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.1.3.tar.gz
Change to the apache directory from where it serves files
#cd /var/www/html/
Unzip the tar here /var/www/html/ so that apache can see it
#tar -xzvf ~/bugzilla-3.4.4.tar.gz
(optional) Rename the directory to hide the version
#mv bugzilla-3.4.4/ bugzilla
Change ownership so that apache can read/write to it
#chown -R apache.apache /var/www/html/bugzilla/
Change to bugzilla directory
#cd /var/www/html/bugzilla/
Run checksetup.pl – this will show you the perl modules missing
# ./checksetup.pl –check-modules
Install gcc (if the linux distro doesn’t already come it), as you will need it to make/compile the modules
#yum install gcc.x86_64
Install dependencies for bugzilla
#yum install mysql-server mod_perl mod_perl-devel httpd-devel graphviz patchutils gcc perl-DateTime perl-Template-Toolkit perl-Email-Send perl-Email-MIME perl-GD perl-Chart perl-Template-GD perl-GDGraph perl-GDTextUtil perl-PatchReader perl-MIME-tools perl-LDAP perl-Authen-SASL perl-RadiusPerl perl-SOAP-Lite perl-JSON-RPC perl-JSON-XS perl-Test-Taint perl-HTML-Scrubber perl-Email-MIME-Attachment-Stripper perl-Email-Reply perl-TheSchwartz perl-Daemon-Generic perl-Math-Random-Secure perl-YAML perl-Class-Inspector perl-CPAN
To install all module required for bugzilla run
# /usr/bin/perl install-module.pl –all
Run the checksetup.pl without any parameters to create a localconfig file.
# ./checksetup.pl
Output will be like this
.
.
.
This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. Please edit the file
./localconfig and then rerun checksetup.pl.


The following variables are new to ./localconfig since you last ran
checksetup.pl: create_htaccess, webservergroup, use_suexec, db_driver, db_host, db_name, db_user, db_pass, db_port, db_sock, db_check, index_html, cvsbin, interdiffbin, diffpath, site_wide_secret


Change the permissions in case there should be a conflict.
# chmod -R 777 /var/www/html/bugzilla/
Edit localconfig
#vim localconfig
Update the database connection details like username and password
# The DNS name of the host that the database server runs on.
$db_host = ‘localhost’;
# The name of the database
$db_name = ‘bugs’;
# Who we connect to the database as.
$db_user = ‘bugs’;
# Enter your database password here. It’s normally advisable to specify
# a password for your bugzilla database user.
# If you use apostrophe (‘) or a backslash (\) in your password, you’ll
# need to escape it by preceding it with a ‘\’ character. (\’) or (\)
# (Far simpler just not to use those characters.)
$db_pass = ‘password’;
# Sometimes the database server is running on a non-standard port. If that’s
# the case for your database server, set this to the port number that your
# database server is running on. Setting this to 0 means “use the default
# port for my database server.”
$db_port = 0;
# With the introduction of a configurable index page using the
# template toolkit, Bugzilla’s main index page is now index.cgi.
# Most web servers will allow you to use index.cgi as a directory
# index, and many come preconfigured that way, but if yours doesn’t
# then you’ll need an index.html file that provides redirection
# to index.cgi. Setting $index_html to 1 below will allow
# checksetup.pl to create one for you if it doesn’t exist.
# NOTE: checksetup.pl will not replace an existing file, so if you
# wish to have checksetup.pl create one for you, you must
# make sure that index.html doesn’t already exist
$index_html = 1;



Re-run the checksetup.pl
# ./checksetup.pl
###OUTPUT####
* This is Bugzilla 4.1.3 on perl 5.10.1
* Running on Linux 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011


Checking perl modules...
Checking for CGI.pm (v3.51) ok: found v3.59
Checking for Digest-SHA (any) ok: found v5.47
Checking for TimeDate (v2.21) ok: found v2.22
Checking for DateTime (v0.28) ok: found v0.53
Checking for DateTime-TimeZone (v0.71) ok: found v1.08
Checking for DBI (v1.41) ok: found v1.609
Checking for Template-Toolkit (v2.22) ok: found v2.22
Checking for Email-Send (v2.00) ok: found v2.198
Checking for Email-MIME (v1.904) ok: found v1.910
Checking for URI (v1.37) ok: found v1.40
Checking for List-MoreUtils (v0.22) ok: found v0.22
Checking for Math-Random-ISAAC (v1.0.1) ok: found v1.004


Checking available perl DBD modules...
Checking for DBD-Pg (v1.45) not found
Checking for DBD-mysql (v4.001) ok: found v4.013
Checking for DBD-SQLite (v1.29) ok: found v1.35
Checking for DBD-Oracle (v1.19) not found


The following Perl modules are optional:
Checking for GD (v1.20) ok: found v2.44
Checking for Chart (v2.1) ok: found v2.4.4
Checking for Template-GD (any) ok: found v1.56
Checking for GDTextUtil (any) ok: found v0.86
Checking for GDGraph (any) ok: found v1.44
Checking for MIME-tools (v5.406) ok: found v5.502
Checking for libwww-perl (any) ok: found v5.833
Checking for XML-Twig (any) ok: found v3.39
Checking for PatchReader (v0.9.6) ok: found v0.9.6
Checking for perl-ldap (any) ok: found v0.40
Checking for Authen-SASL (any) ok: found v2.13
Checking for RadiusPerl (any) ok: found v0.20
Checking for SOAP-Lite (v0.712) ok: found v0.714
Checking for JSON-RPC (any) ok: found v1.01
Checking for JSON-XS (v2.0) ok: found v2.32
Checking for Test-Taint (any) ok: found v1.04
Checking for HTML-Parser (v3.40) ok: found v3.64
Checking for HTML-Scrubber (any) ok: found v0.09
Checking for Encode (v2.21) ok: found v2.35
Checking for Encode-Detect (any) ok: found v1.01
Checking for Email-MIME-Attachment-Stripper (any) ok: found v1.316
Checking for Email-Reply (any) ok: found v1.202
Checking for TheSchwartz (any) ok: found v1.10
Checking for Daemon-Generic (any) ok: found v0.81
Checking for mod_perl (v1.999022) ok: found v2.000004
Checking for Apache-SizeLimit (v0.93) ok: found v0.96
Checking for mod_headers (any) ok
Checking for mod_expires (any) ok
Checking for mod_env (any) ok
Reading ./localconfig...
Checking for DBD-mysql (v4.001) ok: found v4.013


Adding new table bz_schema...
Initializing bz_schema...
Creating tables...
Converting attach_data maximum size to 100G...
Setting up choices for standard drop-down fields:
priority bug_status rep_platform resolution bug_severity op_sys
Creating ./data directory...
Creating ./data/attachments directory...
Creating ./data/db directory...
Creating ./data/extensions directory...
Creating ./data/mining directory...
Creating ./data/webdot directory...
Creating ./graphs directory...
Creating ./skins/custom directory...
Creating ./data/extensions/additional...
Creating ./data/mailer.testfile...
Creating index.html...
Creating ./Bugzilla/.htaccess...
Creating ./data/.htaccess...
Creating ./data/attachments/.htaccess...
Creating ./data/webdot/.htaccess...
Creating ./graphs/.htaccess...
Creating ./lib/.htaccess...
Creating ./template/.htaccess...
Creating contrib/.htaccess...
Creating t/.htaccess...
Creating xt/.htaccess...
Precompiling templates...done.
Fixing file permissions...
Initializing "Dependency Tree Changes" email_setting ...
Marking closed bug statuses as such...
Creating default classification 'Unclassified'...
Setting up foreign keys...
Setting up the default status workflow...
Creating default groups...
Setting up user preferences...


Looks like we don't have an administrator set up yet. Either this is
your first time using Bugzilla, or your administrator's privileges
might have accidentally been deleted.



Enter the e-mail address of the administrator: kousikster@gmail.com
Enter the real name of the administrator: kousik
Enter a password for the administrator account:
Please retype the password to verify:
kousikster@gmail.com is now set up as an administrator.
Creating initial dummy product 'TestProduct'...



Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.





Restart the httpd server
#/etc/init.d/httpd restart

and you are good to go!



Try http:///bugzilla and Enjoy!

List of problems and solutions(Mostly Debian based)


1.If you mess up with boot-loader and during installation it complaining about UUID you can fixed it with blkid
2.If you delete some file from command line accidentally (if you delete from command line it deleted permanently) and want to recover you need the foremost package.
3. If you want to shutdown your pc at particular time say 11:30 pm then issue the following command
4.If you mess-up with grub and want to recover then boot from ubuntu live cd. Open terminal and run
5.Set Date and time through command line
6.Print through Command line
7.Quickly Find a PID with pgrep
8.Execute The Last Executed Command
9.Execute The Last Command Starting With ...
10.Last Argument                                                                                                       Deatils
11.Run a Command Repeatedly and Display the Output
12.Save Quickly in VI/VIM
13.Quickly Log Out of a Terminal
14.Navigate to the Last Directory You Were In
15.Make Parent Directories the Smart Way
16.Delete the Entire Line
17.Set the Time stamp of a File
18.Command to File
19.Ampersand
20.Resetting your terminal-session
21. Playing with packages:-
22.Remove unnecessary packages
23.Resolve "Waiting for root file system..."
24.View total memory in a system:-
25.Fixing NTFS Mount Error in GNU/Linux
26. If there is any problem in shutdown:-
27. Copy from cd and create an iso image through command line.
28. Mount a iso image
29.Use packages of DVD to sources.list as repository:-
30. GRUB1 and GRUB2 splash images                                                                          Deatils
31. GRUB on CD-R/W media
32. Connect to Reliance ZTE MC315+
33. If firefox starting @ offline mode (Due to eth0 is disable ):-
34. Erase a re-writeable CD from command line
35. Write a iso image to a cd
36. Get the repository size in GB
37. If you want to see the file permission in numerical form
38. Get the directory/folder size from Command line
39. If you want to keep the files under /tmp directory during rebooting
40. Adding a startup script to be run at bootup
41.USB hard drive read only access
42.Change the bit rate of a mp3 file:-
43. Backup with rsync :-
44. Deleting comment lines starting with a special symbol:- 
45. Working with startup scripts:- 
46. Boot debian faster:-
47. Add Splash Screen to Debian:-
48. Get exact RAM size in MB :-
49. X:- No Screen Found error:-
50. Removing "Too many levels of symbolic links"Error:-                           Deatils
51.Read from standard input and write to standard output and files(tee):-
52.If you faceing problem in resizing Windows Partitions:-
53.Configure Tata indicom HUAWEI and Reliance HUAWEI:-
54. Reverse search by grep
55.How to view logfiles in Debian:-
56.bash No such file or directory
57.Create own Debian repository from an installed Debian or Ubuntu system
58.Removing gpg warning
59.Resolving " could not gain access to /dev/sound/dsp for writing"
60.Unmount forcefully ...
61. Configure sify-bbclient in Ubuntu  10.10 
62.Replace a string
63. Switch between different java installed in your system
64.Enable SCIM(Smart Common Input Method ) for Libreoffice.
65. Restore Ubuntu panel 

Deatils

Problems and Solutions

1.If you mess up with boot-loader and during installation it complaining about UUID you can fixed it with blkid
blkid - command-line utility to locate/print block device attributes

output from my machine
/dev/sda1: UUID="B0FC1625FC15E67E" LABEL="disk[sda1]" TYPE="ntfs"
/dev/sda2: UUID="50B207AAB207941E" LABEL="disk[sda2]" TYPE="ntfs"
/dev/sda4: UUID="420E5E570E5E4457" LABEL="disk[sda4]" TYPE="ntfs"
/dev/sda5: TYPE="swap" UUID="a906cb1b-a3ac-4738-9980-f6470af45659"
/dev/sda6: LABEL="disk[sda6]" UUID="7a5ac338-5d55-46b2-bd35-d07fafa38421" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: UUID="fb55ad63-7c40-4d26-8428-ec2ad4790f6e" TYPE="ext3"
/dev/sda8: UUID="1f10cf9e-9b2e-448f-ac8b-a9b8481cf349" SEC_TYPE="ext2" TYPE="ext3"


2.If you delete some file from command line accidentally (if you delete from command line it deleted permanently) and want to recover you need the foremost package.

You can install it by

#apt-get install foremost
foremost - Recover files using their headers, footers, and data structures
After installing run

#foremost -t filetype-i /dev/sda1


3. If you want to shutdown your pc at particular time say 11:30 pm then issue the following command

#shutdown -h 23:30


4.If you mess-up with grub and want to recover then boot from ubuntu live cd. Open terminal and run

$sudo grub
grub> find /boot/grub/stage1
(hd0,5)
(hd0,6)

grub>root (hd0,n)
grub>setup (hd0)
grub>quit

$sudo reboot
###here n is the partition no from where you want to recover grub

5.Set Date and time through command line

$sudo date 020212312009
It will set the date and time to Mon Feb 2 12:31:00 IST 2009

6.Print through Command line

$lp filename

7.Quickly Find a PID with pgrep

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria.

pgrep firefox
- This will list all PIDs associated with the firefox process.

8.Execute The Last Executed Command
!!
This will execute the last command you used on the command line.

Isn't the UP arrow for that?

The !! command is very useful when you forget to start a command with sudo :
apt-get update
sudo !!

9.Execute The Last Command Starting With ...

If you want to execute a command from history starting with the letter S you can use the following:

!s
- This will execute the last command used on the command line that started with s.

10.Last Argument

You can use the last argument from the last command by refering to it as $_

so you only need to type a long path like this once:
cp assignment.htm /home/phill/reports/2008/
cd $_
to go straight to the 2008 folder as well.

You can use this however you like. Always the last argument of the command above.

Like using $_ for the last argument of the last command, you can also hit ALT+. to quickly paste it at the cursor.

11.Run a Command Repeatedly and Display the Output

watch runs a command repeatedly, displaying its output. This allows you to watch the program output change over time. By default, the program is run every 2 seconds. watch is very similar to tail.

watch -d ls -l
- This will watch the current directory for any file changes and highlight the change when it occurs.

12.Save Quickly in VI/VIM

Save and quit the file you’re editing in vi by exiting insert mode, holding shift, and hitting z twice (ZZ). That is quick or not, it depends.

You can use :wq OR more easily :x

13.Quickly Log Out of a Terminal

You can quickly log out of a terminal session by using: CTRL+D

14.Navigate to the Last Directory You Were In

cd –
will take you to the last directory you were in.

15.Make Parent Directories the Smart Way

mkdir -p /home/adam/make/all/of/these/directories/ will create all directories as needed even if they do not exist. Why waste time doing something silly like: mkdir make ; cd make ; mkdir all ; cd all ; mkdir of ; cd of … you get the point. Use mkdir -p ! This is one command I really lacked.

16.Delete the Entire Line

If you’ve just typed a long string of commands that you don’t need to enter anymore, delete the entire line by using: CTRL+U,K. That is not easy. CTRL+U deletes whatever is to the left of the cursor and CTRL+K deletes what is to the right. If you are at the end of command, CTRL+U will do. Especially if you start typing password and you make a mistake. Alternatively, you can use CTRL+C, which discards the current typed command, and gives you a new line.
CTRL+L will clear the screen.

17.Set the Time stamp of a File

touch -c -t 0801010800 filename.c will show the time stamp as 2008-01-01 8:00. The format is (YYMMDDhhmm).

18.Command to File

fc will open the last command from your shell history in the default editor. You can also specify a text editor. You can add a history line number or the first few letters of the most recent command.
fc -e kate wget
- will open kate with the last shell command starting with wget. You can edit the command, and when you save and close kate, the command will execute.

19.Ampersand

Ending a command with & runs the command with a new PID, releasing the command line back to you. Useful for running a background process.

20.Resetting your terminal-session

Instead of killing and re-starting your terminal session, you can merely type the command reset. This will reset your terminal back to its defaults, clear the screen, and everything will be as it was before.

21. Playing with packages:-

Checking package status:-

dpkg -l

Discovering package names:
#apt-cache search java
Using dpkg to find package names
#dpkg -S java

If an installation breaks in the middle of the process and you find that it's no longer possible to install or remove packages, try running these two commands:
# apt-get -f install
# dpkg --configure -a


22.Remove unnecessary packages

deborphan | xargs apt-get -y remove purge

23.Resolve "Waiting for root file system..."

When you get dropped to Busy Box prompt, type in:
modprobe ide-disk; modprobe ide-generic; cat /sys/block/hda/dev; mknod /dev/hda1 b 3 0

Then press ctrl+D, and your machine will boot!
Source:- http://ubuntuforums.org/showthread.php?t=686253

24.View total memory in a system:-

egrep "(MemTotal|SwapTotal)" /proc/meminfo

25.Fixing NTFS Mount Error in GNU/Linux

One of the common problem you might encounter while using a external hard drive (or partition) formatted with NTFS (since you multi boot or you want to use the external device with windows and gnu/linux) is that - it fails to mount occasionally giving the below error.

$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/disk/by-uuid/FE5C75355C74E9B3': Operation not supported
Mount is denied because NTFS is marked to be in use

The reason is because you might have probably unplugged the device directly from windows instead of going through 'Safely Remove Hardware' option and hence the NTFS log is not marked unused.

There is a tool to fix it.

sudo ntfsfix /dev/drive_name

If you receive "ntfsfix: command not found" error message, then probably the ntfs utilities are not installed in your distribution (I have figured out that the utility to manipulate nfts is installed in openSUSE by default, but not in Ubuntu 8.04). In that case, you'll need to issue the following before ntfsfix command.

sudo apt-get install ntfsprogs

Which will install the ntfs tools. Once you've installed it, you can issue ntfsfix command. If you are not sure about the drive name, please use the below command to find the drive name.

sudo fdisk -l

If you are using 80Gig external USB Storage, then you will find the below in your command output:


Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3347a943

Device Boot Start End Blocks Id System
/dev/sdb1 1 9729 78148161 7 HPFS/NTFS

which is of course your NTFS USB drive. now you can issue the command as below.

sudo ntfsfix /dev/sdb1

26. If there is any problem in shutdown:-
DO the following things:-

#vi /etc/modprobe.d/power

add the following bit of code to the new file:

options apm power_off=1 realmode_power_off=1

And then EXIT from the file and reboot.

27. Copy from cd and create an iso image through command line.

dd if=/dev/scd0 of=/home/kousik/ubuntu.iso


28. Mount a iso image

mount -o loop disk1.iso /mnt/disk

29.Use packages of DVD to sources.list as repository:-


Extract iso to desktop

Copy /root/Desktop/boss3.0/dists/tejas/main/binary-i386/Packages and /root/Desktop/boss3.0/dists/tejas/main/binary-i386/Packages.gz to /root/Desktop/boss3.0/ folder

Then change the repository list

deb file:///root/Desktop/boss3.0/ tejas main

Then run apt-get update

30. GRUB1 and GRUB2 splash images

For Grub1
Another cool function with GRUB is putting a splash image on the boot menu screen. By default, GRUB will make the menu screen a plain black-and-white menu. There are menu options to change the black and white colors, but why stop there? Grab your favorite picture, or head to one of the URLs listed below which have splash images created for you. If you are creating your own, it will need to be in XPM format, a maximum color palate of 14 colors, and 640x480 resolution size. The GIMP can help transform your graphic to these specifications. As an alternative, you can use the ImageMagick suite of programs. The application convert can help with this conversion process. You can run it as follows:
$ convert -resize 640x480 -colors 14 mycoolpicture.jpg mybootsplash.xpm
$ gzip mybootsplash.xpm

In this case, the file mycoolpicture.jpg will be resized to 640x480, reduced to 14 colors, and saved in the XPM graphical format. The second step compresses the XPM file using the gzip compression method. GRUB can display the gzipped-xpm splash images well.

If you don’t want to create your own splash image, check out some of the following web sites which have them available for download:

GRUB Splash
http://schragehome.de/splash/
Once you have the XPM or gzipped-xpm file, you need to add a line at the top of GRUB’s menu.lst to instruct GRUB to load the specified boot splash image. The line should read as follows:
splashimage=/boot/grub/debsplash.xpm.gz

In my case, I’m using the Debian boot splash image as my background.

For GRUB2 

Install grub2 splash image package by

$sudo apt-get install grub2-splashimages

Then modify /etc/grub.d/05_debian_theme file
Give the wall paper path around line number 10
WALLPAPER="/usr/share/images/grub/Hortensia-1.tga"

comment out
use_bg=false
Put
use_bg=true

Then run
$sudo update-grub2

output should be like this
Generating grub.cfg ...
Found Debian background: Hortensia-1.tga
...

This means you have done it successfully.

Reboot-check-and-enjoy :)

31. GRUB on CD-R/W media

I’ve also mentioned several times about installing GRUB to use for a bootable CD-R/W disk. When generating the ISO image, you will use some special settings of mkisofs. The command to build a bootable GRUB CD-R/W looks like:
$ mkdir -p iso/boot/grub
$ cp stage2_eltorito iso/boot/grub
$ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
-boot-load-size 4 -boot-info-table -o grub.iso iso

The key is to copy the stage2_eltorito file into the /boot/grub directory of the CD image tree, and run mkisofs with the options specified above. As mentioned earlier, you can also burn a menu.lst file along with kernels and disk images and put them all on the CD. In the menu.lst, you will need to use (cd) as the device, rather than (hd0). Splash images work well, too.



32. Connect to Reliance ZTE MC315+
Your /etc.wvdial.conf
[Dialer Defaults]
Modem = /dev/ttyS3
Baud = 57600
SetVolume = 0
Dial-AT-OK ATDT Command =
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
Phone = #777
Username = ##########
Password = ##########
New PPPD = yes
Carrier Check = no
Stupid Mode = 1


As root user run these two command
setserial /dev/ttyS3 baud_base 230400
wvdial
--> WvDial: Internet dialer version 1.56
--> Initializing modem.
--> Sending: ATZ
+ZIND:8
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at DATE
--> Pid of pppd: 7947
--> Using interface ppp0
--> pppd: X[04][06][08]H [06][08]
--> pppd: X[04][06][08]H [06][08]
--> pppd: X[04][06][08]H [06][08]
--> pppd: X[04][06][08]H [06][08]
--> pppd: X[04][06][08]H [06][08]
--> local IP address 220.224.34.198
--> pppd: X[04][06][08]H [06][08]
--> remote IP address 220.224.134.72
--> pppd: X[04][06][08]H [06][08]
--> primary DNS address 202.138.97.193
--> pppd: X[04][06][08]H [06][08]
--> secondary DNS address 202.138.96.2
--> pppd: X[04][06][08]H [06][08]
Note:With the value of baud 57600 in /etc/wvdial.conf, keep changes the value of baud_base as "n*baud " with `setserial` where n is 2,4,8,16

i.e. baud=57600, baud_base=115200,230400,460800 ....

for baud_base 230400 or 460800 modem will start responding but may vary.

33. If firefox starting @ offline mode (Due to eth0 is disable ):-

Open "/etc/dbus-1/system.d/NetworkManager.conf " from root user

Change

3/4 lines contain

34. Erase a re-writeable CD from command line

#cdrecord blank=all -immed dev=/dev/cdrw1

35. Write a iso image to a cd
#wodim --devices

Output #wodim --devices
wodim: Overview of accessible drives (2 found) :
-------------------------------------------------------------------------
0 dev='/dev/hdb' rwrw-- : 'SONY' 'CD-RW CRX230ED'
1 dev='/dev/hdc' rwrw-- : 'HL-DT-ST' 'CD-ROM GCR-8523B'
-------------------------------------------------------------------------
Then run
#cdrecord -v dev=/dev/hdb -speed=8 binary.iso

36. Get the repository size in GB

wget http://ftp.us.debian.org/debian/dists/lenny/main/binary-i386/Packages.gz -O - |zcat|sed 's/Installed-Size://'|grep Size|awk '/Size:/ {pkgsize+=$2} END {print "package size = "pkgsize/1073741824" GB"}'

37. If you want to see the file permission in numerical form

$stat -c '(%a)%8hs%.19y%n' /etc/*

38. Get the directory/folder size from Command line

$du -sh

39. If you want to keep the files under /tmp directory during rebooting

Modify the following file sudo vi /etc/default/rcS

Set TMPTIME to 60 so that files in /tmp will deleted if their modification time is more than 60 days ago.
TMPTIME=60

40. Adding a startup script to be run at bootup

So you have a script of your own that you want to run at bootup, each time you boot up. This will tell you how to do that.

Write a script. put it in the /etc/init.d/ directory.
Lets say you called it FOO. You then run

% update-rc.d FOO defaults

You also have to make the file you created, FOO, executable, using
$chmod +x FOO

You can check out
% man update-rc.d for more information. It is a Debian utility to install scripts. The option “defaults” puts a link to start FOO in run levels 2, 3, 4 and 5. (and puts a link to stop FOO into 0, 1 and 6.)

41.USB hard drive read only access

If your usb stick mounting in read-only mode just run the following command

$ sudo dosfsck -a /dev/sdb
This command will help you to check and repair MS-DOS file systems. Here I assume that my usb stick detected at /dev/sdb. Just check where usb is mounted by "fdisk -l"

42.Change the bit rate of a mp3 file:-
Install lame
Then run the following command
lame --mp3input -b 96
Here we want to convert bit rate to 96 bps

43. Backup with rsync :-
For copy to a USB or other dir without deleting the original file run the following command
rsync -avh  /source/dir /destination/dir/

For copy to USB and also want to delete the source dir run the following  command
rsync -avh  -delete /source/dir /destination/dir/


44. Deleting comment lines starting with a special symbol:-

Let's say that your comment lines start with the symbol #. You have a handy one-liner for sed that will get rid of them:
$sed '/^\#/d' filewithcomment > filewithoutcomment

45. Working with startup scripts:-
Create startup script at /etc/init.d/ then go to that directory. Run

for Debian based system:-

#update-rc.d scriptname defaults
For Redhat system:-
#chkconfig scriptname

For disable startup script run:-
for Debian:-
update-rc.d -f scriptname remove
for Redhat:-
chkconfig -d scriptname

46. Boot debian faster:-

Open /etc/init.d/rc file
Search for "CONCURRENCY" keyword, you can see CONCURRENCY=none
Then modify this line to
CONCURRENCY=shell
Then reboot and watch.

47. Add Splash screen to debian:-
 Install splashy splashy-themes in your debian system.


Then open your menu.lst (/boot/grub/menu.lst)
and in the line with kernel value add these words at the end of that line
"vga=791 splash quiet"
You can download more theme from http://splashy.alioth.debian.org/wiki/themes/contrib
Then extract theme into /etc/splashy/theme/ directory(here you can see other themes also).
Then run #splashy_config -s

Then reboot and enjoy with new theme.


48. Get exact RAM size in MB
cat /proc/meminfo | awk 'match($1,"MemTotal") == 1 {print $2/1024}'

49. X:- No Screen Found error:-
You'll need to reconfigure the X-server:

dpkg-reconfigure xserver-xorg

50. Removing "Too many levels of symbolic links" error:-

If you create symbolic link then try to access it and get the following error like this "cannot access `Lenka': Too many levels of symbolic links"
 Then there is the problem with the path . Always give the Absolute path(i.e. /home/user/Lenka) rather than Lenka in ln -s
Eg ln -s /home/guest/Desktop/Lenka/ /var/www/mp3/
not ln -s Desktop/Lenka/ /var/www/mp3/

Then it will work fine.

51.Read from standard input and write to standard output and files:-

For this use tee,tee is normally used to split the output of a program so that it can be seen on the display and also be saved in a file.
Example:-
$strace  alacarte 2>&1 |  tee log

52. If you faceing problem in resizing Windows Partitions:-

Boot from windows .Run chkdsk \f from command prompt. After that restart twice.Then you can resize your partition.

 53. Configure Tata indicom HUAWEI and Reliance HUAWEI
Check lsusb :-
Bus 005 Device 009: ID 12d1:140b Huawei Technologies Co., Ltd.

Check :- cat /proc/bus/usb/devices

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=140b Rev= 0.00
S:  Manufacturer=HUA�WEI TECHNOLOGIES
S:  Product=HUAWEI Mobile
S:  SerialNumber=�����������������
��
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=87(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=08(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

login as a root and  copy usb_modeswitch.conf in /etc folder and usb_modeswitch executable in /usr/sbin
run following command..
Download the files from here
#usb_modeswitch -v 0x12d1 -p 0x140b -d 1

#usb_modeswitch -v 0x12d1 -p 0x140b -H 1

test using wvdialconf that device is detected or not and then configure

/etc/wvdial.conf
Sample file:-
#start of wvdial file

[Dialer Defaults]
Modem = /dev/ttyS3
Baud = 57600
SetVolume = 0
Dial-AT-OK ATDT Command =
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
Phone = #777
Username = ##########
Password = ##########
New PPPD = yes
Carrier Check = no
Stupid Mode = 1


 #End of wvdial file


The next command may be optional for USB

Then run setserial /dev/ttyS3 baud_base 230400

and run wvdial

54. Reverse search by Grep
If you want to search with grep that reverse the meaning of a grep search
Use -v option
e.g. grep -v disk | dmesg
This will print all line except line containing disk


55. How to view logfiles in Debian:


Use dump-utmp (dump-utmp - print an utmp file in human-readable format)
For that you have to install acct package


Then run
$dump-utmp /var/log/wtmp

This will show the the file into human readable format

56. Change hostname
To change hostname run
#echo "New_host_name" > /proc/sys/kernel/hostname
Then reboot and check

57.Create own Debian repository from an installed Debian or Ubuntu system:-
         You can create your own repository from an installed system. This can be helpful for saving bandwidth and saving your time also(if system some how got corrupted).

For this package needed is dpkg-dev. You can install it from synaptic package manager.

Then create a directory, e.g. my_repo  . This is the root of your repository. Under this create a directory named binary

After that copy .deb files from /var/cache/apt/archives/ into binary directory. 

Then go that my_repo directory and run

dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
This will create your packages list.

After that save whole my_repo directory into another system and change the /etc/apt/sources.list file and add the path of the my_repo directory like this:-

deb file:///home/boss/my_repo binary/

If you don't have internet connection you can comment out other lines.

Then reload the repository list and check .

58. Removing GPG warning during apt-get update 
If you face the following warning :-
W: GPG error: http://www.vislab.uq.edu.au lucid/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY DA9163F7B638808E


You have to run these command:-
$gpg --recv-keys DA9163F7B638808E
 Output:-
gpg: requesting key B638808E from hkp server keys.gnupg.net
gpg: key B638808E: public key "Christoph Willing (UQ)
gpg: Total number processed: 1
gpg:               imported: 1
Next:-
$gpg -a --export  DA9163F7B638808E | sudo apt-key add -

Output:-
OK
After that run apt-get update.


59.Resolving " could not gain access to /dev/sound/dsp for writing"
Run these two commands :


$sudo ln -s /dev/snd /dev/sound

$sudo ln -s /dev/dsp /dev/snd/


Then check...
 
60.Unmount forcefully ...
Run these two comman If you are faceing problem in unmounting usb, you can do it forcefully
Assuming you mount your USB at /media/disk, run :-
#umount -l /media/usb

61.Configure sify-bbclient for Ubuntu 10.10

Download Sify Broadband client from here http://202.144.65.70:8090/linuxinstall.html
Download the non-rpm ...
Extract the archive and install the Sify Broadband client by running
$./install.sh

from terminal(first go to the directory).
Then run try to run 
$sudo ./sifyconnect

It will complain libcrypto.so.4 and libssl.so.4 not present. You have to just create a softlink for these 2 files.
$sudo ln -s /lib/libssl.so.0.9.8 /lib/libssl.so.4
$sudo ln -s /lib/libcrypto.so.0.9.8 /lib/libcrypto.so.4



After that go to System-> Preference->Network Connection and select your wired connection give the proper settings which you have got from your ISP. Then check.
Then run
$sudo ./sifyconnect


62. Replace a String in a file.


replace 'From'  'To '  -- filename


63. Switch between different java installed in your system
Run
$sudo update-alternatives --config java
This will show you all installed java versions.Then you choose which you want to use.

64.Enable SCIM(Smart Common Input Method ) for Libreoffice.
First you have to install scim.
Then run the following command


$export XMODIFIERS=@im=SCIM
$export GTK_IM_MODULE=scim
$export QT_IM_MODULE=scim
$scim -d


Then go the installed directory of Libreoffice( My case it was /opt/libreoffice3.4/


$cd /opt/libreoffice3.4/ure/lib/
 $ sudo mv libstdc++.so.6 libstdc++.so.6.orig
 $ sudo mv libgcc_s.so.1 libgcc_s.so.1.orig

Then check if it works by pressing comtrol+space.

65. Restore Ubuntu 12.04 Panel

If Ubuntu 12.04 panel doesn't appear properly, run
$ sudo apt-get install dconf-tools
and
$sudo dconf reset -f /org/gnome/gnome-panel/

This will restore your panel.

66.  Detect rogue dhcp

# ifconfig ethX promisc
# tshark -i ethX -n port 68 -R 'bootp.type == 2'