Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Monday, 19 September 2011

9 Cool SSH Tricks You May Not Know

If you are running a website, even if it is a blog, chances are, you might have used SSH at least once. SSH stands for Secure SHell. When you use SSH, the communication and data transfer between the local machine and the remote machine occurs in a secure encrypted tunnel. So no one will be able to snoop on your data.
Read more »

Friday, 8 July 2011

GIMP For Photos - A Collection of Tutorials For Photo Editing In GIMP

I love using GIMP. It is a worthy replacement to the mighty Adobe Photoshop (at least for tweaking images meant for the web). I have been using GIMP for quite a while now. And chances are any or all images you see on this blog have been opened in GIMP for manipulation and making them fit for posting on the Web.

There is a lot that can be done using GIMP software. In fact, this Free image editor has become so popular that numerous books on GIMP have been published.

Read more »

Tuesday, 5 July 2011

JavaScript Language Advanced Tips And Tricks

Today I came across a fabulous trove of JavaScript tips and tricks. These are code snippets in JavaScript language. There are 100s of them all on a single page.

Check out the tips and tricks on JavaScript. If your job involves writing code in JavaScript, this set of tips are worth being bookmarked.

PS: To try all the JavaScript examples (code snippets), you can use a standalone JavaScript engine such as Rhino, Jhost, or SpiderMonkey. While on the topic of standalone programs that execute JavaScript code, do check out a list of other JavaScript engines.

Wednesday, 30 September 2009

Handy Tips To Be More Productive Using GIMP

GIMP logo
GIMP - also known as the GNU Image Manipulation Program - is well known as an excellent graphics editor. Many people even consider it as useful as Adobe Photoshop for creating images for the web. I have been using GIMP for a long time now and have used it for such tasks as screen capturing, optimizing images, retouching photos, scaling images, special effects and so on. GIMP is available for multiple platforms including Windows, Linux, and Mac OS X. Why, GIMP is even available as a portable application  which allows you to run it directly from a USB pen drive.

The following are a few handy tips which will help you be more productive in GIMP.
Read more »

Monday, 19 January 2009

Linux Commands - 10 Useful tricks for Admins

I have heard a saying - the one thing which sets apart a Linux administrator Guru from a Novice is how much more the former is able to accomplish with so few keystrokes. I do not know the veracity of that saying. But IBM Developerworks has - as usual, put together a collection of tricks which will help raise the efficiency of any system administrator by a notch or two. I am no Guru, nor am I a novice. I guess I fall somewhere in the grey areas between the two extremes, which makes reading the tricks really informative for me.

Among the tricks described are Linux commands which we seldom use such as - fuser, reset, screen, as well as invaluable tips like - resetting the root password, SSH back door entry, using VNC to SSH tunnel to a remote machine, checking your bandwidth, a couple of command line tricks, spying on the console and finally Random system information collection.

Read the article to learn more.

Saturday, 10 January 2009

Linux Screen Command Revisited

Screen is a command line tool which allows you to manage several interactive shell instances within the same window. Put in simpler terms, screen command allows you to have the same functionality of tabs - but in a console. Red Hat magazine is running a very useful and informative article to installing and using GNU screen on Linux. The article is written by Steve ‘Ashcrow’ Milner and Anderson Silva. Read the article.

Thursday, 4 September 2008

Browse the Web in Konqueror using only the keyboard

KDE Konqueror is much more than a file manager. It is also a standards compliant web browser. Here is a neat trick to surf the web sans the mouse - that is, using just your keyboard.

Fire up Konqueror in Linux, FreeBSD or what ever OS you are running that has KDE installed. Konqueror usually opens in File browsing mode. Type in the address of the website you wish to view, in the Address bar - for instance http://linuxhelp.blogspot.com and press Enter key.

Here is the interesting part ... Once the website loads itself, tap on the 'Ctrl' key once to activate the "Access Keys" and Konqueror will label each link in the web page with unique alphabetic characters. You can follow the link in the web browser by just tapping the corresponding character associated with the link.

Tapping once more on the 'Ctrl' key will deactivate the "Access Keys".

How is that for mouse free web browsing ? To get an idea of how it looks on screen, view the following screenshot...

Fig: Active Keys enabled in Konqueror

Friday, 23 May 2008

Power sessions with Screen

