Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Saturday, 4 January 2014

Some Interesting Facts About GNU/Linux

Some Interesting Facts About GNU/Linux :



    Linux is a land of excavation, the more you excavate the more you find treasure lies within it. This article tries to uncover some of the lesser known facts about Linux. To keep things simple, easy to read, easy to remember and easy to refer this article will be presented in point-wise fashion.

  
# Linux is not an OS, but it is the kernel, GNU Linux is the OS and it comes in several hundred flavours.

# Linux Kernel was written by a 21 year finnish college student as a part of his hobby. Yup! His name is Linus Torvalds.

# Torvalds created Linux based on GNU General Public License (GPL). Perhaps Torvalds would have never written his own kernel if GPL would be having it’s own kernel and driver.

# Major part of today’s Linux kernel is written in C programming language and assembly language and only 2% of today’s kernel contains code written by Torvalds.

# A Standard Linux Kernel of today has over 10 Million lines of code and it grows at the rate of 10% every year. About 4500 lines of codes are added and 1500 lines of code are changed everyday. Initially in 1991, Linux kernel version 0.01 was released with 10239 lines of code.

# A guy named William Della Croce Jr. registered the name Linux and demanded royalty for using its name and mark. However he agreed to handover the trademark to Linus, later.

# The Linux kernel’s official mascot is a penguin named Tux, abbreviation of tuxedo. The idea that Linux had a pet penguin comes from Linus Torvalds himself.

# Linux Torvalds has been honoured by naming an astroid after his name.

# OK, Now the area of application of Linux – U.S. Department of Defense, U.S. Navy Submarine Fleet, Federal Aviation Administration, Tamil Nadu for education purpose, Japan’s bullet trains, traffic control of San Francisco, the New York Stock Exchange, CERN, many air traffic control systems or control of nuclear reactors of submarines and ships, Russia, Brazil and Venezuela for interoperable management , cost efficient and technologically independence, Google, Cisco, Facebook, Twitter, Linked in, Toyota, TiVo, etc, server hosting the website of the White House (Drupal), federal government of Brazil favours Linux operating systems over all others in its PCs. Is Not Linux kernel the most widely ported operating system, running on a great variety of operating systems.

# For those who think Linux can’t do Animation – Oscar-winning visual effects of the Titanic by James Cameron came from machines with Linux and Avatar was the last movie completely developed in 3D Applications on Linux platform using Foss Software. Exclaimed!

# Believe it or not – In 2002, Microsoft had accumulated a $ 421 million cost of fighting the spread of Linux, according to The Register.

# According to a study funded by the European Union, the estimated cost to redevelop the most recent kernel versions would be at $1.14 billion USD – Amazed.

# Microsoft Windows and the Linux kernel can run simultaneously in parallel on the same machine using a software called Cooperative Linux (coLinux).

# IBM choose Linux for what is expected to be the world’s most powerful supercomputer, Sequoia, due in 2011.

Thursday, 28 November 2013

Linux shell commands tips and tricks


Linux shell commands tips and tricks:

 
     Keep in mind that for some commands you will need to install additional software on your Linux distribution.

SSH debug mode:
    $ ssh -vvv user@ip_address   

SSH with pem key:

     $ ssh user@ip_address -i key.pem    

Create war file:

     $ jar -cvf name.war file    

Test disk read speed:

     $ hdparm -Tt /dev/sda    

Get md5 hash from text:

     $ echo -n "text" | md5sum    

Check xml syntax:

     $ xmllint --noout file.xml    

Extract tar.gz in new directory:

     $ tar zxvf package.tar.gz -C new_dir    

Get HTTP headers with curl:

     $ curl -I http://www.example.com      

Modify timestamp of some file or directory (YYMMDDhhmm):

     $ touch -t 0712250000 file    


Download from ftp using wget:

     $ wget -m ftp://username:password@hostname    

Generate random password (16 char long in this case):

     $ LANG=c < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;    

Quickly create a backup of a file:

     $ cp some_file_name{,.bkp}    

Access Windows share:

     $ smbclient -U "DOMAIN\user" //dc.domain.com/share/test/dir    

Run command from history (here at line 200):

     $ !200    

Unzip to directory:

     $ unzip package_name.zip -d dir_name    

Show free RAM in MB:

     $ free -m | grep cache | awk '/[0-9]/{ print $4" MB" }'    

