Linux Tips
more_horiz
close

on 10th May 2016 / by Anoop John
If you use Firefox for web development and also for regular browsing you would sooner or later realize that the Firefox addons that you use for web development is slowing down your browser and you would want to use a Firefox profile without any addons for your regular browsing. But if you do that and you want to use your developer tools once in a while you will usually have to close your Firefox session before you start a new session loading your development profile. Well not really. Here is how you can use two Firefox profiles simultaneously and not having to go through the command line every time. These instructions apply for Ubuntu but should probably work for other other GNU / Linux variants as well. You can start a new firefox session with a new profile by using the following command firefox --profile-manager -no-remote Now the next part is to add this as an option to the firefox icon that appears in your dashboard. For this the easy option is to edit /usr/share/applications/firefox.desktop. You can alternatively create a copy of the desktop file into your local users ~/.local/share/applications folder. vi /usr/share/applications/firefox.desktop Find the line "Actions=" under the [Desktop] section in the file and prefix "NewProfile;" to the value of the string. Then add a new section [Desktop Action NewProfile] Name=Open a New Profile Exec=firefox --profile-manager -no-remote OnlyShowIn=Unity; below the [Desktop] section. That is it. Now you should see a new option "Open a New Profile" when you right click on the firefox icon in your dashboard. Happy hacking. Firefox Ubuntu GNU Linux Linux Tips Tips and Tricks Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 08th December 2014 / by sandeep.sasikumar
If you are using GNU/Linux, you are likely to be familiar with the command line, usually Bash, which of course means that you would be working with tar archives (tape archives). The need to extract a single file from a tar archive/file is a common situation faced by bash users. Read on to know how to do it. The following commands will extract the single file from the tar, tar.gz, tar.bz2 files. To extract a single file from a tar file : tar -xvf filename.tar filename To extract a single file from a tar.gz file : tar -xvf filename.tar.gz filename To extract a single file from a tar.bz2 file : tar -xvf filename.tar.bz2 filename Here 'filename' refers to the single file that is required from the large tar, tar.gz or tar.bz2 file. Each of these commands will extract the single file needed from the large file. Linux Tips Bash GNU/Linux Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 06th March 2014 / by sandeep.sasikumar
I assume most of us are familiar with creating tar, tar.gz and tar.bz2 files. But do you know how to learn what is inside that tar file without extracting it? If your answer is "No" then you have come to the right place. The following commands can be used to list the contents of a tar, tar.gz, tar.bz2 files. These commands becomes handy when you have multiple tar files and if you are searching for a particular file or folder. To list the contents of a tar file : tar -tvf filename.tar To list the contents of a tar.gz file : tar -tvf filename.tar.gz To list the contents of a tar.bz2 file : tar -tvf filename.tar.bz2 Each of these commands will list the contents of tar, tar.gz, tar.bz2 files. Hope this helps. Linux Tips Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 01st June 2013 / by deepa.n
Backup! Backup! Backup! Always back up your Drupal site's code and database before you actually start making any changes to your site. Do you have access to the control panel? Cool! Go ahead and create a zip file of your entire site, export your db, download it to your local machine and you are done. Read on to know how to backup your Drupal site. Open up a terminal window in your Linux box and type the following commands to get it done instantly. At first create a backup directory to store the site's backup in the root folder. $ sudo mkdir backupHow to create a Mysql dump? $ mysqldump -u [username] -p[password] [dbname] > db.backup_20121004.sqlOR $ mysqldump -u [username] -p [dbname] db.backup_20121004.sqlHere is an example of how you actually use this command and your database back up will be created at the same path.E.g. mysqldump -u root -p example_db > db.backup_20121004.sql How to create a back up of Files and folders? Step 1: Compress files $ tar -zcvpf files.backup_20121004.tar.gz /backupIf the directories require root permission then try the tar command using the sudo command as follows: $ sudo tar -zcvpf files.backup_20121004.tar.gz /backupStep 2: Securely copy the back up files to your machine $ scp [filename] [username]@[host_name]:[destination_folder]OR $ scp [remote_username]@[remote_hostname]:/[path_to_remote]/[filename] [path_to_local]/[filename]For more details try this command: $ man scp in the terminal. Hope the article was helpful, please leave your feedback using the comments box below. Ubuntu Drupal Linux Tips Linux Terminal Leave a reply Your email address will not be published. Required fields are marker *
close

on 23rd November 2012 / by sandeep.sasikumar
The main purpose of a domain-name is to make the website simpler to access. It is easier for users to remember domain names rather than having to remember IP addresses of sites. But do you know that it would be quite useful to remember IPs when the domain name has expired? How would you access a site whose domain name has expired? Most people have no idea about this. This article is here to help. Consider you have a site 'www.google.com' and its domain name google.com has expired. But you know the server's IP address as 74.125.236.134. If you want to access the site with that, from a Linux machine, use the following method for that: Add the following line to the file /etc/hosts: www.google.com 74.125.236.134Here, www.google.com is the domain name and 74.125.236.134 is its IP address. Now the site should be accessible via your machine's Web Browser. System Administration Linux Tips Domain Name Leave a reply Your email address will not be published. Required fields are marker *
close

