add

Thursday, August 18, 2011

20 Years of Linux [Infographic]


Linux celebrated it’s 20th birthday this week. During these twenty years Linux has evolved remarkably from an ordinary computer application that could do nothing much than bootin-up a computer to now a full scale and highly featured operating system, which is still free.

Linux Foundation, at the occasion of it’s birthday, released following infographic which pretty much shows the transition that Linux has undergone during the years.

At the end there’s a video as well – to better understand the concept of Linux, just in case if aren’t aware of it’s business rules.


Tell Us: Do you think you are Being Trapped by Google?

Google has become an essential part of our online lives. Gmail, Google Docs, Search Engine, Feed Reader, Maps, Google Earth, YouTube and What Not?

I am not doubting the ease this single company has brought to our lives, but at the same ever you thought that Google stores all the activities you do on internet, for instance, what searches you did, emails you send, your mobile number and much much more – there is a huge list we can make. For a sneak peak, find out what information Google stores about you by clicking this link: https://www.google.com/dashboard/

There are good chances that Google knows that you are looking for admission in a medical college in Abbotabad, or maybe it knows well that you are preparing a research report on a particular topic for your degree project or even it may know your medical history as well.

Instead of commenting further – we want to hear from you in comments, and question is

“Ever you thought that Google knows too much about you? If not, are you thinking the same now? What’s in your mind – say it” (Silent Readers are also requested for input)

Expect a follow up post on the same topic – but first, we want to listen you.

Wednesday, August 17, 2011

linux commands for every web developer/Software engineer

scp - Linux command line tool to copy files over ssh

scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]

scp  abc.TXT root@10.215.3.150:/home/user/xyz.TXT



from-host
Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command
user
Is the user which have the right to access the file and directory that is supposed to be copied in the cas of the from-host and the user who has the rights to write in the to-host
source-file
Is the file or files that are going to be copied to the destination host, it can be a directory but in that case you need to specify the -r option to copy the contents of the directory
destination-file
Is the name that the copied file is going to take in the to-host, if none is given all copied files are going to maintain its names

Copy Multiple fies

scp root@192.168.168.052:/home/ftp-124/5656/$dir/\{abc.txt,def.txt,ghi.txt\} root@192.168.168.053:/home/shahzeb

Restart MySql Ubuntu

To restart Apache2 on Ubuntu, we enter the following command in a terminal such as bash:
restart mysql

service mysql start

Restart Apache2 Ubuntu

To restart Apache2 on Ubuntu, we enter the following command in a terminal such as bash:
/etc/init.d/apache2 restart
Of course, you most likely will need to be the superuser to do that so you might need to enter the following command and then your password when requested:
sudo /etc/init.d/apache2 restart

Pointer

use pointer to acees the variable within a variable directly like
 foo=bar
 name=foo
 echo ${!name}
Result : bar

grep command: 

grep command usually interpet "|" as "AND" sign but you can use the same "|" for "OR" sign

for example
zgrep "^2012-06-05" /var/path/to/file/abc12346-12-06* | grep -E '3003300356|3003301763|3008203898|3008202542|3008226266|3003404159'


zgrep = grep for gzipped files

Monday, August 15, 2011

some of the basic linux command

There are many common Linux commands that will be helpful to you, if you ever even use the command line interface in Linux. Most average users just use the graphical user interface instead which usually has many tools and front-ends to Linux common commands. This Linux tutorial on command commands will help even the average user in case X server crashes, fails, is not properly configured, etc. So continue reading for some of the more common Linux bash commands.

Some of the more common Linux shell commands are listed below for more information on each command you can always run man [command] and this will bring up the manpage for that command, you can also click on the commands listed for some common examples and syntax.
First before I list them any syntax in [] will need some kind of input from you normally, for example:
man [command] you will want to actually replace [command] with the shell command you want to read the man page for: man ls will give you the man page for the Linux shell command ls.
  • linux ls command – is used to list files on the filesystem.
  • file – command that will check the filetype, this will output to you what the file type is no matter what the extension is.
  • mkdir command – used to make directories on the filesystem.
  • cd – is used for changing into a different directory in the Linux shell
  • cp – is the Linux copy command, this shell command is used to copy files|directories from one location on the filesystem to another.
  • mv – the Linux terminal command to move files|directories. Like the cp command, but deletes the original source.
  • rm – shell command in Linux to remove files|directories.
  • Linux cat command- this command is used to print|view the contents of a file to the screen|terminal.
  • grep – command used to search|find contents of a file and print|view on your terminal|screen.
  • Linux more and less – commands that will allow you to read output of files, unlike cat that will output the entire file at once, even if it is too large for your terminal more and less will output only as many lines as the shell you are in can output, and allow you to scroll through the file contents.
  • chown – Linux command to change ownership of a file|directory.
  • Linux chmod – command that allows you to change mode of user access|permissions, basically set read, write, and execute permissions.
  • Linux ps – lists the current running processes on your Linux system
  • Linux kill and killall commands – used to kill|terminate running processes

Unpacking or uncompressing gz files under Linux and UNIX systems

Using gunzip command:
$ gunzip file.gz
$ ls file
Using gzip -d command:
$ gzip -d file.gz
$ ls file
If file extension is tar.gz, type the command:
$ tar -zxvf file.tar.gz
Please note that gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack programs.