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
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 |
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
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}" |
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
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). |
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
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 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
""" | |
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._ |
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
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 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
# 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'" |