Skip to content

Instantly share code, notes, and snippets.


Pedro Canterini pcanterini

View GitHub Profile
View gist:5498977

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
pcanterini / knife-solo
Last active Dec 21, 2015
Setting up server with knife solo
View knife-solo
# ssh stuff
brew install ssh-copy-id
ssh-copy-id root@server
# knife solo
gem install knife-solo
knife solo init project-name
knife cookbook create nginx -o cookbooks
knife prepare root@ip
# remember to add cookbook to json file eg: {"run_list":["recipe[nginx]"]}
pcanterini / rails-stack-script
Last active Dec 21, 2015
rails stack on ubuntu 12.04 LTS
View rails-stack-script
- create deploy user and add to sudoers
- log in as deployer
- install stack with: sudo wget --no-check-certificate && bash
- install apache2:
sudo apt-get update
sudo apt-get install apache2
- fix for rvm then install passenger
rvm remove 2.0.0
rvm autolibs install openssl
rvm install ruby-2.0.0-p247 --with-openssl-dir=$HOME/.rvm/usr
pcanterini / octopress deploy
Last active Mar 4, 2017
fix for octopress deploy - rake deploy is rejected
View octopress deploy
git clone
git checkout source
Then we need to setup the deploy directory.
mkdir _deploy
cd _deploy
git init
git remote add -t master -f origin
Done! Now we can make changes in source branch and use rake gen_deploy as usual.
pcanterini /
Created Oct 12, 2013
update ip on dnsimple
curl -H 'X-DNSimple-Token: email:account_token' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-X PUT \
View nodejs env config
// Load configurations
// if test env, load example file
var env = process.env.NODE_ENV || 'development'
, config = require('./config/config')[env]
, mongoose = require('mongoose')
View git aliases
nuke = !git branch -D $1 && git push origin :$1 ( git nuke branch name)
# Alot of these configs have been taken from the various places
# on the web, most from here
# Set the colours you can use
pcanterini /
Last active Aug 29, 2015
# Ask for the administrator password upfront.
sudo -v
# homebrew
ruby -e "$(curl -fsSL"
brew update
# taps
pcanterini / ubuntu-node-setup
Created May 19, 2015
Ubuntu nodejs git hook
View ubuntu-node-setup
# ubuntu server setup
adduser deploy sudo
# on your machine
# ssh-copy-id deploy@IPADDRESS
# ssh deploy@IPADDRESS -i yoursakeyfile
# edit /etc/ssh/ssh_config set PasswordAuthentication to 'no'
# run service ssh restart to restart ssh
You can’t perform that action at this time.