Skip to content

Instantly share code, notes, and snippets.

# Accessing my home machine from outside world
# on AWS
sudo vim /etc/ssh/sshd_config
GatewayPorts yes
sudo /etc/init.d/ssh restart
# check connections from outside (open port 7000 if needed)
netstat -ntl
#!/bin/sh
ffmpeg -f x11grab -s 1280x720 -i $DISPLAY -f alsa -i default ~/Videos/test.mkv

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

cat ~/.ssh/id_rsa.pub | ssh -p 22 [email protected] 'cat >> ~/.ssh/authorized_keys'
git tag `date "+production-%Y%m%d%H%M%S"`
git push --tags
desc 'rolls back migrations in current branch not present in other'
task :rollback_branch_migrations, [:other_branch] do |t, args|
load "#{Dir.pwd}/Rakefile"
branch_migrations = BranchMigrations.new(args.other_branch)
puts ['Rollback the following migrations', branch_migrations, 'y,n? ']
next if %w[no n NO N].include?(STDIN.gets.chomp)
migrate_task = Rake::Task['db:migrate:down']

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Tested in Ubuntu 12: super == ctrl

Open/Goto


  • super+t: go to file
echo 1 > /sys/bus/pci/rescan
@orendon
orendon / git_tag_timestamp.sh
Last active August 13, 2024 13:45
Git tag timestamp
#git tag `date "+staging-%Y%m%d%H%M%S"`
git tag `date "+production-%Y%m%d%H%M%S"`
git push --tags
@orendon
orendon / contractions
Created April 16, 2014 04:13
contractions
2013-04-15 17:05:03 10
2013-04-15 19:10:34 20
2013-04-15 21:30:45 17
2013-04-15 22:55:00 18
2013-04-15 23:10:18 21
2014-04-16 07:02:44 10
2014-04-16 11:13:07 20
2014-04-16 11:23:00 12