Skip to content

Instantly share code, notes, and snippets.


Sandip Bhattacharya sandipb

View GitHub Profile
View gist:123032f12052520aaccab752bd3e78cc
## HTTP Router benchmarks -- Jan 9, 2019 with Go 1.11.4 on Linux X1 Carbon laptop
## This benchmark suite is based on
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
## We use the most up-to-date version of each router available in the tests below.
CJEnright / gzip.go
Last active Aug 6, 2020
Idiomatic golang net/http gzip transparent compression, an updated version of
View gzip.go
package main
import (
cimmanon /
Created May 2, 2017
PostgreSQL cheat sheet for MySQL users

I use PostgreSQL via the psql client. If you use a different client (eg. pgAdmin, etc.), I don't know how much will translate over.

One nice difference between psql and mysql (cli) is that if you press CTRL+C, it won't exit the client.

User administration

Login as superuser (via shell)

psql -U postgres
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active Aug 9, 2020
Demo of some useful tips for using Asciidoc on GitHub
View GitHub Flavored Asciidoc (GFA).adoc

GitHub Flavored Asciidoc (GFA)

vans163 /
Last active May 20, 2019
Virtualbox Commandline stuff
#Create storage
VBoxManage createhd --filename VMName.vdi --size 40000 --format VDI
VBoxManage modifyhd GoDial.vdi --resize 30500
VBoxManage list hdds
VBoxManage closemedium disk $(UUID) --delete
#Create VM
VBoxManage createvm --name "VMName" --ostype Windows7_64 --register
fntlnz /
Last active Aug 10, 2020
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
jace /
Last active May 26, 2020
Remove noise from video using sox and ffmpeg
# 1. extract audio from all videos (assuming .mp4 videos).
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done
# 2. use the first second of the first audio file as the noise sample.
sox `ls *.wav | head -1` -n trim 0 1 noiseprof
# Replace with a specific noise sample file if the first second doesn't work for you:
# sox noise.wav -n noiseprof
# 3. clean the audio with noise reduction and normalise filters.
romainl / .ctags
Last active Jul 13, 2020
My ctags config
View .ctags
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
sdague / imaway
Last active Mar 11, 2019
dbus xchat integration
View imaway
import dbus
import dbus.glib
import gobject
import subprocess
def lock():
print "Screen saver turned on"
davisford /
Created Jul 12, 2013
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
You can’t perform that action at this time.