Skip to content

Instantly share code, notes, and snippets.

View techmaniack's full-sized avatar

Karim Memon techmaniack

View GitHub Profile
@techmaniack
techmaniack / bash_top_ten_commands.sh
Last active October 7, 2015 15:08
One liner to show the top ten commands used on the system
This one-liner will read the ~/.bash_history file and give the top ten most frequently used commands
$ cat ~/.zsh_history \
| cut -f2 -d ";"\
| cut -f1 -d " "\
| awk '{c [$1]++}END{for(j in c)print j,""c[j]""}'\
| sort -hr -k2\
| head \
| column -t
@techmaniack
techmaniack / rails_installation_ubuntu
Created March 31, 2012 12:11
Setting up RAILS on Ubuntu
STEP 1:
$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev \
sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison \
subversion mustang
STEP 2:
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
@techmaniack
techmaniack / fifRC.rb
Created February 10, 2012 12:17
fifRC (fetch it from RailsCast)
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
source = "http://feeds.feedburner.com/railscasts"
content =""
open(source) do |s| content = s.read end