This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build source distribution | |
python setup.py sdist | |
# build wheel distribution | |
python setup.py bdist_wheel | |
# register with pypi test server | |
python setup.py register -r test | |
# configure your .pypirc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# crossplatform, poor compression, fast | |
zip -r archive_name.zip path/to/compress | |
# extract zip in current directory | |
unzip archive_name.zip | |
# compress with tar, poor compression, very fast | |
tar cvf archive_name.tar path/to/compress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dump database dbname to dbname.dump | |
pg_dump -Fc --data-only --disable-triggers dbname > dbname.dump | |
# restore database dbname to dbname from dbname.dump | |
pg_restore -U username -h hostname.com --disable-triggers -d dbname dbname.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# document.domain is commented by default, change it to our domain and uncomment it, this will edit file in place | |
sed -i "s/\/\/ document.domain = 'moxiecode.com';/document.domain = 'example.com';/" path/to/tiny_mce/tiny_mce_popup.js | |
# note that in order to get this working on os x, you must pass argument to -i | |
# this will save unedited copy of tiny_mce_popup.js as tiny_mce_popup.js.tmp | |
sed -i ".tmp" "s/\/\/ document.domain = 'moxiecode.com';/document.domain = 'example.com';/" path/to/tiny_mce/tiny_mce_popup.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove all temporary build files | |
sudo port clean --all installed | |
# remove all inactive ports | |
sudo port -f uninstall inactive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run mail | |
# delete single message by its id | |
d 6 | |
# delete messages using range of ids, from 1 to 20 | |
d 1-20 | |
# you must quit properly in order to delete messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo killall -HUP mDNSResponder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote set-url origin git://new.url.here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "*.pyc" -exec rm {} \; |