Git clone specific branch (master):

     $ git clone git@github.com:name/app.git -b master    

Git switch to another branch (develop):

     $ git checkout develop    

Git delete branch (mybranch):

     $ git branch -d mybranch    

Git delete remote branch:

     $ git push origin :branchName    

Git push new branch to remote:

     $ git push -u origin mynewfeature    

List all supported kill signals:

     $ kill -l    

Installing Lua and Luarocks in CentOS

Installing Lua and Luarocks in CentOS:

     There seems to be something wrong with CentOS' lua package (version 5.1.4). After installing lua via yum, compiling luarocks in /usr/local/src/ and running the luarocks command, you will end up with the following error:

The issue seems to persist even in CentOS 6. So we suggest building lua and luarocks directly from the source after some OS library dependencies are met:

     # yum install gcc gcc-c++ kernel-devel    
     # yum install readline-dev                         
     # yum install ncurses-devel.i386               


Proceed to download and compile lua:

     # wget http://www.lua.org/ftp/lua-5.1.4.tar.gz     
     # tar zxvf lua-5.1.4.tar.gz                                     
     # cd lua-5.1.4                                                       
     # make linux                                                        
 

Download and install luarocks:

     # wget http://luarocks.org/releases/luarocks-2.0.6.tar.gz    
     # tar zxvf luarocks-2.0.6.tar.gz                                             
     # cd luarocks-2.0.6                                                               
     # ./configure                                                                          
     # make                                                                                  
     # make install                                                                        


This should help you have luarocks properly installed and ready to fetch lua modules from the repo. Have fun!

Wednesday, 6 November 2013

4 Information gathering commands for linux

DIG :

      dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output. Other lookup tools tend to have less functionality than dig.


     # dig google.com    

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38479
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.            IN    A

;; ANSWER SECTION:
google.com.        62    IN    A    74.125.236.73
google.com.        62    IN    A    74.125.236.65
google.com.        62    IN    A    74.125.236.68
google.com.        62    IN    A    74.125.236.78
google.com.        62    IN    A    74.125.236.67
google.com.        62    IN    A    74.125.236.66
google.com.        62    IN    A    74.125.236.72
google.com.        62    IN    A    74.125.236.70
google.com.        62    IN    A    74.125.236.71
google.com.        62    IN    A    74.125.236.69
google.com.        62    IN    A    74.125.236.64

;; Query time: 53 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Thu Nov  7 10:40:52 2013
;; MSG SIZE  rcvd: 204

 

NSLOOKUP :

      Nslookup is a program to query Internet domain name servers. Examples of issueing a simple query: nslookup name nslookup IP_address nslookup name server nslookup IP_address server 


     # nslookup google.com    

Server:        192.168.30.50
Address:    192.168.30.50#53

Non-authoritative answer:
Name:    google.com Address: 74.125.236.70
Name:    google.com Address: 74.125.236.65
Name:    google.com Address: 74.125.236.73
Name:    google.com Address: 74.125.236.69
 

HOST :

     host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. 
When no arguments or options are given,host prints a short summary of its command line arguments and options.

     # host google.com    

google.com has address 74.125.236.35
google.com has address 74.125.236.46
google.com has address 74.125.236.38
google.com has address 74.125.236.39
google.com has address 74.125.236.33
google.com has address 74.125.236.37
google.com has address 74.125.236.32
google.com has address 74.125.236.34
google.com has address 74.125.236.41
google.com has address 74.125.236.36
google.com has address 74.125.236.40
google.com has IPv6 address 2404:6800:4007:800::1004
google.com mail is handled by 30 alt2.aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.

 

PING :

    ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (``pings'') have an IP and ICMP header, followed by a struct timeval and then an arbitrary number of ``pad'' bytes used to fill out the packet.

     # ping -c 5 google.com    

PING google.com (74.125.236.67) 56(84) bytes of data.
64 bytes from maa03s05-in-f3.1e100.net (74.125.236.67): icmp_seq=1 ttl=54 time=29.4 ms
64 bytes from maa03s05-in-f3.1e100.net (74.125.236.67): icmp_seq=2 ttl=54 time=28.7 ms
64 bytes from maa03s05-in-f3.1e100.net (74.125.236.67): icmp_seq=3 ttl=54 time=29.3 ms
64 bytes from maa03s05-in-f3.1e100.net (74.125.236.67): icmp_seq=4 ttl=54 time=29.2 ms
64 bytes from maa03s05-in-f3.1e100.net (74.125.236.67): icmp_seq=5 ttl=54 time=28.8 ms

