Skip to content

Instantly share code, notes, and snippets.

@akheron
akheron / gist:909386
Created April 8, 2011 06:21
Default rsyslog configuration for Ubuntu 10.04
We couldn’t find that file to show.
@akheron
akheron / elasticsearch.log
Created June 13, 2011 07:18
ElasticSearch log
[2011-06-13 07:16:25,881][INFO ][node ] [Lasher] {elasticsearch/0.16.2}[17950]: initializing ...
[2011-06-13 07:16:25,887][INFO ][plugins ] [Lasher] loaded []
[2011-06-13 07:16:31,009][DEBUG][monitor.os ] [Lasher] Using probe [org.elasticsearch.monitor.os.JmxOsProbe@7846a55e] with refresh_interval [5s]
[2011-06-13 07:16:31,009][DEBUG][monitor.process ] [Lasher] Using probe [org.elasticsearch.monitor.process.JmxProcessProbe@3c10e820] with refresh_interval [5s]
[2011-06-13 07:16:31,028][DEBUG][monitor.network ] [Lasher] Using probe [org.elasticsearch.monitor.network.JmxNetworkProbe@1fd4340c] with refresh_interval [5s]
[2011-06-13 07:16:31,042][DEBUG][monitor.network ] [Lasher] net_info
host [t-inoi-demo]
eth0 display_name [eth0]
address [/fe80:0:0:0:216:3eff:fe62:15c8%2] [/10.105.0.78]
mtu [1500] multicast [true] ptp [false] loopback [false] up [true] virtual [false]
@akheron
akheron / couchdb_test.ini
Created October 5, 2011 06:38
Standalone CouchDB configuration for running a test server
# couchdb -a couchdb_test.ini >couhdb_stdout.log 2>couchdb_stderr.log
[couchdb]
database_dir = MY_TEMP_DIR/couch
view_index_dir = MY_TEMP_DIR/couch
[httpd]
port = MY_PORT
bind_address = 127.0.0.1
@akheron
akheron / gitconfig
Created October 31, 2011 13:17
Git aliases and hooks for CPython workflow
# Aliases for working with a hg-git enabled mercurial repository in .git/hg
[alias]
hg-dir = "!echo ${GIT_DIR:-.git}/hg"
hg-run = "!hg -R $(git hg-dir)"
hg-git-dir = "!echo $(git hg-dir)/.hg/git"
hg-git-branch = "!f() { [ \"$1\" = default ] && echo master || echo \"$1\"; }; f"
hg-update-bookmarks = "!git hg-run branches | while read branch rev rest; do target=$(git hg-git-branch $branch); rev=$(echo $rev | sed -r \"s/([0-9]+):.*/\\1/\"); git hg-run bookmark -f -r $rev $target; done"
hg-delete-bookmarks = "!git hg-run bookmarks | sed -r 's/[[:space:]]+(.+?)[[:space:]]+.*/\\1/' | xargs -n 1 git hg-run bookmark -d"
hg-hg2git = "!git hg-update-bookmarks && git hg-run gexport"
hg-git2hg = "!git hg-delete-bookmarks && git hg-run gimport"
@akheron
akheron / .gitconfig
Last active September 28, 2015 05:38
My .gitconfig
[alias]
st = status --short --branch
dc = diff --cached -M -B -C
typo = commit --amend
fixup = commit --amend --no-edit
logk = log --graph --pretty=\"format:%C(yellow)%h%C(red)%d%Creset %s %C(green)%an, %ar%Creset\"
ffpull = pull --ff-only
ffmerge = merge --ff-only
ri = "!f() { rev=$(git rev-parse $1 2>/dev/null) || rev=HEAD~$1; git rebase -i $rev; }; f"
rc = rebase --continue
/* JavaScript progress bar
*
* Reads the percentage value from the content of an element and
* replaces it with a progress bar.
*
* Example:
*
* <span class="progress">100 %</span>
* <script>
* $('.progress').progressbar();
@akheron
akheron / salacomplete.sh
Created January 2, 2012 07:28
bash completion for sala
#!bash
_sala() {
local IFS=$'\n' dir=${SALADIR:-.} cur
if ! type _get_comp_words_by_ref >/dev/null 2>&1; then
cur=${COMP_WORDS[$COMP_CWORD]}
else
_get_comp_words_by_ref cur
fi
@akheron
akheron / python-tracker-stats.py
Created May 18, 2012 07:42
Python tracker statistic plotter
# Search for statistic messages from the Python trakcer robot in
# python-dev archives and plot the result.
#
# $ python-traker-stats.py collect
#
# Collects statistics from the mailing list and saves to
# python-tracker-stats.json
#
# $ python-tracker-stats.py plot
#
@akheron
akheron / mailcap
Created May 24, 2012 10:44
mailcap for text/html alternatives in mutt
# Open in browser when viewing interactively
text/html; /usr/bin/sensible-browser '%s'; description=HTML Text; nametemplate=%s.html
# Dump with w3cm and the correct encoding when viewing non-interactively
text/html; /usr/bin/w3m -dump -T text/html -I %{charset} -O utf-8 %s; copiousoutput; description=HTML Text; nametemplate=%s.html
# Support non-standard image/jpg, too
image/jpg; display 'jpeg:'%s''; test=test -n "$DISPLAY"
@akheron
akheron / postactivate
Created May 29, 2012 05:31
virtualenvwrapper hooks for sala
#!/bin/bash
# This hook is run after this virtualenv is activated.
export SALADIR=/path/to/passwords
. /path/to/sala/contrib/sala-completion.bash