Skip to content

Instantly share code, notes, and snippets.

View lueo's full-sized avatar

Leonard Huang lueo

View GitHub Profile
@dreamiurg
dreamiurg / fabfile.py
Created July 25, 2011 08:40
fabfile.py for webfaction and vagrant
"""
This fabric file makes setting up and deploying a django application much
easier to webfaction servers or your dedicated server, but it does make a
few assumptions. Namely that you're using Git, Apache and mod_wsgi. Also
you should have SSH installed on both the local machine and any servers you
want to deploy to.
Thanks to:
http://github.com/ryanmark/django-project-templates
@damionjunk
damionjunk / gist:1500336
Created December 20, 2011 05:02
Binaural Beats with Overtone and Clojure
(ns overtone-clj-toys.binaural
(:use [overtone.live]))
;;
;; Binaural Beat Synthesis:
;; Generates binaural beats given the provided carrier and desired
;; frequency. Brown noise is used to soften the background and
;; block out outside noise.
;; freq effect
@gorsuch
gorsuch / graphite-client.clj
Created March 2, 2012 21:39 — forked from codification/graphite-client.clj
Graphite client in clojure
(ns clj-client.core
(import [java.net Socket]
[java.io PrintWriter]))
(defn now []
(int (/ (System/currentTimeMillis) 1000)))
(defn write-metric [name value timestamp]
(with-open [socket (Socket. "localhost" 2003)
os (.getOutputStream socket)]
@twilson63
twilson63 / bstable.coffee
Created October 16, 2012 11:42
coffeekup bootstrap table component example
# # bsTable (BootStrap Table)
#
# parameters = (classes, columns, rows, formatHeader, formatCell)
#
# classes Array - list of classes to add to the table tag
# columns Array - markup for head section of table
# rows Array - is an array of objects with each key representing a column and value rep data
#
# Usage:
#
@rhybroy
rhybroy / fetchsub.sh
Created October 28, 2012 06:43 — forked from ravageralpha/fetchsub.sh
shell script get subtitle from shooter.cn
#!/bin/sh
# Author: RA <ravageralpha@gmail.com>
USAGE(){
echo "Usage:fetchsub [eng] file"
}
[ $# -eq 0 -o "$1" = '--help' ] && USAGE && exit 0
ERROR(){
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@burningTyger
burningTyger / docker.gogs.service.md
Last active August 13, 2016 16:39
Docker Gogs systemd script

Starting Gogs as a Docker container on startup via systemd

Gogs is that great Github clone which is also available as a docker image. Works perfectly if started by the user but since you probably want to run it on your server and without interruption you can add a systemd script to start up Gogs on boot. My script looks like this:

# /etc/systemd/system/docker.gogs.service
[Unit]
Description=Gogs container
Requires=docker.service
Require=postgresql.service
@ba0f3
ba0f3 / compile-emacs.sh
Last active July 19, 2017 02:00
Compile emacs 25.1 on CentOS 6.x
yum install gcc make ncurses-devel giflib-devel libjpeg-devel libtiff-devel
wget http://ftp.twaren.net/Unix/GNU/gnu/emacs/emacs-25.1.tar.xz
tar xJf emacs-*
cd emacs-*
./configure --without-x --without-selinux
make && make install
@joefitzgerald
joefitzgerald / Vagrantfile
Last active July 6, 2018 12:33
Windows Vagrantfile - Installs .NET 4.5, VS 2012, VS 2012 Update 3, then a bunch of utilities, then syspreps the machine. Get https://github.com/joefitzgerald/packer-windows for the base box and add it with the name "windows2008r2".
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "vagrant-windows"
config.vm.box = "windows2008r2"
# You should be using the vagrant-windows Vagrant Plugin!
# Admin user name and password
config.winrm.username = "Administrator"
@Iristyle
Iristyle / install-graphite-ubuntu-11.10.sh
Created November 12, 2011 18:40
Install Graphite 0.9.9 on Ubuntu 11.10 on EC2 with NGinx, uwsgi, supervisord, statsite, nagios agent
#!/bin/bash
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Ubuntu 11.10 Oneiric Ocelot
# Forked from https://gist.github.com/1287170
# Modified to use NGinx + uwsgi instead of Apache, as well as memcached and supervisord, incorporating ideas from
# http://blog.adku.com/2011/10/scalable-realtime-stats-with-graphite.html