Skip to content

Instantly share code, notes, and snippets.

@holys
holys / gist:3897371
Created October 16, 2012 05:34 — forked from lamengao/gist:1560715
dl.cuoluo.me nginx config
server {
listen 80;
server_name dl.cuoluo.me;
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://dl.dropbox.com/u/1812807/dl.cuoluo.me/index.html;
if ($request_method = POST) {
@holys
holys / .rjsupplicant.sh.txt
Created October 20, 2012 12:41 — forked from anonymous/.rjsupplicant.sh.txt
./rjsupplicant.sh
#! /bin/bash
curDir=$(cd "$(dirname "$0")"; pwd);
arg="";
until [ $# -eq 0 ]
do
opt=$1;
if [ "${opt/ /}" != "$opt" ]; then
arg="$arg \"$opt\"";
else
@holys
holys / base64.js
Created October 20, 2012 15:19
from GDUFS video
var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var base64DecodeChars = new Array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
@holys
holys / crx.php
Created October 24, 2012 09:57
下载Chrome WebStore的扩展程序安装包,来自http://cooal.cn/crx.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE>Crx离线安装包下载</TITLE>
<style type="text/css">
body{background-image: url(/static/bg.gif);background-repeat:repeat-x;}
a{text-decoration:none; color:#333333}
.detect_table {border: 1px solid #C3E1EE;border-collapse: collapse;margin-top: 5px;width: 650px;}
</style>
[gae]
appid = goagent
password =
path = /2
profile = google_hk #这里用google_hk
crlf = 1
-------
[google_hk]
mode = https #这里用 https (亲 ,可能不可以这么写注释的 看懂就行)
@holys
holys / suspend.sh
Created October 29, 2012 13:40
digest from https://bbs.archlinux.org/viewtopic.php?id=62286 ,run in cron mode , to check if it is low battery and then suspend
#!/bin/bash
battery='-';
bat_dir="/proc/acpi/battery/BAT0";
if [ -d "$bat_dir" ]; then
remaining="$(awk '/remaining capacity/ {print $3}' <${bat_dir}/state)"
total="$(awk '/last full capacity/ {print $4}' <${bat_dir}/info)"
battery_level="$((remaining *100 /total))"
battery="${battery_level}"
@holys
holys / gist:4015296
Created November 5, 2012 04:20 — forked from dreampuf/gist:3859636
双拼域名采集
#!/usr/bin/env python
#vim: encoding=utf-8
__author__ = "Dreampuf<[email protected]>"
import subprocess
import itertools
dc = "a,ai,an,ang,ao,ba,bai,ban,bang,bao,bei,ben,beng,bi,bian,biao,bie,bin,bing,bo,bu,ca,cai,can,cang,cao,ce,cei,cen,ceng,cha,chai,chan,chang,chao,che,chen,cheng,chi,chong,chou,chu,chua,chuai,chuan,chuang,chui,chun,chuo,ci,cong,cou,cu,cuan,cui,cun,cuo,da,dai,dan,dang,dao,de,dei,den,deng,di,dia,dian,diao,die,din,ding,diu,dong,dou,du,duan,dui,dun,duo,e,ei,en,eng,er,fa,fan,fang,fei,fen,feng,fiao,fo,fou,fu,ga,gai,gan,gang,gao,ge,gei,gen,geng,gong,gou,gu,gua,guai,guan,guang,gui,gun,guo,ha,hai,han,hang,hao,he,hei,hen,heng,hm,hng,hong,hou,hu,hua,huai,huan,huang,hui,hun,huo,ji,jia,jian,jiang,jiao,jie,jin,jing,jiong,jiu,ju,juan,jue,jun,ka,kai,kan,kang,kao,ke,kei,ken,keng,kong,kou,ku,kua,kuai,kuan,kuang,kui,kun,kuo,la,lai,lan,lang,lao,le,lei,leng,li,lia,lian,liang,liao,lie,lin,ling,liu,lo,long,lou,lu,luan,lun,luo,lüe,lǘ,lǚ,lǜ,ma,mai,man,mang,mao,me,mei,men,meng,mi,mian,miao,mie,min,ming,miu,mo,mo
@holys
holys / rc.conf
Created November 5, 2012 16:51 — forked from iwinux/rc.conf
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="localtime"
TIMEZONE="Asia/Shanghai"
KEYMAP="us"
CONSOLEFONT="ter-v20b"
@holys
holys / rc.lua
Created November 5, 2012 16:55 — forked from iwinux/rc.lua
Awesome Configurations
require("awful") -- Standard awesome library
require("awful.autofocus")
require("awful.rules")
require("beautiful") -- Theme handling library
require("naughty") -- Notification library
beautiful.init("/home/winus/.cache/awesome/themes/zenburn/theme.lua")
terminal = "terminator"
@holys
holys / .tmux.conf
Created November 5, 2012 17:02 — forked from iwinux/.tmux.conf
tmux.conf
# reference https://bitbucket.org/xuxiaodong/dotman/src/cb7f1e6fb338/.tmux.conf
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0
# key bindings