Skip to content

Instantly share code, notes, and snippets.

@roflmao
roflmao / gist:5293963
Last active December 15, 2015 17:09
raspberry pi wifi keepalive script
#!/usr/bin/perl
# NAME wifi-check.pl
# AUTHOR Kronalias
# PROVIDES Checks to see if WiFi has a network IP and if not restarts WiFi
#
# CRONTAB Run wifi-check.pl every minute
# */1 * * * * /home/pi/my/scripts/wifi-check.pl >> /mnt/ramdisk/wifi-check.log
#
# HISTORY
@roflmao
roflmao / gist:5150510
Created March 13, 2013 09:24
Trying to build awesant from last master with debuild.
root@wheezybuild64:~/hest/awesant# debuild -us -uc
This package has a Debian revision number but there does not seem to be
an appropriate original tar file or .orig directory in the parent directory;
(expected one of awesant_0.7.orig.tar.gz, awesant_0.7.orig.tar.bz2,
awesant_0.7.orig.tar.lzma, awesant_0.7.orig.tar.xz or awesant.orig)
continue anyway? (y/n) y
dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package awesant
dpkg-buildpackage: source version 0.7-1
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@roflmao
roflmao / logstash.conf
Created January 30, 2013 10:24
grep filter logstash y u no wrk
input {
stdin { type => "stdin-type"}
# syslog {
# type => syslog
# port => 5544
# }
tcp {
port => 10514
type => "syslog"
if (beresp.status >= 500) {
set beresp.saintmode = 60s;
std.log("XX: i haz 5xx! " + beresp.status + req.url);
return(restart);
}
if( req.url ~ "^/login" || req.url ~ "^/widget" ){
return (pass);
}
else {
unset req.http.Cookie;
return(lookup);
}
# fpm --gem-gem /usr/bin/gem1.9.1 -s gem -t deb --verbose multi_json
Trying to download {"level":"info","gem":"multi_json","version":null}
Fetching: multi_json-1.3.6.gem (100%)
Using gem file {"level":"info","path":"/var/lib/gems/1.8/cache/multi_json-1.3.6.gem"}
Successfully installed multi_json-1.3.6
1 gem installed
Setting from flags: epoch= {"level":"info"}
Setting from flags: iteration= {"level":"info"}
Converting gem to deb {"level":"info"}
Package name includes underscores, converting to dashes {"level":"info","name":"rubygem-multi_json"}