--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4030ms
rtt min/avg/max/mdev = 28.757/29.136/29.442/0.348 ms

Sunday, 27 October 2013

Install or Upgrade Firefox 24 on CentOS

Install or Update Firefox 24 on CentOS :

 

   Mozilla Firefox 24 is released and this is guide, howto install or upgrade Firefox 24 on CentOS 6.4/6.3/6.2/6.1/6 using YUM. Firefox 17 ESR (Extended Support Release) is currently available on CentOS 6.4/5.9 and Red Hat (RHEL) 6.4/5.9 own repos, so with this guide you can also install Firefox 17 ESR on CentOS 5.9.

What’s new in Firefox 24 :

  • Mixed content blocking enabled to protects users from man-in-the-middle attacks and eavesdroppers on HTTPS pages
  • Implemented Close tabs to the right
  • Social: Ability to tear-off chat windows to view separately by simply dragging them out
  • Performance improvements on New Tab Page loads
  • Improved and unified Browser console for enhanced debugging experience, replacing existing Error console
  • Security fixes   

1. Backup your current Firefox old profiles:  

     tar -cvzf $HOME/mozilla-firefox-profiles-backup.tar.gz $HOME/.mozilla/firefox/

 

2. Change root user :     

     su                
 
     password ******* 
 

3. Install Remi repository :   

     rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm 

     rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 


5. Update or Install Mozilla Firefox :  

     yum --enablerepo=remi update firefox

     yum --enablerepo=remi install firefox
 
 

Happy Browsing ...... 

Powerful VIM commands

About Vim text editor :

    Vim is initially as standard GUI text editors like Gedit or word processors like OpenOffice.org's Writer, over a longer term you can become more productive using Vim. If you're a touch-typist, you'll find that your speed will improve even more with Vim because your hands rarely need to leave the ^home^ keys, and you'll only need to use the mouse if you choose to do so.

If you're a programmer or working with structured markup languages like HTML, LaTeX, etc., Vim is the bee's knees. It offers a number of features that make working with programming and markup languages much easier.




Some of the useful VIM commands :  

:e filename ---------------------------- OPen finename for edition
:w               ---------------------------- Save file
:q                ---------------------------- Exit Vim
:w!              ---------------------------- Write fine and quit
/word         ----------------------------- Search word from top to bottom

?word        ----------------------------- Search word from bottom to top
Ctrl+a        ---------------------------- Increment number under the cursor
Ctrl+x        ---------------------------- Decrement number under cursor
Vu              ----------------------------- Lowercase line
VU             ------------------------------ Uppercase line

:e .             ------------------------------ Open integrated file explorer
:Sex           ------------------------------ Split window and open integrated file explorer
:browse e  ------------------------------ Graphical file explorer
:ls              ------------------------------- List buffers
:cd ..          ------------------------------- Move to parent directory

:set autoindent -------------------------Turn on auto-indent
:args          ------------------------------- List files
:tabnew     ------------------------------- Creates a new tab

>>             ------------------------------- Indent
<<             ------------------------------- Un-indent




Happy coding..

Friday, 25 October 2013

Installing RecordMyDesktop on CentOS

 Installing RecordMyDesktop on CentOS

   recordMyDesktop is a desktop session recorder for Linux
that attemps to be easy to use, yet also effective at it’s primary task.
As such, the program is separated in two parts; a simple command line tool that performs the basic tasks of capturing and encoding and an interface that exposes the program functionality in a usable way.

Link for Downloading the source code:

http://sourceforge.net/projects/recordmydesktop/files/recordmydesktop/

Steps to install :

step 1 : install the dependencies

yum install gcc make libXext-devel libSM-devel libICE-devel zlib-devel            libXfixes-devel libXdamage-devel libvorbis-devel libtheora-devel                           

 Step 2:


wget http://downloads.sourceforge.net/project/recordmydesktop/recordmydesktop/0.3.8.1/recordmydesktop-0.3.8.1.tar.gz


 Step 3:


         tar xf recordmydesktop-0.3.8.1.tar.gz


        
          cd recordmydesktop-0.3.8.1


         ./configure


          make


          make install


 thats it.. You have done it..


start it by giving the command

         recordmydesktop


for more options how to use and help. type,

         recordmydesktop –help