Linux
Colorize Make, GCC and Diff’s Output
Generally, output is more readable when it has colors to allow you distinguish between warnings, errors and progress logs.
Using colormake, colorgcc and colordiff, you can have the output of make, gcc, diff (respectively) coloured.
To install in Ubuntu:
sudo apt-get install colorgcc colormake colordiff
You might want to use aliases to override the normal make/gcc/diff commands.
Original tip from here.
Send Self Reminders To Your Email From The Command Line
The following will allow you to send self reminders/TODO items to your Email at a specific time.
For example, if you want to remind yourself to submit an assignment at 15:20, you’ll be able to run this command to do it:
tdr “submit assignment” 15:20
This will send an Email to you, with the subject: [TODO] submit assignment. Email will be sent at 15:20.
To be able to do this, you migh need to configure your mail command (see my post about this).
Then, add this function to your ~/.bashrc file (or any file sources in bashrc):
Mount ISO Images From the Command Line
To mount an ISO image from the linux command line:
sudo mount -o loop image_file.iso /path/to/mount/folder
Via Tips4Linux
Modify Ctrl-Alt-Del Behavior in Linux
I hate the Ctrl-Alt-Del combination, maybe because it reminds me of the unpleasant days when I used other operating systems. If you want to modify it, then here is how to do this:
In Ubuntu
Open the file /etc/event.d/control-alt-deleteĀ (You need supper user privileges)
You should see a line similar to this:
exec /sbin/shutdown -r now “Control-Alt-Delete pressed”
Which binds ctrl-alt-del to rebooting your computer. Change it to execute any other program you want. Of course you can disable it completely by commenting the whole file.
Removing Control Characters From a Text File in Linux
A few weeks ago, I had a text file generated in widows, and it had the “^M” control character at the end of each line. I had to compare it with a similar file generated on my Linux machine (using diff), and because of these control characters it failed diff.
The first step was to check why diff failed. Normally, you cannot see these control characters, and one might be surprised that the comparison fails thought the files are exactly the same. In order to see these characters, one should use “-A” flag with the cat command:
Add Colors to Your Manpages
I use the manpages a lot. Manpages are a very useful database of information for linux users and developers. The problem with them is that their appearance becomes boring after a while.
I already wrote a post about reading them from firefox, so they’re displayed in a nice way as html pages.
In this post we’ll add colors to the manpages viewed from inside the shell.
First, open your ~/.bashrc file. To open it with gedit you can type:
gedit ~/.bashrc
View the Manpages in Firefox
A cool way to view manpages in linux: View them as html (with color) in firefox.
First, you need to install a program called man2html. Doing this in Ubuntu is as easy as opening a terminal and typing:
sudo apt-get install man2html
Now, that you have this program installed, open your firefox.
Take Screenshots in Linux with “scrot”
I have found this tool recently, and I have no idea how I was able to manage without it before.
This tool allows you to capture any region of your screen, by selecting it with your mouse, clicking on the title-bar of a window and other methods. It’s very flexible and contains many options.
To download the program in Ubuntu:
sudo apt-get install scrot
Now, open a new text file and type this
Todo.txt – A simple yet powerful todo manager for Linux
Recently, I discrovered todo.txt, a great todo list manager for people who feel comfortable with Linux’s command line.
The greatness of this tool is in its simplicity: the whole todo list is saved as plain text, and operations like adding/removing/prioritarizing/modifying/listing items are done through a very simple command line interface supplied in a bash script.
Printing with Color to a Linux Console
A few days ago, I wanted to print colored strings from C++ to Linux terminal. I made a small research in the web and found a simple way to do this.
It’s possible to format the foreground color, background color and other display settings by printing a certain string to your terminal. This feature is implemented in the terminal itself, and is not programming language dependent.
The magic string is of this format:
About Me
Tags
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)
