Skip to content

Instantly share code, notes, and snippets.

Bitly tech talk 4/22/2010
On 4/22 we held a bit.ly tech talk on 'Command Line Fu', where we invited talented hackers to come share their best moves. Please correct my notes and add your fu here!
# jehiah
# in place file regex replacement
perl -pi -e 's/this/that/g' filename_pattern
# print the last column
altscreen on
attrcolor b ".I"
autodetach on
caption always "%?%F%{= Kk}%:%{=u kR}%? %h %-024=%{= Kk} %C%a %D %d %M %Y%{= db}"
defbce "on"
defflow off
defscrollback 10000
defutf8 on
escape ^``
hardstatus alwayslastline "%{= kR} %-Lw%{= Kk} %n%f %t %{-}%+Lw %=%{= dd}"
Bitly tech talk 4/22/2010
On 4/22 we held a bit.ly tech talk on 'Command Line Fu', where we invited talented hackers to come share their best moves. Please correct my notes and add your fu here!
# @jehiah
# in place file regex replacement
perl -pi -e 's/this/that/g' filename_pattern
# print the last column of a file ($NF stands for 'Number of Fields' or more commonly Last Field).
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@dknecht
dknecht / fabfile.py
Created February 18, 2010 06:41 — forked from onyxfish/fabfile.py
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
@dknecht
dknecht / .aliases
Created February 12, 2010 04:35 — forked from jlong/.aliases
# Console
alias profile="vi ~/.bash_profile"
alias ls="ls -p -G -h"
# Desktop Programs
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
alias photoshop="open -a '/Applications/Adobe Photoshop CS4/Adobe Photoshop.app'"
alias illustrator="open -a '/Applications/Adobe Illustrator CS4/Adobe Illustrator.app'"
alias preview="open -a '/Applications/Preview.app'"
alias xcode="open -a '/Developer/Applications/Xcode.app'"