Skip to content

Instantly share code, notes, and snippets.

@cooka
cooka / hack.sh
Created April 3, 2012 16:57 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cooka
cooka / proxy.pac
Created April 13, 2012 04:09 — forked from ayanamist/proxy.pac
My Pac File for Auto Proxy
var PROXY = {
"direct":"DIRECT",
"goagent":"PROXY 127.0.0.1:8087",
"vps":"PROXY 127.0.0.1:8123",
"edu":"PROXY 127.0.0.1:4080",
"sogou":"PROXY 127.0.0.1:8083",
"adblock":"PROXY 127.0.0.1:8080",
"tele":"PROXY 127.0.0.1:4480"
};
var DEFAULT = PROXY['sogou'];
@cooka
cooka / semtex.c
Created July 11, 2013 07:25 — forked from onemouth/semtex.c
/*
* linux 2.6.37-3.x.x x86_64, ~100 LOC
* gcc-4.6 -O2 semtex.c && ./a.out
* 2010 sd@fucksheep.org, salut!
*
* update may 2013:
* seems like centos 2.6.32 backported the perf bug, lol.
* jewgold to 115T6jzGrVMgQ2Nt1Wnua7Ch1EuL9WXT2g if you insist.
*/
@cooka
cooka / flask-upload
Created December 28, 2015 18:24 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@cooka
cooka / 0_reuse_code.js
Created January 19, 2016 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cooka
cooka / shadowsocks-server.service
Last active March 3, 2016 10:14 — forked from dorentus/shadowsocks-server.service
wget 'https://gist.githubusercontent.com/dorentus/10704239/raw/shadowsocks-server.service' -O /etc/systemd/system/shadowsocks-server.service && systemctl enable shadowsocks-server.service && systemctl start shadowsocks-server.service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/server.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks
@cooka
cooka / gist:3c3e8c5c1acc8fd5697b1ecd237f41fb
Created April 4, 2016 17:49 — forked from mendelgusmao/gist:5823291
BTSync / BitTorrent Sync behind nginx
# take one
# subdirectory (one server, multiple services)
location /btsync/ {
rewrite ^/btsync/gui(.*) /btsync$1 last;
proxy_pass http://127.0.0.1:8888/gui/;
proxy_redirect /gui/ /btsync/;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@cooka
cooka / gist:063a7d8993abb9d71085418a2ee70133
Created November 3, 2016 17:03 — forked from jaxbot/gist:5748513
Block nginx from serving .git directories
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@cooka
cooka / pdns-pipebackend.py
Created November 3, 2016 17:18 — forked from sokratisg/pdns-pipebackend.py
PowerDNS PipeBackend python example
#!/usr/bin/python -u
import sys, os, time
import random
class DNSLookup(object):
"""Handle PowerDNS pipe-backend domain name lookups."""
ttl = 30
@cooka
cooka / guide.md
Created November 11, 2016 12:42 — forked from vothanhkiet/guide.md
HA-Proxy for Portainer

HA-Proxy configuration for Portainer

Here is a working configuration for HA-Proxy version 1.6.6 2016/06/26 to serve Portainer at portainer.127.0.0.1.xip.io :

global
    maxconn                     10000
    daemon
    ssl-server-verify           none
    tune.ssl.default-dh-param   2048