Screen is a full-screen window manager for the console, that comes with every flavour of Linux and UNIX. It is best known for multiplexing a physical terminal across several processes. By using it, you can run any number of console-based applications within a single terminal.
For example, suppose I want to run the 'top' program to keep track of the system load, edit my programming code and check my mail at the same time ... Usually, I have to open at least 3 terminals to do all this. But by using the screen utility, I can run all these programs at the same time in the same physical terminal. Another great feature of this wonderful utility is its ability to decouple the terminal emulator from the running program, which ensures your job is running even if you accidentally close your window, or in case you log out. After detaching, you can reconnect once again to the same session and regain control over the running jobs.
Here I will explain how to use this utility.
1) First open a terminal (eg: xterm if you are in X windows) and type :
$ screen
2) Screen starts and creates a new single window with a shell, pretty much like what you had before. The path name of the shell is taken from the $SHELL variable. New windows can be created within the same physical terminal using the screen commands.
3) Now that you have started screen in a terminal, suppose you want to run the 'top' program to check the System load and at the same time you want to compile a program too - Also you would like to switch between the two to see the progress made by both.
For that, first execute the first program to be run (say 'top'). now 'top' will start in the terminal.
Now open a new window in screen by pressing the '[Ctrl + a] c' - which I will state as 'C-a c' . This will create a new window in the same terminal. Here, you can give commands to compile your program.
In screen, each window is given a unique identifier. The first window is numbered 0, the next window is 1 and so on. Now to switch between your 'top' and the compiling program, you can use the key 'C-a 0' and 'C-a 1' respectively.
You can also associate names with each running window - use 'C-a A' to give a name to the current window.
Here are a few other commands that might come in handy while toggling between various running windows :
  • 'C-a p' and 'C-a n' can be used to switch to the next or previous window respectively.
  • 'C-a N' - where N is the number from 0 to 9, that can be used to jump to the corresponding window.
  • 'C-a w' displays a list of all windows. The unique ID of each window with its name and running process is displayed, for each window. The current window is marked with an asterisk(*).
  • 'C-a k' - can be used to kill the current window. You can also type 'exit' to kill the current window. If no more windows are open, then screen exits. 'C-a \' also does the same thing.
  • 'C-a d' - detaches the present screen session. You can also detach by closing the terminal running your screen utility. Though, this appears to close your terminal session, in reality this does not happen. It only unbinds your session from the current terminal. All the programs started under screen will still keep running.
You can also log out from the machine and re-login. Then start any terminal session and type 'screen -r' to once again be connected from where you left.
In case, there were more than one screen sessions running on the machine, Screen prompts for a host.tty.pid.
For example, say I have two screen sessions. So when I type 'screen -r' command, it gives the following message:
$ screen -r
There are several suitable screens on:
2999.pts-6.localhost (Detached)
1920.PTS-6.localhost (Detached)
Type "screen [-d] -r [pid].tty.host" to resume one of them.
Choose the proper tty.host to connect to and you are controlling your program again. You can also share your screen session with others like using VNC . Imagine you are having a problem with your code and want to share it with your boss who is located in another office. You can use screen to share your session with your boss, and he can see what you are referring to. The first user starts his screen in a normal fashion and executes the following commands ...
User1:
[Ctrl-A]:multiuser on [RET]
[Ctrl-A]:acladd
The second user starts a new screen session and connects it to the first session using ...
User2:
screen -x
There are lots and lots of features in Screen other than those that were described here. To know more about Screen, visit the Official Screen Home Page. You can also find a very good introductory tutorial at Kuro5hin.org.

Sunday, 4 May 2008

Guide to adding a new partition or drive to an existing system

Suppose you are required to create a 10 GB partition on your server running Linux, you have got two options namely :
  • Create a partition from the unpartitioned space on your machine or
  • Add a new drive.
If you are opting for the latter then it is a simple thing of plugging in the new drive, letting the system detect it, using a partitioning tool to create the requisite partition, formating the newly created partition and finally mounting it. But if it is the former namely, creating a partition from unpartitioned space, then the task gets a bit trickier.

Joey Prestia explains the exact steps needed to add a new partition to an existing system. The task can be broken down into the following steps :
  1. Determine what partitions need to be created and where.
  2. Create the partitions (I use 'fdisk' here but any Linux disk partitioning tool should work)
  3. Re-read the partition table either with 'partprobe' or by a reboot
  4. Make a filesystem on the partition, label it, and create the necessary mount points
  5. Add the appropriate entries to '/etc/fstab' so the partitions are mounted upon reboot
Check out Joey's notes to know the exact commands used to accomplish the above tasks.

Enable DVD playback in Ubuntu

I am sure any Ubuntu user will swear by the fact that it is a piece of cake getting multimedia to work in Ubuntu. In fact Ubuntu walks a fine line in ensuring that the users who are passionate about freedom and those who are keen on functionality are provided for.

But playing encrypted DVDs is a bit trickier. Tech-recipes.com provides a simple way of enabling DVD playback in Ubuntu.

