Skip to content

Instantly share code, notes, and snippets.

View mre's full-sized avatar
🪴
I like plants.

Matthias Endler mre

🪴
I like plants.
View GitHub Profile
@mre
mre / gist:723d356f1dde8030a80c
Created May 13, 2014 08:43
logstash config
input {
file {
# Path to your logs
path => "/logs/*"
start_position => "beginning"
}
}
filter {
grok {
@mre
mre / redis info
Created May 22, 2014 08:27
Redis connection issues. Output of redis info
# Server
redis_version:2.8.9
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:53bb8484a594dab0
redis_mode:standalone
os:FreeBSD 9.2-RELEASE-p6 amd64
arch_bits:64
multiplexing_api:kqueue
gcc_version:4.2.1
@mre
mre / info commandstats
Created May 28, 2014 12:16
Redis commandstats
info commandstats
$1158
# Commandstats
cmdstat_get:calls=344336405,usec=1084573265,usec_per_call=3.15
cmdstat_set:calls=86516,usec=590904,usec_per_call=6.83
cmdstat_setex:calls=28000873,usec=262906699,usec_per_call=9.39
cmdstat_del:calls=4138776,usec=12168359,usec_per_call=2.94
cmdstat_exists:calls=967,usec=2135,usec_per_call=2.21
cmdstat_sadd:calls=5214906740,usec=4204169654,usec_per_call=0.81
cmdstat_srem:calls=4135644,usec=20366147,usec_per_call=4.92
@mre
mre / prot.py
Last active September 25, 2015 22:57
Prototype of a functional scripting language.
# Prototype of a functional scripting language. Just fooling around. Nothing to see here.
#
A long comment.
Very long, they say.
#
# There's only one data type: list
# Assign variables with :
@mre
mre / Apple Jobs Haiku
Created August 10, 2011 19:52
Some curiosity on Apples "Jobs" website (pun not intended).
This works:
http://jobs.apple.com/index.ajs?BID=1&method=mExternal.returnToResults&CurrentPage=143165577
This doesn't:
http://jobs.apple.com/index.ajs?BID=1&method=mExternal.returnToResults&CurrentPage=143165578
But why?
@mre
mre / closures_js
Created September 5, 2011 18:09
Closures in JavaScript
function getCtr() {
var i = 0; return function() { console.log(++i); }
}
var ctr = getCtr()
ctr() // 1
ctr() // 2
@mre
mre / dropbox-gallery.php
Created January 12, 2012 17:25
Monkeypatch to get PHP my Dropbox Gallery running with the new Dropbox Gallery.
@mre
mre / gist:5064256
Created March 1, 2013 12:14
Unexpected error: 'ascii' codec can't decode byte 0xc3 (UnicodeDecodeError)
I got this message when I tried to open a shell on my application:
$ dotcloud run www
==> Opening a shell on service (www) instance #0 (application trips)
Error: An unexpected error has occured: 'ascii' codec can't decode byte 0xc3 in position 67: ordinal not in range(128).
The remote server handling the last request was 174.129.124.156:443.
The remote timestamp was Thu, 28 Feb 2013 15:06:19 GMT.
Please try again; and if the problem persists, contact support@dotcloud.com with this information.
Adding the following to /usr/local/lib/python2.7/site-packages/sitecustomize.py fixed the error:
@mre
mre / .vimrc
Created June 24, 2013 09:44
Mac Vim text to speech. Put this into your vimrc and hit <leader>v in visual selection mode to read the selected text. Great for proof reading. ;-)
" Mac specific: Text-to-speech on selected text in visual mode
" w: Don't replace selection with command output after execution
" silent: Don't prompt for enter after execution
:vnoremap <leader>v :w<Home>silent <End> !say <CR>
@mre
mre / l33tspeak
Created January 23, 2014 00:05
Leetspeak is the ultimate weapon of every hacker. Join the force, yeah!
#!/usr/bin/python
"""
Usage from commandline:
python l33t.py "Can i haz cheezburgerz"
"""
from string import maketrans # Required to call maketrans function.
from sys import argv