Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
# will start a multithreaded instance of the local installation | |
# for ubuntu/debian users | |
# apt-get install lighttpd php5-cgi | |
echo "Locating php-cgi :" | |
if which php-cgi; then | |
php_cgi_path=$(readlink -f `which php-cgi`) | |
else | |
exit 1 | |
fi |
#!/usr/bin/env python | |
"""Use inotify to watch a directory and execute a command on file change. | |
Watch for any file change below current directory (using inotify via pyinotify) | |
and execute the given command on file change. | |
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done` | |
has many issues which are fixed by this tools: | |
* If your editor creates a backup before writing the file, it'll trigger multiple times. | |
* If your directory structure is deep, it'll have to reinitialize inotify after each change. |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
From "Smart Pre-Fetching: Varnish @ Yakaz.com by Pierre-Gilles Mialon, Yakaz.com"
Use varnish as a memcached with HTTP interface. Push data updates directly into the cache without having to buffer them outside varnish and pulling them through a backend.
" from https://github.com/spf13/spf13-vim/blob/master/.vimrc | |
if has('statusline') | |
set laststatus=2 | |
" Broken down into easily includeable segments | |
set statusline=%<%f\ " Filename | |
set statusline+=%w%h%m%r " Options | |
set statusline+=%{fugitive#statusline()} " Git Hotness | |
set statusline+=\ [%{&ff}/%Y] " filetype | |
set statusline+=\ [%{getcwd()}] " current dir | |
set statusline+=%#warningmsg# |
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |