Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pansen
pansen / mac.sh
Created February 3, 2017 11:51
Disable bunch of #$!@ in Sierra
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@pansen
pansen / build_netatalk_wily.sh
Last active May 2, 2016 04:03
build netatalk 3.1.8 on ubuntu wily to a deb package
#!/bin/bash
# via: http://netatalk.sourceforge.net/wiki/index.php/Install_Netatalk_3.1.7_on_Ubuntu_14.04_Trusty
# added libevent option
set -e
set -x
TRACKER_VERSION="1.0"
apt-get install -y dpkg-dev devscripts \
@pansen
pansen / Vagrantfile
Last active May 1, 2016 13:54 — forked from davemkirk/Vagrantfile
Jupyter (aka IPython Notebook) Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
@pansen
pansen / gist:69fed4d3879369adc30c
Last active September 1, 2017 02:32
shell notes
# http://superuser.com/a/305141
# http://askubuntu.com/a/63203
`GZIP=-9 tar --use-compress-program=pigz -czvf foo.tgz foo`
# inspect `php5-fpm` (or anything else)
strace -E trace=open,read,write,readv,writev,recv,recvfrom,send,sendto -s 999 $(ps axu|grep php-fpm|awk ' { print $2 } ' | xargs -i echo -n ' -p {}')
# inspect the interesting parts on php-fpm on the wire (assuming its listening to port 9000 or 9001)
SELECT='port 9000 or port 9001'; CUT_AT=400; ngrep -Wbyline -dany -q "" $SELECT \
| grep -E '\[AP?\]$' -A19 \
server {
listen 80;
charset utf-8;
server_name munin.inventorum.net;
location ~ ^/munin/munin-cgi-graph/ {
fastcgi_split_path_info ^(/munin/munin-cgi-graph)(.*);
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/munin/fastcgi-graph.sock;
include fastcgi_params;
#!/bin/bash
### BEGIN INIT INFO
# Provides: munin-fcgi
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start munin FCGI processes at boot time
# Description: Start the FCGI processes behind http://munin.*/
@pansen
pansen / graylog2.init.d
Created September 17, 2013 08:57
graylog2 init.d file
#!/bin/bash
### BEGIN INIT INFO
# Provides: graylog2-server
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Start Graylog2 server
### END INIT INFO
@pansen
pansen / vz_main.nocache.js
Created October 13, 2011 09:14
vzmain !important bug?
function vz_main(){
var $intern_23 = '', $intern_32 = '" for "gwt:onLoadErrorFn"', $intern_30 = '" for "gwt:onPropertyErrorFn"', $intern_33 = '#', $intern_80 = '.cache.js', $intern_35 = '/', $intern_59 = '017B59617E6521850AB5ED4312A04DC0', $intern_61 = '07ECF1B2DE5D4CB20C390193991C15A5', $intern_62 = '0DD8610BE38436FEDB3252E32787FA5E', $intern_63 = '11601DA06D68649421A296F299EF95AC', $intern_65 = '2CDFC506AFC608B8B7510822EBDC9AA1', $intern_66 = '3C9162F339C4DA9BCBDDB16CE1B8AC3A', $intern_67 = '4AD8D1109649C66FF94B660AEDEFDBD2', $intern_68 = '4D0DEE81E4FF842DFDA22738AFB7AEC1', $intern_69 = '526BAACD58B9EB156F808117E5E256B7', $intern_70 = '71F2F91BE5784CC880601A1FB0F90C2A', $intern_71 = '723A0F7C12C5A1A11C3B05FFC00855F9', $intern_72 = '7AA8E338A09D6CF5D4A931927F04E055', $intern_73 = '8A215FE358506B877C8992133F791185', $intern_79 = ':', $intern_24 = '::', $intern_11 = '<html><head><\/head><body><\/body><\/html>', $intern_27 = '=', $intern_34 = '?', $intern_45 = 'ActiveXObject', $intern_74 = 'BAD6FE388EC17DB169