Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, March 20, 2013

Open Source Softwares


http://openit.biteus.org/wp-content/uploads/2007/11/osi.png
Open source software (OSS) began as a marketing campaign for free software.OSS can be defined as computer software for which the human-readable source code is made available under a copyright license (or arrangement such as the public domain) that meets the Open Source Definition. This permits users to use, change, and improve the software, and to redistribute it in modified or unmodified form. It is very often developed in a public, collaborative manner. Open source software is the most prominent example of open source development and often compared to user generated content.
Open Source Softwares have following main advantages:
#Users should be treated as co-developers
#Early releases
The first version of the software should be released as early as possible so as to increase one’s chances of finding co-developers early.
#Frequent integration
New code should be integrated as often as possible so as to avoid the overhead of fixing a large number of bugs at the end of the project life cycle. Some open source projects have nightly builds where integration is done automatically on a daily basis.
#Several versions
There should be at least two versions of the software. There should be a buggier version with more features and a more stable version with fewer features. The buggy version (also called the development version) is for users who want the immediate use of the latest features, and are willing to accept the risk of using code that is not yet thoroughly tested. The users can then act as co-developers, reporting bugs and providing bug fixes.
#High modularization
The general structure of the software should be modular allowing for parallel development.
#Dynamic decision making structure
There is a need for a decision making structure, whether formal or informal, that makes strategic decisions depending on changing user requirements and other factors. Cf. Extreme programming.
Most well known OSS products include projects such as Linux, Firefox, Apache, the GNU Compiler Collection, and Perl to mention a few.
Linux kernel comes up with many distributions so we can download it through the distribution’s site such as http://www.fedoraproject.org
PHP: PHP hypertext pre-processor can be downloaded from www.php.net/downloads.php
Apache: One of the most famous HTTP server http://httpd.apache.org/download.cgi
Mozilla Firefox, The most commonly used and best Explorer http://www.getfirefox.com
Pidgin: A multi-protocol instant messenger formerly known as GAIM http://www.pidgin.im/download/
MySQL: one of the leading database management program http://dev.mysql.com/downloads/

Recovering Linux after Windows Install



It has always been a very common problem among the users when they install Windows after LINUX, The master boot records from the memory are Lost and they are writed for windows only systems, So here is the way to write Master boot records or rather installing grub again so that LINUX gets back to work

