Skip to content

Instantly share code, notes, and snippets.

@shapeshed
shapeshed / nginx_rails_3_1
Created October 10, 2011 19:13
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {
@chjj
chjj / trans.sh
Created November 6, 2011 04:44
setting transparency from bash
#!/bin/bash
# transset in a bash script
# copyright (c) 2011, christopher jeffrey
# usage:
# by window id
#trans -w "$WINDOWID" -o 75
# by name
#trans -n "urxvt" -o 75
@sorah
sorah / thin
Created November 30, 2011 16:52
/etc/init.d/thin - thin init script with bundle exec. own your risk - public domain.
#!/bin/bash
DAEMON=/path/to/thin
BUNDLE=/path/to/bundle
CONFIG_PATH=/etc/thin
SCRIPT_NAME=/etc/init.d/thin
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
@evanwalsh
evanwalsh / gist:2552100
Created April 29, 2012 17:26 — forked from joelmoss/gist:2470666
Capistrano recipe for Puma start/stop/restarts
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
end
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
@postmodern
postmodern / rails_rce.rb
Last active July 17, 2023 11:54
Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#
@kevinzhow
kevinzhow / route.sh
Last active October 2, 2022 08:01
AnyConnect 路由表
route = 8.0.0.0/255.0.0.0
route = 58.0.0.0/255.0.0.0
route = 23.0.0.0/255.0.0.0
route = 117.0.0.0/255.0.0.0
route = 199.0.0.0/255.0.0.0
route = 190.0.0.0/255.0.0.0
route = 198.0.0.0/255.0.0.0
route = 173.0.0.0/255.0.0.0
route = 174.0.0.0/255.0.0.0
route = 168.0.0.0/255.0.0.0
@snakevil
snakevil / openwrt-barrierbreaker-rc3-handbook.md
Last active July 26, 2021 13:42
OpenWrt BarrierBreaker 14.07-rc3 手记

OpenWrt BarrierBreaker 14.07-rc3 手记

1 外置存储 - ExtRoot

1.1 USB HDD 分区

安装依赖和工具包: