Skip to content

Instantly share code, notes, and snippets.

View pythonicrubyist's full-sized avatar

Ramtin Vaziri pythonicrubyist

View GitHub Profile
@pythonicrubyist
pythonicrubyist / convert_ubuntu_mint_to_ruby_dev_env
Last active November 29, 2016 10:59
Converting Ubuntu 12.04 LTS or LInux Mint 13 into a Ruby Developer’s Environment
# Installing RVM and Ruby:
sudo apt-get install curl
\curl -L https://get.rvm.io | bash -s stable --ruby
echo 'source $HOME/.rvm/scripts/rvm' >> ~/.bashrc
source ~/.bashrc
rvm requirements
rvm install 1.8.7-p371
rvm install 1.9.3-p125
rvm --default use ruby-1.9.3-p125
@pythonicrubyist
pythonicrubyist / handy_linux_commands
Created October 30, 2013 16:30
Handy Linux Commands
ls *.txt | wc -l | tee /dev/tty count.txt
@pythonicrubyist
pythonicrubyist / convert_ubuntu_mint_to_python_dev_env
Last active December 29, 2015 00:59
Converting Ubuntu 12.04 LTS or LInux Mint 13 into a Python Developer’s Environment
sudo apt-get install python-pip
sudo apt-get install python-setuptools
sudo apt-get install python-dev
sudo apt-get install build-essential
sudo pip install virtualenv
sudo pip install virtualenvwrapper
sudo echo 'export WORKON_HOME=$HOME/.virtualenvs' >> ~/.bashrc
sudo echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bashrc
@pythonicrubyist
pythonicrubyist / setting_up_python_data_analysis_environment_on_ubuntu_linux
Last active March 28, 2021 03:11
Setting up a Python Data Analysis Environment on Ubuntu LTS 12.04 or Linux Mint 13.
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
sudo apt-get install python-matplotlib
sudo pip install numpy
sudo pip install pandas
sudo pip install scipy
sudo pip install patsy
sudo pip install matplotlib
sudo pip install jinja2
@pythonicrubyist
pythonicrubyist / gist:7683298
Created November 27, 2013 21:14
TCP Network Traffic Monitor in Linux
udo apt-get install tcptrack
sudo tcptrack -i eth0 -f
@pythonicrubyist
pythonicrubyist / gist:7683471
Created November 27, 2013 21:23
Enabling Full-Screen Mode in Ubuntu on Oracle VirtualBox
sudo apt-get install dkms build-essential linux-headers-generic
# On virtual machine’s menu bar on top, click on Device/Install Guest Additions. This will launch a unix script runing on the Ubuntu terminal.
sudo reboot
@pythonicrubyist
pythonicrubyist / linus_process_management
Created December 12, 2013 17:37
Linux Command for Process Management and Network Monitoring
# List all processes dynamically, q to close top, k to kill a process
top
# Displays processes in tree format
pstree
# Display all running processes owned by the current user
# ps aux
# Find a process
@pythonicrubyist
pythonicrubyist / nil_empty_blank_present_ffdierence_in_ruby
Last active February 21, 2024 17:38
Difference between nil?, empty?, blank? and present? in Ruby and Ruby on Rasils.
# nil? can be used on any Ruby object. It returns true only if the object is nil.
nil.nil? # => true
[].nil? # => false
{}.nil? # => false
"".nil? # => false
" ".nil? # => false
true.nil? # => false
# empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero.
nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass
@pythonicrubyist
pythonicrubyist / delete_git_commit
Created February 25, 2014 18:43
Deleting the last Git commit
git reset --hard HEAD~1
git push origin HEAD --force
@pythonicrubyist
pythonicrubyist / ruby_env_setup_on_os x_mavericks
Last active August 29, 2015 14:01
Ruby Development Environment Setup on OS X Mavericks
# Instlled Xcode, Github and Sublime Text 3 by runing their installation packages.
git config --global user.name "Your Full Name"
git config --global user.email "Your Email Address"
# Homebrew Installation:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile