Skip to content

Instantly share code, notes, and snippets.

@smithbr
smithbr / fetch
Last active December 17, 2015 17:39
Keeping a GitHub fork updated
git clone git@github.com:user/repo.git
cd repo
git remote add upstream git@github.com:user/repo.git
git fetch upstream
git rebase upstream/master
@smithbr
smithbr / executable
Last active December 17, 2015 18:39
chmod a+x script.py
./script.py <arguments>
@smithbr
smithbr / kill
Last active December 17, 2015 19:10
sudo netstat -ap | grep <port number, pid, name, etc>
kill <pid>
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
@smithbr
smithbr / ssh-folder
Last active December 20, 2015 21:49
scp -r myfolder user@0.0.0.0:~/myfolder
@smithbr
smithbr / fabfile.py
Created August 11, 2013 14:45 — forked from fiee/fabfile.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
sudo service apache2 restart
ssh-copy-id user@remoteserver.com
@smithbr
smithbr / Install ST3 in debian
Created January 5, 2014 04:33
Install ST3 in a debian system
Go here and get the right .deb URL: http://www.sublimetext.com/3 then
$ wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3047_amd64.deb
$ sudo dpkg -i subli[TAB]
$ subl
## fix thinkpad backlight
http://www.upubuntu.com/2013/04/fix-brightness-keys-not-working-on.html
1. You can check if you have an intel card by running this command:
ls /sys/class/backlight/
2. If the returned outputs show this:
(...) intel_backlight