Skip to content

Instantly share code, notes, and snippets.

View awnion's full-sized avatar
🦀
🦀

Sergei Blinov awnion

🦀
🦀
View GitHub Profile
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@awnion
awnion / gist:4996212
Last active December 14, 2015 00:08
My nginx.conf (base nginx config)
# Base nginx config
# See: http://habrahabr.ru/post/56497/ (russian)
user www-data;
worker_processes 2; # recommended equals to number of cores
pid /var/run/nginx.pid;
# Decrease calls of gettimeofday()
timer_resolution 100ms;
class Foo
{
public:
Foo(int j) { i=new int[j]; }
~Foo() { delete i; }
private:
int* i;
};
class Bar: Foo
@awnion
awnion / flac2mp3.sh
Created August 6, 2012 21:30
Flac2mp3 shell converter
#!/bin/bash
# You need flac and lame utils
# On OS X you can install them usung homebrew: $ brew install lame flac
for f in "$@"; do
[[ "$f" != *.flac ]] && continue
album="$(metaflac --show-tag=album "$f" | sed 's/[^=]*=//')"
artist="$(metaflac --show-tag=artist "$f" | sed 's/[^=]*=//')"
date="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')"
title="$(metaflac --show-tag=title "$f" | sed 's/[^=]*=//')"