In fact there are just two simple steps namely,
$ sudo apt-get install totem-xine libxine1-ffmpeg libdvdread3
and
$ sudo /usr/share/doc/libdvdread3/install-css.sh

Linux file system hierarchy - the fun easy way

I have been asked by many people to explain the file system hierarchy in Linux because they find the file system in Linux quite different from what they are used to in Windows. To put it simply, it can be visualized as a tree with its roots and all. At the top of the hierarchy is invariably the root path which is represented by '/'. All other directories are created beneath this root path. And each of the sub directories have a specific purpose. For example, '/etc' contain the configuration files, the '/opt' directory is used to install third party software, '/boot' contain the grub files and the Linux kernel and so on.

Today I came across this very beautiful image which explains the Linux file system in lucid detail at linuxconfig.org.

Fig: Linux file system hierarchy

Thursday, 17 April 2008

The 7 Habits of Highly Effective People who are Linux Users

I once read a book called "7 Habits of Highly Effective People" by Stephen Covey which explains the qualities that a person has to imbibe to be highly successful in life. It is a great book which provides inspiration to people to act and make positive changes in their lives.

Guess what, Rami Taibah has compiled a set of 7 habits that Linux users can use to be highly effective which makes a great read. The list goes as follows :
  1. Never login as root - This is redundant if you are using a Linux distribution such as Ubuntu which uses sudo to elevate a user temporarily to super user mode. Nevertheless a valid point.
  2. Properly name your files - I usually stick with that but even if you have spaces in the names of your files, bash completion helps you in getting the names of the files right.
  3. Place /home in its own partition - I concur with that wholeheartedly. Read this article to know more about partitions.
  4. Proper crash management - Use xkill and the likes to close a misbehaving application.
  5. Try out multiple distributions - You have got a whole lot of them to choose from.
  6. Brush up your command line skills - Learn to use command line tools to accomplish complex tasks. It is a big time saver. Don't forget to pick up some bash scripting skills on the way.
  7. And finally, always be ready to unleash the power within - in other words experiment.

Monday, 11 February 2008

Python scripts vs Bash scripts in Linux

Almost all Linux users who are at least familiar with bash shell commands will be at home in writing simple bash scripts to automate tasks. For those who do not know how to write a bash script, here is how you do it.

Open a new file in your favorite text editor and save it in any name of your choice but with the extension .sh. For example, let us name it 'myfirstscript.sh' . The 'sh' file extension is not mandatory but is a nice way for us to later remember that this file is a script.

Now in this file (myfirstscript.sh), enter the following line.
#!/usr/bin/bash
This line should always be entered the first thing in any bash script you create. It lets the shell know where to find the bash program. In some Linux distributions the bash command is located at /bin/bash. When in doubt, use the 'which' command to find the location as follows :
$ which bash
/usr/bin/bash
# Continuation of the above script ...
# Now lets enter a few commands in this script ...
ls -l
sleep 2
who
sleep 2
w
Nothing spectacular here. Note that 'sleep' is used to pause the execution process for certain time in seconds. Next fire up a console (xterm, gnome-terminal ...) and set the executable bit for the script myfirstscript.sh as follows :
$ chmod u+x myfirstscript.sh
This lets you execute the script by its name as follows :
$ ./myfirstscript.sh
All this may seem easy. But you can get added benefits if you substitute 'bash' with Python language to write your scripts. Noah Gift provides compelling reasons to pick up Python programming language skills and start writing your scripts in this language. If you do not know Python language and is looking for some direction then you should look at the two books Core Python programming and Python phrasebook which will give you a head start in mastering this powerful but easy to learn language.

Sunday, 16 December 2007

Steps to install gOS on Ubuntu Gutsy Gibbon

I am sure by now you have heard of the gPC loaded with gOS via various news sources. For those in the dark, gPC stands for green PC which is a sub $200 PC which comes loaded with a customized version of Ubuntu known as gOS or in popular parlance called Google OS.

If you look carefully, you will find that gOS is a customized version of Enlightenment desktop and contain links to popular online services like the Google docs, Gmail, Facebook, Blogger and so on. All that a user of gOS has to do to access these online applications is, ensure his machine is connected to the Internet and double click on the respective icons. Of course apart from these online services, gOS also contain almost all applications that are standard fare in any Linux distribution.

Here is the interesting part... it is possible to install gOS on your Ubuntu Gutsy Gibbon Linux machine by following a couple of simple steps. In other words you can install the heavily customized enlightenment window manager which is the base of the gOS using the following steps...

Fig: gOS desktop running in Ubuntu Gutsy Gibbon