1. Boot the Desktop/Live CD.
2. Open a terminal (Applications -> Accessories -> Terminal)
3. Start grub as root with the following command :
* sudo grub
4. You will get a grub prompt (see below) which we will use to find the root partition and install grub to the MBR (hd0,0)
* [ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub>
Type the following and press enter:
find /boot/grub/stage1
Using this information, set the root device:
grub> root (hd0,1)
Install Grub:
grub> setup (hd0)
Exit Grub:
grub> quit
5. Reboot (to hard drive). Grub should be installed and both Ubuntu and Windows should have been automatically detected.
6. If, after installing grub, Windows will not boot you may need to edit /boot/grub/menu.lst (That is a small “L” and not the number 1 in menu.lst)
* Open a terminal and enter :
gksu gedit /boot/grub/menu.lst
Or, in Kubuntu:
kdesu kate /boot/grub/menu.lst
Your Windows stanza should look something like this :
title Windows XP/Vista # You can use any title you wish, this will appear on your grub boot menu
rootnoverify (hd0,0) #(hd0,0) will be most common, you may need to adjust accordingly
makeactive
chainloader +1

Resetting Root Authorization in Linux and Prevention



The root authentications can be reset to NULL value from the following method.
Do not use this information for committing cyber crimes.
AT Grub Loader.
highlight the desired kernel which you want to boot ‘fedora core fc9′
press ‘e’ to edit the run levels and other options
then the second menu arrives as ..
(hd0,1)
rhgb quiethighlight the part with quiet and then again press ‘e’
now you will get a prompt to edit the command …
add 1 as
rhgb quiet 1
space is must…
then press enter
and then press ‘b’ to boot
you will be booted and awarded with a root console….
root@machine#
root@machine#passwd
change the password of root>
Enter New password>
Retype password>
all pasword tokens authenticated….
root@machine#reboot
Explaination:
By editing the grub we edit the kelrnel line from where the OS will get booted. in doing so FC or any other distro it boots the Os kernel with the runlevel one.
In doing so it repairs the the filesystem and reinstalls the users and makes the default value of each password to NULL.
this can be prevented by editing the runlevel from restting the passwd. just add a # to the line of passwd in /boot/boot.conf under the heading of runlevel one.
then you may add the numbers such a 1, 2, 3 to have different run levels.
2 will open in text mode.
suppose you have various kernels on your system then /etc/grub.conf will show
title Fedora Core (2.6.12-1.1398_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1398_FC8 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1398_FC8.img
title Fedora Core (2.6.12-1.1390_FC8)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1390_FC8 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1390_FC8.img
title Fedora Core (2.6.12-1.1387_FC8)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1387_FC4 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1387_FC4.img
title Fedora Core (2.6.11-1.1369_FC8)
root (hd0,0)
you may chnge the preference and remove the hash from password protected grub and edit the password value.
Prevention:
The above method for resetting the password value can be prevented by using a password protection over grub.
This can be done via terminal,
login as Super user by su -
and then type grub-md5-crypt
you will then be prompted to type password, retype when asked. Then copy the MD5 hash which is generated for the grub.
now open /etc/grub.conf
Locate hiddenmenu
now below this write : password –md5
Now whenever you enter the grub screen it will not edit the kernel line, unless you provide the correct password.
You can also prevent the boot of certain kernel by changing the place from below of “hiddenmenu” to above of the desired kernel.
Hope you enjoyed the post.

Some linux commands


Starting & Stopping

shutdown -h now Shutdown the system now and do not
reboot
halt Stop all processes – same as above
shutdown -r 5 Shutdown the system in 5 minutes and
reboot

shutdown -r
 now Shutdown the system now and reboot
reboot Stop all processes and then reboot – same
as above
startx Start the X system

Accessing & mounting file systems

mount -t iso9660 /dev/cdrom/mnt/cdrom Mount the device cdrom and call it cdrom under the /mnt directory
mount -t msdos /dev/hdd/mnt/ddrive Mount hard disk “d” as a msdos file system and call it ddrive under the /mnt directory
mount -t vfat /dev/hda1/mnt/cdrive Mount hard disk “a” as a VFAT file system and call it cdrive under the /mnt directory
umount /mnt/cdrom Unmount the cdrom

Finding files and text within files

find / -name fname Starting with the root directory, look for the file called fname
find / -name ”*fname*” Starting with the root directory, look for the file containing the string fname
locate missingfilename Find a file called missingfilename using the locate command – this assumes you have already used the command updatedb
updatedb Create or update the database of files on all file systems attached to the linux root directory
which missingfilename Show the subdirectory containing the executable file called missingfilename
grep textstringtofind/dir Starting with the directory called dir , look for and list all files containing textstringtofind

The X Window System

xvidtune Run the X graphics tuning utility
XF86Setup Run the X configuration menu with automatic probing of graphics cards
Xconfigurator Run another X configuration menu with automatic probing of graphics cards
xf86config Run a text based X configuration menu

Moving, copying, deleting & viewing files

ls -l List files in current directory using long format
ls -F List files in current directory and indicate the file type
ls -laC List all files in current directory in long format and display in columns
rm name Remove a file or directory called name
rm -rf name Kill off an entire directory and all it’s includes files and subdirectories
cp filename/home/dirname Copy the file called filename to the /home/dirname directory
mv filename/home/dirname Move the file called filename to the /home/dirname directory
cat filetoview Display the file called filetoview
man -k keyword Display man pages containing keyword
more filetoview Display the file called filetoview one page at a time, proceed to next page using the spacebar
head filetoview Display the first 10 lines of the file called filetoview
head -20 filetoview Display the first 20 lines of the file called filetoview
tail filetoview Display the last 10 lines of the file called filetoview
tail -20 filetoview Display the last 20 lines of the file called filetoview

Installing software

rpm -ihv name.rpm Install the rpm package called name
rpm -Uhv name.rpm Upgrade the rpm package called name
rpm -e package Delete the rpm package called package
rpm -l package List the files in the package called package
rpm -ql package List the files and state the installed version of the package called package
rpm -i –force package Reinstall the rpm package called name having deleted parts of it (not deleting using rpm -e)
tar -zxvf archive.tar.gz or tar -zxvf archive.tgz Decompress the files contained in the zipped and tarred archive called archive
./configure Execute the script preparing the installed files for compiling

User Administration

adduser accountname Create a new user call accountname
passwd accountname Give accountname a new password
su Log in as superuser from current login
exit Stop being superuser and revert tonormal user

X Shortcuts – (mainly for Redhat)

Control|Alt + or - Increase or decrease the screen resolution. eg. from 640×480 to 800×600
Alt | escape Display list of active windows
Shift|Control F8 Resize the selected window
Right click on desktop background Display menu
Shift|Control Altr Refresh the screen
Shift|Control Altx Start an xterm session

Printing

/etc/rc.d/init.d/lpd start Start the print daemon
/etc/rc.d/init.d/lpd stop Stop the print daemon
/etc/rc.d/init.d/lpd status Display status of the print daemon
lpq Display jobs in print queue
lprm Remove jobs from queue
lpr Print a file
lpc Printer control tool
man subject | lpr Print the manual page called subject as plain text
man -t subject | lpr Print the manual page called subject as Postscript output
printtool Start X printer setup interface

Some More

ifconfig List ip addresses for all devices on the machine
apropos subject List manual pages for subject
usermount Executes graphical application for mounting and unmounting file systems

Restoring lost partitions using Ubuntu live CD



FAQ: How do I restore my lost partition table? I accidentally deleted my partition table, how do I recover my data? How to recover deleted partitions and data in them? Recover data from deleted drives.
WARNING: If you’ve formatted and/or added new data to the drive, or carried on with an OS installation, chances of recovery are very less.
Most people end up deleting their partition table while they try to install a new OS for the first time, I personally know a couple of them who ended up deleting their partition table while they tried to install Linux for the first time, (more on that later), Now what I am going to introduce to you a tiny tool called “gpart”which will help you restore your deleted partition table.
Things you’ll need.


  1. An Ubuntu or similar, live CD (actually any Linux live CD / USB will do, but I am demonstrating here using Ubuntu 9.04 (Jaunty Jackalope)
  2. A working internet connection or this file (35.8 KiB)
  3. Patience!
Here is the step by step procedure for restoring your lost partition table, and hence your lost data
  1. Boot using your live cd, I am using Ubuntu 9.04, Jackalope here.
  2. You will need this file (35.8 KiB), or if you’re using another version of Ubuntu or a different Linux distro, the name of the package you need is gpart.
  3. You can install these packages using apt-get as well, from the terminal, if you have a working internet connection, here is the procedure for that
  • Open the repository file by typing the following at the terminal :
  • sudo gedit /etc/apt/sources.list
  • Add the following line to it :
  • deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe
  • Install gpart by typing the following commands in the terminal :
  • sudo apt-get update
  • sudo apt-get install gpart
  1. Once you’ve downloaded and installed it, (it’s a binary file, just double click and go)
  2. Open up terminal from the applications menu at the top
  3. And type in the following command to detect the lost partitions : sudo gpart /dev/sda [This might take some time]
  4. This command assume that the drive is detected as /dev/sda if this is the only drive you’ve got, 99% chances are that it will be detected like this, otherwise change the /dev/sda parameter accordingly.
  5. This command will output the detected partitions that might have been lost due to some reasons, if they’re correct, and then this partition table needs to be written to the disk, use the following command for it.
  6. sudo gpart /dev/sda -W /dev/sda
After the partition table has been successfully written [after considerable time], you will be asked to restart the computer, if everything goes well, you will be presented with your lost partition table and data on the next restart!
Now, if you’re using terminal for everything, here is a short-cut.
  • ubuntu@ubuntu:~$ sudo gedit /etc/apt/sources.list[You will have to add the following line to the end of the file that is opened: deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe, save and close this file.]
  • ubuntu@ubuntu:~$ sudo apt-get update
  • ubuntu@ubuntu:~$ sudo apt-get install gpart
  • ubuntu@ubuntu:~$ sudo gpart /dev/sda
    [you will have to verify if the detected partition data is correct before proceeding, this command is supposed to take some time]
  • ubuntu@ubuntu:~$ sudo gpart /dev/sda -W sudo gpart /dev/sda
    [Restart if this command is completed successfully, This command may take considerable time
This post was originally published at tuespeaks.co.cc by phoenix@tuespeaks.co.cc