Posts

Showing posts with the label linux

aria2: An Ultra Fast Download Manager On Linux

Image
Introducing one of the fastest download managers in the universe: aria2. Introduction aria2 is a brutally fast and very feature rich download manager available for Linux platform. It can handle almost any kind of download you can ever imagine (FTP, HTTP, BitTorrent, SFTP, ...). You can install it by simply running sudo apt-get install aria2 at the command line or by using Ubuntu Software Center (if you're on Ubuntu). How To Use First add the following line at the bottom of your .bashrc (or .bash_profile depending on your distro). alias aria2c='aria2c -c -x5 -s10 -m0' This practically replaces the original aria2c command with a pre-configured one that tries to resume the download in case of a disconnect or failure for each download establishes up to 5 simultaneous connection to the server downloads a file using 10 connections/segments retries indefinitely in case of failure to connect to the server Remember to close the terminal and open a new one, for this ch...

A Tale Of King and Evil or How I Made Peace With Ubuntu!

Image
In which I tell how Ubuntu won my trust back. Once Upon A Time... I used to be a fairly happy Ubuntu user from 2008 to 2011 (shh! I was a faithful FreeBSD and KDE 3 user before that). I could concentrate on my job and my desktop didn't get in my way. I didn't spend any of my time trying to configure things the sane way. A Kingdom Without An Heir But things changed by the double blow of Gnome 3 and Unity. Introduced at almost the same time, they ruined my IT life and destroyed my productivity. Seriously. Only gods know, how many hours (instead of happily coding) I spent fiddling Gnome 3 or Unity to have a responsive desktop that behaved like a desktop is supposed to: not get in my way! I switched to Ubuntu Gnome to find myself unsatisfied, and then back to KDE 4, and despite it being really cool, found it not for my type. Then tried XFCE and quickly learned it was a mistake. The Era Of Pain And Chaos This state of distress pushed me to the point that for almost 7 months I ...

Command Line Options: How To Parse In Bash Using “getopt”

Image
Use “getopt” in a Bash script to parse long and short command line options, enforce arguments for some options and spot dubious user input. Most of the times, when you need to automate system administration tasks on your Linux machine, writing a Bash script is your best bet. And sometimes, you need to be able to control the behaviour of your script at some point which leaves you with two choices: use environment variables (set before running the script) as sort of a flag or the better and more intuitive way to use command line arguments. What is "getopt"? getopt is a program that parses command line options in shell scripts. It is the enhanced version of older getopts and uses the getopt C library to do its job. It is compatible with getopts as long as GETOPT_COMPATIBLE environment variable is set, however some of it best features are not available in compatibility mode. An overview of command options Command line input is viewed in 3 categories by getopt: short ...

How To Batch-set Environment Variables

Learn how to automatically (dump) set environment variables defined in a file. Sometimes you have a file (usually called .env or .environment ) with dozen of environment variables defined and you have to set those variables before running a command --for example this happens in Django projects with a .env file for settings. The solution is easy: export $(cat ENVIRONMENT_FILE | xargs) && YOUR_COMMAND

How To Setup A Fossil Server

Image
Fossil is a light-weight DVCS that can be easily used on the web through the brilliant web server nginx. Introduction If you've ever done professional software development, you already know that it is not possible without source control and issue tracking software. In this article, you will see how easy it is to setup a fully working Fossil DVCS server on a CentOS machine. FreeBSD users may find this guide (external) more useful. Installing Fossil To be able to use the latest Fossil version, we're going to install it from the source. Installing compile-timed requirements Fossil can use zlib and openssl (for HTTPS access). It can also be extended through a pseudo-macro mechanism using Tcl scripting language. Install all of them to enable all features -don't worry! They require only a tiny space and don't drag in a jungle of dependencies. # yum install zlib zlib-devel tcl tcl-devel openssl openssl-devel Compiling and installing fossil Obtain Fossil source from Fos...