Skip to content

Instantly share code, notes, and snippets.

View rriveras's full-sized avatar

Roberto Rivera rriveras

View GitHub Profile
@rriveras
rriveras / gist:432534
Created June 10, 2010 03:48
ROR environment installation in a fresh Ubuntu (10.04)
# ROR environment installation in a fresh Ubuntu (10.04)
# Latest stable ruby (1.8.7)
sudo apt-get install irb libopenssl-ruby libreadline-ruby rdoc ri ruby ruby-dev
# Install Rubygems
cd /usr/local/src
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz
tar xzvf rubygems-1.3.6.tgz
cd rubygems-1.3.6
sudo ruby setup.rb
# Create a local branch, push and then clone the branch. With this,
# you can make a branch local and remote with tracking
git branch experimental
# Now, push this new local branch to remote repo
git push origin experimental
# Check if the new branch was created in the remote repo
git branch -r
# This added your local branch to remote repo, but without tracking. To do that,
# delete your local branch. Note that we gonna delete our local branch
# WITHOUT merging changes, so it's very important to use the capital D in the argument
@rriveras
rriveras / console_kill_service
Created June 22, 2011 20:37
Just kill services managed by launchd in OSX
sudo kill -9 <PID>
@rriveras
rriveras / install_nokogiri_for_osx.sh
Created August 5, 2011 15:49
Quick way to install nokogiri and dependencies in OSX Snow Leopard
# installation of libxml 2.7.7 or later
brew install libxml2
brew link libxml2
# install libxslt from source
# download the source
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
# unzip the source
tar -zxvf libxslt-1.1.26.tar.gz
# move to the unzipped folder
@rriveras
rriveras / OSX_launchctl_unload.txt
Created September 5, 2011 20:46
Stop a process in OSX loaded via launchctl
launchctl unload -w ~/Library/LaunchAgents/com.danga.memcached.plist
# MYSQL import, this let you know where it goes the import by
# looking what is the last table that print
mysql -uroot mydatabase_development -A
show tables;
# UNIX command and tricks
# Search string in directory
# ref: http://stackoverflow.com/a/16957078
grep -rnw --exclude-dir=node_modules . -e "string-pattern"
# Find who is using some port, in this example, the port is `3000`