Fig: About gOS dialog box

First open up your /etc/apt/sources.list file which lists all the repositories and append the following two lines to it.
$ sudo vi /etc/apt/sources.list
# FILE: /etc/apt/sources.list
...
# Adding gOS repositories
deb http://packages.thinkgos.com/gos/ painful main
deb-src http://packages.thinkgos.com/gos/ painful main
In the terminal enter the command to import the public key of the repository so that the signatures could be verified as follows :
# wget http://www.thinkgos.com/files/gos_repo_key.asc
# sudo apt-key add gos_repo_key.asc
Next update your apt cache database using the command :
$ sudo apt-get update
To install the necessary files which will allow you to run gOS on Ubuntu, run the following apt-get command :
$ sudo apt-get install greenos-desktop
I already had enlightenment (e17) window manager (WM) installed on my Ubuntu machine so it was a mere 11 MB download for me. If you do not have enlightenment WM, then apt-get will have to download and install that too which could hike your download size by around 35 MB.

Once installed, you can select gOS/Enlightenment from sessions option in your login screen.

Fig: gOS module settings dialog box

It is worth noting that the gOS that is thus installed is devoid of the Google branding namely the desktop icons to Google services; which are conspicuous in their absence. So the name gOS in this case could be a misnomer.

Having used gOS for some time now, I am sufficiently impressed on the color and theme preferences. While I found the default theme of Enlightenment not that good, I find the gOS theme quite elegant and pleasing to the eyes. At the same time you also get all the features that are available in Enlightenment which includes transparency, shadows, animation on the desktop and many usability features which can make your desktop experience all the more comfortable and productive.

Sunday, 2 December 2007

BASH tips and tricks

Ever since I started using Linux, BASH has been the shell of my choice. Though I have used numerous other shells like Korn Shell, Bourne shell (which is the default shell in Unix), C shell and so on. Bash is actually an acronym for Bourne Again SHell.

Richard Bradshaw who is a teacher at a school in United Kingdom has put together a page detailing some of the common annoyances he has encountered while using BASH and ways of overcoming them.

As a recap, do take a look at some of the previous articles related to BASH shell on this blog such as ...

BASH shell shortcuts,
10 seconds guide to BASH scripting,
BASH completion,
Making your BASH scripts user friendly,
Quick editing of a command and
BASH FAQ ... just to name a few.

Sunday, 18 November 2007

Over 10 power user tips for Vim editor

After using Vi or Vim for a couple of days, ever been left wondering what is it that makes Vi enthusiasts sing eulogies of this geeky text editor ? Then here are a number of reasons which will make you wonder why you hadn't embraced Vim sooner.

Swaroop C H has compiled over 10 specific ways to improve your productivity with Vim. These are the same functionality he found in Emacs and for which he provides equivalent commands in Vim.

The tips include :
Swapping caps-lock and Control keys, using incremental search for navigation, Making better use of the buffers in Vim, mastering vim regular expressions and picking up fine grained text manipulation commands in Vim among many others.

Most of the settings he lists can be made permanent by entering them in your .vimrc configuration file which resides in your home directory in Linux. Of course, if you are still putoff then there is another project called Cream for Vim which will save the day for you.

Apart from providing the power user tips, he also lists some additional plugins which further extends the functionality of this wonderful editor. Do read his tips to know more.

Thursday, 15 November 2007

Migrate your custom domain email to Gmail

Google is slowly but surely laying out a plethora services with the customers or end users in mind. Seriously, I will really be at a loss to list all the services that Google provides - there are that many. What really sets Google apart from the pack crowd is its obsession with simplicity and customer comfort in mind. Any day, I would rather use a clean, spartan Google interface to the ad infested slow loading mishmash of a webpage put together by its competition.

Here is yet another interesting service from Google you might be interested in. The service is called Google Apps and it allows those with their own domain to move their entire mail infrastructure to Google.

Daniel Miessler has an interesting take on how he accomplished moving all his mail from his web host to Google all the while keeping his mail id the same ie in the format mail [at] dmiessler.com.

Google provides its Google Apps in three editions depending on the number of features you need. The standard and education edition are provided for free and has pretty much all the features that a small business or an individual needs. But if you want more then they also provide a premium edition for which they charge a nominal $50 per year.

Tuesday, 30 October 2007

So you want to be a System Administrator ? Here is how ...

What is the job profile of a System administrator ? Obviously he is in charge of managing the servers and making them work flawlessly. But is that it ?

Ask a person like James Hicks who has over 10 years experience working as a system administrator and he will tell you there is a lot more to the job than just managing servers.

