Skip to content

Instantly share code, notes, and snippets.

@hugs
hugs / vncpasswd.py
Created February 15, 2009 02:46
vncpasswd - automated with python and pexpect
import sys
import pexpect
def setpassword(read_write_password, read_only_password=None):
p = pexpect.spawn("vncpasswd")
# Uncomment the next line if you want to see the standard output
#p.logfile = sys.stdout
if read_write_password:
print ("Setting read-write password")
@border
border / Makefile
Created January 12, 2011 01:36
json example in golang
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go
@seungjin
seungjin / run_cmd_func.py
Created April 29, 2011 23:59
run shell command in python
import subprocess
run_cmd = lambda c : subprocess.Popen(c.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False).stdout.read()
run_cmd = lambda c,a : subprocess.Popen(c.split(None,a), stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False).stdout.read()
@winhamwr
winhamwr / fabfile.py
Created July 27, 2011 16:55
Fabric script to bundle an ami
def bundle_ami():
require('dev_aws_userid')
require('dev_aws_access_key_id')
require('dev_aws_secret_access_key')
require('ami_bucket')
require('config_folder')
require('hudson_slave_ami_name')
env.ami_name = env.hudson_slave_ami_name
@msmith
msmith / couchdb-ec2-install.sh
Created August 25, 2011 17:26
Set up CouchDB on EC2
#!/bin/bash
#
# This script installs and configures couchdb on a fresh Amazon Linux AMI instance.
#
# Must be run with root privileges
# Tested with Amazon Linux AMI release 2011.02.1.1 (ami-8c1fece5)
#
export BUILD_DIR="$PWD"
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@bryanjswift
bryanjswift / .rtorrent.rc
Created December 28, 2011 02:42
rtorrent configuration file with description
# This is an example resource file for rTorrent. Copy to
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
# uncomment the options you wish to enable.
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 1
max_peers = 100
# Same as above but for seeding completed torrents (-1 = same as downloading)
@alefteris
alefteris / smartgit.desktop
Created April 30, 2012 18:52
Smartgit desktop file for use with Ubuntu Unity launcher
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
StartupNotify=true
Name=Smartgit
Exec=env SMARTGIT_JAVA_HOME=/opt/apps/jre7/ /opt/apps/smartgit/bin/smartgit.sh
Icon=/opt/apps/smartgit/bin/smartgit-64.png
@weynhamz
weynhamz / config
Last active July 6, 2022 13:33
i3-wm configuration
# i3 config file
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
#####
#
# Fonts
#