Skip to content

Instantly share code, notes, and snippets.

@javouhey
javouhey / gist:9613313
Created March 18, 2014 03:58
DNS processes on Ubuntu Precise
root 29647 955 0 20:55 ? 00:00:00 /sbin/dhclient -d -4 -sf /usr/lib/Netwo
rkManager/nm-dhcp-client.action -pf /var/run/sendsigs.omit.d/network-manager.dhclient-w
lan0.pid -lf /var/lib/dhcp/dhclient-3d71b7b9-8639-475d-8791-01fb1c9140a7-wlan0.lease -c
f /var/run/nm-dhclient-wlan0.conf wlan0
nobody 29652 955 0 20:55 ? 00:00:00 /usr/sbin/dnsmasq --no-resolv --keep-in
-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-ma
nager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf -
-cache-size=0 --proxy-dnssec
@javouhey
javouhey / gist:9589569
Last active August 29, 2015 13:57
#golang parse video time spec on CLI
const (
mylayout = "15:04:05"
)
t2, _ := time.Parse(mylayout, "23:59:59") // (EXTRA time.Time=0000-01-01 23:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "3:59:59") // (EXTRA time.Time=0000-01-01 03:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "03:59:59") // (EXTRA time.Time=0000-01-01 03:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "13:59:59") // (EXTRA time.Time=0000-01-01 13:59:59 +0000 UTC)
t2, _ = time.Parse(mylayout, "1:59:59") // (EXTRA time.Time=0000-01-01 01:59:59 +0000 UTC)
@javouhey
javouhey / gist:9589455
Created March 16, 2014 20:31
K46 vidtools / virtualbox precise
ffmpeg version 0.10.11-7:0.10.11-1~precise1 Copyright (c) 2000-2014 the FFmpeg developers
built on Feb 6 2014 16:53:05 with gcc 4.6.3
configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect
--extra-version='7:0.10.11-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr
--enable-bzlib --enable-libdc1394 --enable-libfreetype
--enable-frei0r
--enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv
--enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl
--enable-postproc --enable-libcdio --enable-x11grab --enable-libx264
@javouhey
javouhey / gist:9588607
Last active August 29, 2015 13:57
K46 vidtools / amd64
Source: http://ffmpeg.zeranoe.com/builds/readme/win32/static/ffmpeg-2.1.4-win32-static-readme.txt
This is a FFmpeg Win32 static build by Kyle Schwarz.
Zeranoe's FFmpeg Builds Home Page: <http://ffmpeg.zeranoe.com/builds/>
This build was compiled on: Feb 26 2014, at: 23:13:31
FFmpeg version: 2.1.4
libavutil 52. 48.101 / 52. 48.101
@javouhey
javouhey / gist:9579407
Last active August 29, 2015 13:57
eeepc vidtools versions 2014/03/15
ffmpeg version N-60386-g9c978f2 Copyright (c) 2000-2014 the FFmpeg developers
built on Feb 6 2014 05:12:18 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/32bit --arch=x86_32 --extra-cflags='-m32
-I/root/ffmpeg-static/32bit/include -static' --extra-ldflags='-m32 -L/root/ffmpeg-static/32bit/lib
-static'
--extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver
--disable-doc --enable-gray
--enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect
--enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame
--enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex
@javouhey
javouhey / gist:9405636
Created March 7, 2014 05:13
#golang bufio.NewScanner
func parse(str string) map[string]string {
scanner := bufio.NewScanner(strings.NewReader(str))
for scanner.Scan() {
fmt.Println("=> ", scanner.Text())
}
return nil
}
@javouhey
javouhey / gist:9234850
Last active August 29, 2015 13:56
#golang Stupid mistakes newbies make
// A. Cannot use type switch outside of a switch statement
type PolarVortex interface {}
func main() {
var p PolarVortex = new(PolarVortex)
var s = p.(type) // compilation error => use of .(type) outside type switch
}
@javouhey
javouhey / gist:9225372
Last active August 29, 2015 13:56
#golang object creation
type Stack struct {
a int
b string
}
func main() {
t := Stack{}
s := Stack{b: "a"}
@javouhey
javouhey / gist:9182400
Created February 24, 2014 05:26
Better git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
from http://fredkschott.com/post/2014/02/git-log-is-so-2005/
@javouhey
javouhey / gist:9162475
Created February 22, 2014 21:09
Forcing a type check
package main
import (
"fmt"
)
type Boo interface{ Write(int32) int32 }
type Babi struct {}