Friday, 19 July 2013

Collection of Useful Linux Commands - Part 1

This is the beginning of a series of (infinite?) posts with collections of some of the most awesome Linux commands you will ever find! They can help you you do almost any kind of task on your system.

sudo apt-get install linux-headers-`uname -r` Install Linux Kernel Headers on Debian-based systems Install the Linux kernel headers for currently running kernel version on Debian-based systems via apt-get
sudo shutdown 3600 -P Wait a moment and then Power off You can easily stop shutdowning process by CTRL+C
openssl aes-256-cbc -salt -in secrets.txt -out secrets.txt.enc AES file encryption with openssl To decrypt: openssl aes-256-cbc -d -in secrets.txt.enc -out secrets.txt.new. Reference: http://tombuntu.com/index.php/2007/12/12/simple-file-encryption-with-openssl. Optional parameter -a makes output base64 encoded, can be viewed in text editor or pasted in email
source ~/.bashrc Make changes in .bashrc immediately available Any changes to BASH shell made in .bashrc will be active in the current terminal window from the moment you execute this command, ie. aliases, prompt settings etc. No need to restart terminal. (In BASH 'source' simile to 'eval' lets you generally execute any bunch of commands stacked in a text file).
perl -e '$|++; while (1) { print " " x (rand(35) + 1), int(rand(2)) }' Binary digits Matrix effect Silly Perl variant.
set str=user_pref("browser.startup.homepage", "http://www.fcisolutions.com/"); cd = "%APPDATA%\Mozilla\Firefox\Profiles\*.default\" echo %str%>>prefs.js Change the homepage of Firefox Pros: Works in all Windows computers, most updated and compatible command.
Cons: 3 liner. Replace fcisolutions.com with your site name.
read -s pass; echo $pass | md5sum | base64 | cut -c -16 Create strong, but easy to remember password Why remember? Generate! Up to 48 chars, works on any unix-like system (NB: BSD use md5 instead of md5sum) 
echo ".mode tabs select host, case when host glob '.*' then 'TRUE' else 'FALSE' end, path, case when isSecure then 'TRUE' else 'FALSE' end, expiry, name, value from moz_cookies;" | sqlite3 ~/.mozilla/firefox/*.default/cookies.sqlite get cookies from firefox useful to use after with the --load-cookies option of wget 
firefox -P <profile_name> -no-remote Simultaneously running different Firefox profiles After running "firefox -ProfileManager" (without quotes, obviously)
Stay tuned for next part :)

0 comments:

Post a Comment

All Articles © Asit. No Copying. Powered by Blogger.
 
Copyright © . The Tech Veda - Posts · Comments
Markup Powered by Bluefish Editor 2.2