on 24th July 2012 / by sandeep.sasikumar
Most linux users are aware of the basic Linux terminal commands such as cd, ls, rm, rmdir, mkdir etc. Now let us take a look at some other commands which will help you make the best of the linux shell/terminal. 1. How to run a command in the background Majority of us will be using the mouse to start a program. To run a command in the background use '&' after typing the command. Consider you want to open 'Gimp', For opening the 'Gimp' window you just have to type command 'Gimp' in the terminal but the 'Gimp' won’t be running the background, to avoid as mentioned above use '&' sign after the command. That is 'Gimp &', Now this will run the command in the background. To understand this have a try. Open a terminal and run a command to open something which you like and try both the mentioned things ie use only the command and also use the command followed by the '&' sign to know the difference. 2. Conditional execution We have discussed about using a single '&' sign after the command now we will see what happens when we use a double '&&' sign. The '&&' sign is used to execute two commands in order. When we want to execute a command only when the other command is successfully executed. When we use two commands ie command1 and command2, and we want to execute command2 only if command1 has been executed successfully. For this we use 'command1 && command 2'. Consider an example if you want to open a workrave window if the screen sleeps for 10 seconds. Then you can set this by keeping 'sleep' as the first window and 'workrave' as the second window. sleep 10 && workrave 3. Output Redirection The term itself 'output redirection' gives its meaning is to redirect the output. The output of one command can be redirected to another file using this output redirection. This is denoted by using ' > ' sign. Consider an example, to have a file with all the directory name which are located inside the home directory of the user. We know that to list the directory contents we use ' ls ' command. And to copy the output to a file say 'file 1' we use output redirection. That is ls > file 1 Now to file named 'file 1' will have all the directory contents of the home folder, that is the output of the ls command will be written to the file named 'file 1' 4. Pipe and grep commands If you are executing the command and wants to give the commands output as the input of another command which is going to be executed, pipe will help you. Pipe is denoted by ' | '. Consider you want to list the directory contents and want to search for a directory named "x" grep comes into place to help you. Now we can see that both the commands, that is pipe and grep together is very useful, for example Consider you want to search for a directory named "x" from hundreds of sub-directories from directory named "y", then just simply type the command to search for the directory Command 1: "cd y" to open then the directory y Command 2: ls | grep x In the second command "ls" will list the sub-directories in "y" and "pipe" will send the output of ls as input to grep, and grep x will search for the directory named "x". System Administration Linux Tips GNU Linux Linux Shell Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 09th July 2012 / by Anoop John
The find command available in GNU/Linux shells is a versatile tool for finding files matching the given conditions in a folder and performing a specific action on the files found. The following command will find all files greater than 1M size in your current folder and ask you if you would like to delete the file find . -size +1M -exec rm -i {} \; The following command will find all tar.gz files greater than 1M size and ask you whether you wish to delete them. find . -size +1M -name "*.tar.gz" -exec rm -i {} \; The following command will find all tar.gz files greater than 1M size and less than 20M size and ask you whether you wish to delete them. find . -size +1M -name -size -20M "*.tar.gz" -exec rm -i {} \; Find is an extremely powerful tool. To know more check out man find and read through the full set of offerings. Linux Tips GNU Linux Linux Shell Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 04th May 2012 / by Anto
It's another Friday Morning at the office, and Sandeep's fingers are running across his keyboard at twice the speed of light (or well, at a few fractions of the speed of light). Sandeep is the new sysadmin trainee at Zyxware, and he seems tensed and in a hurry.   And there walks in Tingu, all in a jolly good mood, late as usual, humming to herself some silly version of Rebecca Black's Friday Song, adding to Sandeep's morning woes.   Tingu: Hey Sandeep..Goodie Morning!!!   Sandeep: (trying to fake a smile) Morning Tingu..   Tingu: What happened, you look so dumb today morning?   Sandeep: (the fake smile seems to have disappeared from his face) What to do, I wanna go home early today, and the very morning seems to be saying back to me, No You Wont.   Tingu: O no, the day looks as beautiful as any jolly good Friday. What are you upto today?   Sandeep: I got all this SSHing to do on these 14 new servers back and forth, to take some reports, and I'm wasting a major part of my time typing in these SSH commands and passwords.   Tingu: You could use SSH keys to make life easy, cant you?   Sandeep: I too thought of that, but these server owners dont want any keys other than theirs lying on their servers. They want their systems to remain 'untouched'.   Tingu: Hmmm...   Sandeep: (turning towards his monitor) Now that should explain why I look so dumb this morning..     Silence prevails for some time. Everything was back to normal - Sandeep at his keyboard, and Tingu checking through her mails.   All of a sudden,     Tingu: (shouts) Hey Sandeep!   Sandeep: (looking the least interested) What..   Tingu: Tried sshpass??   Sandeep: (curious) What's that?   Tingu: (eyes sparkling) Tan ta taannnnn...   Sandeep: (looking puzzled) ...   Tingu: (turns geeky) sshpass is a small linux shell utility that helps you automate your SSH logins without using SSH keys.   Sandeep: (now looking interested) How? I'm all ears..   Sandeep always knew when Tingu went into geeky mode - she takes the look of a sage whenever she did that. Reminded him of an old roommate he had at his college hostel. He couldnt hide his respect for her whenever she did that.   Tingu: (smiles) Try this at your terminal:      sudo apt-get install sshpass   sshpass -p "password" ssh username@server     Sandeep's fingers ran across his keyboard as soon as she said that. He knew when Tingu meant business, it was for good.   As soon as he typed in the commands and hit the last ENTER, Sandeep’s face lit up like fireworks.    Sandeep: Wow! This thing saves me half the time!   Tingu: (laughs) Wait. You havent seen the best part yet. Now try this:     alias server1=’sshpass -p "password" ssh username@server1’   Then to login to server1, you just have to type “server1” - that’s all! Do this for the rest of your 14 servers, and your job is all a breeze.   Sandeep: (speechless) Tingu, you saved my day!   Tingu: (laughing) O no, Linux saved your day. Linux Ish Bootiful!   Tingu gets back to her desk, humming Rebecca’s Friday Song. Though his sentiments for the song had not changed a bit, Sandeep is now all happy about Tingu and Linux and sshpass, and doesnt have the time to fight with Tingu over that.      Click here for more info on sshpass.   Do check this out and tell Tingu if sshpass saved your day as well.   If you face any difficulty getting sshpass to work for you, just pop in a comment below. Tingu would be happy to help you too. :)   Happy Linuxing!!! Linux Tips GNU Linux Linux-Ish-Bootiful Linux Shell Tingu Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 03rd April 2012 / by Anto
STATUATORY WARNING: Get ready to be Terminally Surprised (and you thought you knew programming?) It was one normal Friday Morning, and Tingu was thinking of how to spend the rest of her day, when Binny came along with sl and bb to make Tingu's day... Friday 30 March 2012 Binny: Morning * Binny has changed the chat topic to "Gibberish" Tingu: Maarning! Binny: You wanted to see me yersterday night Binny: type sudo apt-get install sl and run sl in your terminal Binny: u will be amazed Tingu: adippoli! Tingu: :D Binny: tried it out?? Tingu: first googled Tingu: then tried out Tingu: :) Binny: there are two trains Tingu: how? Binny: a smal one and then a big one Binny: man sl Binny: sl -l Tingu: :D Binny: now type bb [after a sudo apt-get install bb] Binny: u will be stunned Tingu: Am I dead? :o Binny: saw that?? Tingu: yup Tingu: Binny, you made my day! Tingu: Linux ish Bootiful!!! Do try this out! Installation notes: Use the following command to install sl and bb in one go, on Ubuntu: sudo apt-get install sl bb Running Notes: 1. You can make your Terminal run in full screen by pressing the F11 key when the window is active. 2. Make sure you have your speaker volume turned up before you run bb. :)   Come back for more of your weekly dose of Linux-Ish-Bootiful, with Tingu. :-) And Enjoy!   Good Day! ;-)   Cheers, Tingu :-) Linux Tips GNU Linux Linux-Ish-Bootiful Linux Shell Tingu Leave a reply Your email address will not be published. Required fields are marker *
close

on 21st February 2010 / by webmaster
When you you wish to run multiple services bound to different IPs possibly under different subnets from a single machine the simple way is to create multiple virtual adapters tied to a single physical card. The following instructions are for CentOS but should also work for RedHat and Fedora. You will require su/sudo access for the following steps Open terminal and go to /etc/sysconfig/network-scripts/ Run ifconfig and find the adapter that you are planning to create aliases for Run cp ifcfg-eth0 ifcfg-eth0:0 for each of the new alias replacing ifcfg-eth0:0 with ifcfg-eth0:1, ifcfg-eth0:2 as needed Open each of the new adapter configuration files ifcfg-eth0:0, ifcfg-eth0:1, etc, and edit DEVICE, IPADDR,NETMASK,NETWORK,BROADCASE to suit your requirements. Make sure that DEVICE is set to the new alias like eth0:0, etho0:1 etc. Restart network service(service network restart) and you are done. :-) System Administration Free Software Linux Tips GNU Linux CentOS Leave a reply Your email address will not be published. Required fields are marker * basil kurian (not verified) access_time 26 May 2019 - 19:03 #this command will do not permanent ifconfig eth0:1 192.168.56.70 Add new comment