Skip to content

Instantly share code, notes, and snippets.

from gi.repository import Gtk
builder = Gtk.Builder()
builder.add_from_file("/home/kendell/Desktop/gui.glade")
window = builder.get_object("window1")
window.show_all()
Gtk.main()
@kendellfab
kendellfab / supervisord_config
Created September 25, 2013 20:06
Supervisord Config
; supervisor config file
[unix_http_server]
file=/var/run//supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
@kendellfab
kendellfab / pacman_aur
Created September 23, 2013 00:26
Show list of AUR packages installed in pacman.
pacman -Qm
@kendellfab
kendellfab / arch_java.
Created September 19, 2013 19:40
Install Oracle java 7
http://stackoverflow.com/questions/13439665/how-to-install-java-on-arch-linux
=============================================================================
sudo pacman -R icedtea-web
Then build Oracle JRE AUR package,
Before installing OracleJRE I had to remove openjdk6 manually and ignore dependencies:
[argy@Freak jre]$ sudo pacman -Rdd openjdk6
@kendellfab
kendellfab / fish_shell
Created September 5, 2013 14:35
Adding a list to a list in fish shell.
set PATH $PATH {$GOPATH}/bin
@kendellfab
kendellfab / ejabberd_user
Created September 3, 2013 15:05
Register a new ejabberd user.
sudo ejabberdctl register <username> <domain> <password>
@kendellfab
kendellfab / golang-request
Created August 26, 2013 14:27
Golang Example for adding custom headers to a request.
client := &http.Client{]
req, err := http.NewRequest("POST", "http://example.com", bytes.NewReader(postData))
req.Header.Add("User-Agent", "myClient")
resp, err := client.Do(req)
defer resp.Body.Close()
@kendellfab
kendellfab / golang-json-marshall
Created August 16, 2013 22:35
Handling custom Json marshalling in golang.
type Whatever struct {
someField int
}
func (w Whatever) MarshalJSON() ([]byte, error) {
return json.Marshal(struct{
SomeField int `json:"some_field"`
}{
SomeField: w.someField,
})
@kendellfab
kendellfab / Typescript Comments
Created August 15, 2013 19:54
Sublime Text TypeScript commenting.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.ts</string>
<key>settings</key>
<dict>
@kendellfab
kendellfab / Apache Test
Created August 12, 2013 15:14
Example of using apache test tools to test server.
ab -c 100 -n 10000 http://{your ip}:8000/