But lets start from the beginning; what does it take for a fresher to land a job as a system administrator ? First and foremost, you need three things namely, Intelligence, an interest in Computers and last but not the least people skills.

James has written a 3 part series [ Part 1, Part 2, Part 3 ] providing insights into the art of snagging, managing and thriving as a system administrator which is a worthy and informative read. He even gives his personal opinion about the various certifications in the market and their worthiness.

An excerpt from the article :
Good systems administrators in good companies spend the bulk of their time preventing bad things from happening and finding new ways for IT to improve their organization’s efficiency. Bad systems administrators or good ones in bad companies spend the bulk of their time fixing problems that come up - usually the same problems over and over again.

Friday, 26 October 2007

A problem encountered by laptop users running Ubuntu Gutsy Gibbon and a possible solution

A number of people are blogging about how running the latest version of Ubuntu Gutsy Gibbon on a laptop could possibly end up causing an early demise of the laptop hard disk. The problem is that the hard disk essentially consists of a spindle and a bunch of disks stacked one on top of the other which rotate at high speeds. Now as with all objects which have moving parts, hard disk also faces wear and tear. The problem faced by Ubuntu laptop users is the aggressive use of hard disk by Ubuntu thus shortening the life of the hard disk.

A bug submitted at launchpad confirms this anomaly. So what is the solution to this rather irritating problem ?

Use hdparm; a command line tool to disable advanced power management (APM). This is achieved by running the following command :
$ sudo hdparm -B 255 /dev/sda
Here the -B option is used to set the APM value. A low value means aggressive power management (that translates to more wear and tear for your hard disk) and a high value means better performance (but more battery consumption). By setting the value as 255, we have disabled the APM all together. Over 2 years back, I had written an article explaining how to improve your hard disk performance using hdparm. And if you are interested in knowing more about hdparm, you may read the article.

I run Ubuntu Gutsy Gibbon and it doesn't cause this problem on my desktop PC.

Check out the opinions from two sources [ linux hero and Planet Beranger ] to get a different angle.

Tuesday, 23 October 2007

Install multimedia codecs in Ubuntu 7.10 Gutsy Gibbon in 2 easy steps

Ubuntu is a fantastic Linux distribution and its development is right on track. While I have had issues in running Ubuntu 7.04, Feisty Fawn on my machine, the latest release namely version 7.10 (Gutsy Gibbon) turned out to be a heck of a distribution. Not only does it work flawlessly on my machine, the Ubuntu developers have also incorporated a number of features which brings it at par with or in some cases even excels Mac OSX in functionality and ease of use.

But at the same time, unlike many other Linux distributions (read Mandriva et al), the Ubuntu developers have not succumbed to providing the proprietary codecs and drivers out of the box. In fact, they have walked a fine line by making sure the distribution remains Free as in freedom, at the same time have made it very simple for people who want to surely install any proprietary drivers for their machine.

For example, here is how you can install all the proprietary multimedia codecs automatically on your machine running Ubuntu Gutsy Gibbon.

First thing you have to do is to navigate in the Gnome panel to "System -> Administration -> Software Sources" and enable all the additional repositories namely main (which should already be enabled), universe, restricted and multiverse. Truth be told, you need select only the multiverse repository but while you are at it, you might as well enable the rest of them too.

Once you have done that, navigate to your video or audio file and try playing it in Totem which is the default multimedia player for GNOME. When you open the media file in totem, it will notify you that it can't find the necessary codecs to play the file and will offer to search for and download the necessary files. It will then start downloading the missing pieces and install them. That is it. You have finished installing the codecs necessary to play your multimedia file.

Fig: Enable all additional repositories


Fig: Totem asks you whether it should search for the necessary codecs to play the media.


Fig: Totem searching for required multimedia codec packages


Fig: It provides a list of packages which contain the required files


Fig: Asks for confirmation.


Fig: Totem playing the movie after it finished installing the required codecs.

As a side note, I have found that this is the same process that is followed by the Windows media player when it can't find the necessary codecs. But there is a significant difference though, in Ubuntu Gutsy Gibbon, this process works flawlessly where as in Windows, it gives an error ;-).

Alternately, if you do not want to go through the above process (though I wonder why), you can also install all the multimedia codecs by firing up a terminal and running the apt-get command as follows :

$ sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg gstreamer0.10-fluendo-mp3 gstreamer0.10-plugins-ugly
You must be wondering, if there are bad and ugly gstreamer plugins there should be the good ones too right ? Well the good gstreamer plugins are installed by default on your Ubuntu machine and so you need not install them manually.

Finally, for the brave at heart, you can also install the multimedia codecs manually as explained in this article.