Linux
Bash is the default scripting language in most Linux systems. Its usage ranges from an interactive command interpreter to a scripting language for writing complex programs. Debugging facilities are a standard feature of compilers and interpreters, and bash is no different in this regard. In this article, I will explain various techniques and tips for debugging Bash scripts.
Read more
Submitted by Ayman on Mon, 2009/08/24 - 10:48pm
Keeping a version history of files under /etc is essential for maintaining a healthy system. The benefits of tracking changes to /etc include:
- Documentation: The log messages that are attached to configuration changes serve as documentation. These log messages record who made the change, when and why. Understanding the contents of a config file becomes much easier if you have a full history of the changes that were made to this file.
- Troubleshooting: Misconfiguration can result in a variety of problems. When a service starts to misbehave, one of the things you can do to troubleshoot the issue is to check the version history of its config file. There, you can see if any changes were made around the time frame in which the problem happened. If you spot a change that may be causing the issue, you can easily revert it to fix the problem.
You can set up your own repository to track changes to /etc, or you can use a tool called etckeeper to handle the setup for you. This tool supports multiple version control systems, including Git, Mercurial and Bazaar. It integrates with the package management systems of a number of Linux distros, including APT (used by Debian, Ubuntu), YUM (RedHat, CentOS, Fedora), Pacman (Arch Linux). Using etckeeper instead of rolling your own has some advantages:
- etckeeper integration with package managers means than you don't need to manually commit changes in
/etc after installing packages.
- etckeeper comes pre-configured with a list of files that live in
/etc but usually do not benefit from version control (like some cache files).
Read on to learn how to install, configure and use etckeeper.
Read more
Submitted by Ayman on Sun, 2009/08/16 - 6:01pm
screen is one of my favorite GNU utilities; it provides a quick and easy way to have several open terminals and do multiple things at once. Another cool feature about screen is that it stays running even if the user logs out or disconnects. This enables the user to detach from their session and resume it later. This feature is a life saver when working on a remote machine through SSH. If I was disconnected for some reason, I can easily reconnect and resume my session.
screen is very easy to use. Below is a list of its main commands. Read on, experiment with them, and you will become proficient in screen in minutes. Believe me you will appreciate it.
Read more
Submitted by Ayman on Sun, 2006/09/17 - 8:03pm
Vim is one of the most popular text editors for Linux and Unix systems. Its text-based interface may look intimidating for newcomers, but underneath it there is a wealth of functionality to be learned. Experienced Vim users often feel much more productive using Vim than GUI-based text editors.
I've been using Vim on a daily basis for years to do a wide range of tasks, from casual editing of short text files, to managing large programming projects, and every now and then I come across a new feature that considerably helps in some aspect of text editing. For this reason, I decided to compile a list of such Vim tips in this post.
Read more
Submitted by Ayman on Thu, 2006/09/07 - 6:37pm
While waiting for ADSL to be enabled in my area, which (I've been told) will happen soon, I did some tinkering with my Gentoo Linux workstation to make it more protected against remote attacks, and I thought of compiling a list of security measures against the dangers of full-time Internet connection. Obviously the list is not complete, but it has tips that can surely help.
Read more
Submitted by Ayman on Sun, 2006/03/05 - 3:44pm
Here is a quick tip for Firefox users under Linux. If you find loading the current text in clipboard as a URL when middle-clicking on the current page annoying, then type about:config in the location bar, search for middlemouse.contentLoadURL and set it to false.
This feature may has some uses, but many times I middle-click somewhere other than a link, and Firefox tries to load whatever text in the clipboard as a URL. Since that the text won't an actual URL most of the time, Firefox loads a random website that is the result of a Google "I feel lucky search", which is very annoying!
Submitted by Ayman on Fri, 2006/01/27 - 8:05pm
Just got Revolution OS (IMDB). I've seen its trailer on The OpenCD. It seemed very interesting. Time to watch the whole thing now.
For those who don't know, Revolution OS is a documentary on Free Software and Open Source. It features interviews with many famous people from the Open Source movement.
Submitted by Ayman on Mon, 2004/12/27 - 9:19pm