This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Serve is a very simple static file server in go | |
Usage: | |
-p="8100": port to serve on | |
-d=".": the directory of static files to host | |
Navigating to http://localhost:8100 will display the index.html or directory | |
listing file. | |
*/ | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Summary: Proxy Switchy! Exported Rule List | |
; Date: Sunday, May 15, 2011 | |
; Website: http://bit.ly/proxyswitchy | |
#BEGIN | |
[wildcard] | |
*://192.168.1.* | |
*://www.amazon.com/* | |
*://www.bbc.co.uk/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl -sL https://gist.github.com/alvin2ye/6037403/raw/.gemrc > ~/.gemrc | |
gem: --no-ri --no-rdoc | |
:sources: | |
#- http://rubygems.org/ | |
- http://production.s3.rubygems.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run with: god -c /path/to/config.god [add -D if you want to not-deamonize god] | |
# This is the actual config file used to keep the delayed_job running | |
APPLICATION_ROOT = "/var/www/application" | |
RAILS_ENV = "production" | |
God.watch do |w| | |
w.name = "delayed_job_production" | |
w.interval = 15.seconds | |
w.start = "/bin/bash -c 'cd #{APPLICATION_ROOT}/current; /usr/bin/env RAILS_ENV=#{RAILS_ENV} #{APPLICATION_ROOT}/current/script/delayed_job start > /tmp/delay_job.out'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This is a Rails init template with MongoDB projects | |
# | |
# Mongoid, Devise, Bootstrap, jQuery, Redis, Cells, will_paginate, Carrierwave, simple_form, Settingslogic, Thin | |
# | |
# Usage | |
# | |
# $ rails new app_name -m https://raw.github.com/gist/2168014 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get -y install dialog | |
DIALOG=${DIALOG=dialog} | |
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$ | |
trap "rm -f $tempfile" 0 1 2 5 15 | |
$DIALOG --backtitle "请选择您要安装的选项" \ | |
--title "专业系统安装" --clear \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automaticlly install pptpd on Amazon EC2 Amazon Linux | |
# | |
# Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/ | |
# pptpd source rpm packing by it's authors | |
# | |
# WARNING: | |
# first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my | |
# /etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones. | |
# | |
# You need to adjust your "Security Groups" which you are using too. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Colors ---------------------------------------------------------- | |
export TERM=xterm-color | |
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' | |
export CLICOLOR=1 | |
alias ls='ls -G' # OS-X SPECIFIC - the -G command in OS-X is for colors, in Linux it's no groups | |
#alias ls='ls --color=auto' # For linux, etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'enumerator' # support rails 1.2.5 | |
require 'date' | |
namespace :backup do | |
desc 'crontab -e' | |
task :crontab do | |
puts <<-CRONTAB | |
m(0-59) h(0-23) d(1-31) m(1-12) w(0-6 0=Sunday) command | |
0 3 * * * cd /var/www/<project> && /usr/bin/rake backup:log:analyze APIKEY=* RAILS_ENV=production > /dev/null 2>&1 |
NewerOlder