Skip to content

Instantly share code, notes, and snippets.

@mt3
mt3 / gist:2781226
Created May 24, 2012 12:17 — forked from axelav/linux-directory-structure.md
Quick summary of Linux directory hierarchy

Linux directory heirarchy

/bin binaries, basic Linux commands are here
/boot boot code, leave it be
/dev all devices/hardware, all treated as a stream
/etc config files & resources, only root user can modify
/home user account info & personal files
/lib shared library files essential for binaries
/lost+found stray files that can be recovered after a crash
/media mount points for removable media
@mt3
mt3 / gist:2781208
Created May 24, 2012 12:14 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mt3
mt3 / add_users.py
Created April 14, 2012 04:58 — forked from imlucas/add_users.py
Using Amazon Cloudsearch with Python and Boto
from cloudsearch import connect_cloudsearch, get_document_service
endpoint = 'paste your doc service endpoint here'
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection
# Presumably get some users from your db of choice.
users = [
{
'id': 1,
@mt3
mt3 / taskpaper .vimrc
Created April 8, 2012 11:04 — forked from narbs/taskpaper .vimrc
Adds "@done YY-MM-DD" to taskpaper notes edited in Vim
:fu! Taskpaper()
:return setline(line("."), getline(line(".")) . "@done(" . strftime("%Y-%m-%d") . ")")
:endf
:map <F11> <ESC>:call Taskpaper()<CR><ESC>
:imap <F11> <ESC>:call Taskpaper()<CR><ESC>
@mt3
mt3 / backup.sh
Created March 26, 2012 15:06 — forked from karussell/backup.sh
Backup ElasticSearch with rsync
# TO_FOLDER=/something
# FROM=/your-es-installation
DATE=`date +%Y-%m-%d_%H-%M`
TO=$TO_FOLDER/$DATE/
echo "rsync from $FROM to $TO"
# the first times rsync can take a bit long - do not disable flusing
rsync -a $FROM $TO
# now disable flushing and do one manual flushing
@mt3
mt3 / icwsm.py
Created March 20, 2012 06:40 — forked from jhofman/icwsm.py
script to scrape pdfs and paper info for icwsm2011
#!/usr/bin/env python
from lxml import etree
from urllib import urlopen
if __name__=='__main__':
url = 'http://www.aaai.org/ocs/index.php/ICWSM/ICWSM11/schedConf/presentations'
tree = etree.parse(urlopen(url), etree.HTMLParser())
@mt3
mt3 / mann-quix.txt
Created March 13, 2012 07:27
Merlin Mann's Custom Quix Commands
> Merlin Mann's Custom Quix Commands
> TITLE: mann-quix-d.txt
> REMARKS: Hello, world. Under construction. Dilute! Dilute!
> GITHUB: http://gist.github.com/290059
> MORE: http://quixapp.com
> UPDATED: 2010-02-07_13-07-54
@Merlin Mann's Custom Quix Commands
@May organize these better once they all stabilize
bit javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://bit.ly/bookmarklet/load.js');document.body.appendChild(e);void(0); Make a bit.ly link
cal javascript:var%20s;if(window.getSelection){s=window.getSelection();}else{s=document.selection.createRange().text;}var%20t=prompt('Please%20enter%20a%20description%20for%20the%20event',s);if(t){void(window.open(encodeURI('http://www.google.com/calendar/event?ctext='+t+'&action=TEMPLATE&pprop=HowCreated%3AQUICKADD'),'gcal'));}else{void(s);} Add event to Google Calendar
#!/bin/zsh
# Copyleft 2010 paradoxxxzero All wrongs reserved
# With contribution from James Ahlborn
# https://gist.github.com/752727
# Fork of https://gist.github.com/586698 by nicoulaj / dingram / roylzuo ...
# From http://www.zsh.org/mla/users/2010/msg00692.html
# Token types styles.
# See http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#SEC135
@mt3
mt3 / uninstall_homebrew.sh
Created September 26, 2011 06:56 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
cd `brew --prefix`
git ls-files -z | pbcopy
rm -rf Cellar
bin/brew prune
pbpaste | xargs -0 rm
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
@mt3
mt3 / fabfile.py
Created August 21, 2011 14:12 — forked from onyxfish/fabfile.py
Chicago Tribune News Applications fabric deployment script
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"