Linux Tutorial

Time Stamps in BASH HISTORY

By default, History logs the time when you ran a command, but doesn’t display it. The reason for this is when you run the History command, it looks for an environment variable called HISTTIMEFORMAT, which tells it how to format time. If the value is null or not set, then by default it doesn’t show any time. But that’s not all. Since […]

Failover and Load Balancing using HAProxy

HAProxy is open source proxy that can be used to enable high availability and load balancing for web applications. It was designed especially for high load projects so it is very fast and predictable, HAProxy is based on single-process model. In this post I’ll describe sample setup of HAProxy: users’ requests are load balanced between […]

Limit CPU usage of Linux process

cpulimit is a small program written in C that allows to limit CPU usage by Linux process. Limit is specified in percentage so it’s possible to prevent high CPU load generated by scripts, programs or processes. I found cpulimit pretty useful for the scripts running from cron, for example I can do overnight backups and […]

10 Useful Linux Commands

Search for all files modified in the last N days containing a specific text in their name find DIR -mtime -N -name “*TEXT*” For example: find ~ -mtime -5 -name “*log*” Will display all the files modified in the past 5 days which include the text ‘log’ in their filename. Determine which processes use the […]

The 7 Deadly Linux Commands

If you are new to Linux, chances are you will meet a stupid person perhaps in a forum or chat room that can trick you into using commands that will harm your files or even your entire operating system. To avoid this dangerous scenario from happening, I have here a list of deadly Linux commands […]

Setting Up Subversion (SVN) with SSH (svn+ssh)

  Setting Up Subversion (SVN) with SSH (svn+ssh) This is a quick guide on how to setup subversion using svn+ssh. svn+ssh lets us tunnel a subversion session over the secure SSH protocol, which means all data and passwords are encrypted. I like setting subversion up this way because: it authenticates against a real user account, so […]

Install SUBVERSION on CentOS

  First, download and install RPMForge from here. Once your RPMForge installed, open this file /etc/yum.repos.d/rpmforge.repo and change the value of enabled=1 to enabled=0 * This is to disable rpmforge from yum and you can enable it when you need later Now, enter the command below $ yum –enablerepo=rpmforge list available | grep subversion and […]

Install Subversion with Web Access on Ubuntu

  installing subversion with the apache module so that it can be easily accessed from other systems on a public network. If you want a more secure svn server, you could use svnserve+ssh, which isn’t covered in this article. To install subversion, open a terminal and run the following command: sudo apt-get install subversion libapache2-svn […]

Encrypted Partitions over LVM with LUKS

  This tutorial was done using an Ubuntu 8.04 livecd, but the process should be approximately the same with other distros. 1. Getting started: Boot up your PC from a live CD and make sure you choose “Try ubuntu without installing”. Once the desktop is loaded, start a terminal and get root credentials: $ sudo […]