Skip to content

Instantly share code, notes, and snippets.

@pantaovay
pantaovay / navigation.js
Created November 4, 2012 11:24 — forked from pala/navigation.js
jquery keyboard navigation
$(function(){
$(document).keydown(function(e) {
var url = false;
if (e.which == 37 || e.which == 74) { // Left arrow and J
{% if page.previous %}
url = '{{page.previous.url}}';
{% endif %}
}
else if (e.which == 39 || e.which == 75) { // Right arrow and K
{% if page.next %}
@pantaovay
pantaovay / open_goagent.sh
Created November 9, 2012 20:22
Open many GoAgents At The Same Time
#!/bin/sh
# Filename: Open many GoAgents
BaseDir="/root/goagent/local"
cd $BaseDir
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
do
cd ../local$i
@pantaovay
pantaovay / .gitconfig
Created November 9, 2012 20:49 — forked from liuyix/.gitconfig
Github via goagent
[http]
proxy = http://127.0.0.1:8087
sslVerify = false #注意一定要添加这一行用以解决“ SSL certificate problem: unable to get local issuer certificate”
[https]
proxy = http://127.0.0.1:8087
@pantaovay
pantaovay / goagent.pac
Created November 9, 2012 20:51
goagent paas pac
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
if (shExpMatch(url, "*://*.amazonaws.com/*") || shExpMatch(url, "*://amazonaws.com/*")) return 'PROXY 127.0.0.1:8088';
if (shExpMatch(url, "*://*.amazon.com/*") || shExpMatch(url, "*://amazon.com/*")) return 'PROXY 127.0.0.1:8088';
if (shExpMatch(url, "*://*.google.com/*") || shExpMatch(url, "*://google.com/*")) return 'PROXY 127.0.0.1:8088';
if (shExpMatch(url, "*://*.google.com.*/*") || shExpMatch(url, "*://google.com.*/*")) return 'PROXY 127.0.0.1:8088';
if (shExpMatch(url, "*://*.google-analytics.com/*") || shExpMatch(url, "*://google-analytics.com/*")) return 'PROXY 127.0.0.1:8088';
@pantaovay
pantaovay / stat_goagent.sh
Created November 9, 2012 20:51 — forked from hewigovens/stat_goagent.sh
Simple script for goagent statistic
#!/bin/bash
python_count=0
toggle_count=0
local_count=0
log_list=$(ls /etc/httpd/logs/access_log*)
for log in $log_list
do
tmp=$(cat $log | grep python | wc -l)
@pantaovay
pantaovay / .htaccess
Created November 16, 2012 02:37 — forked from yurydelendik/.htaccess
CORS for pdf.js
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "http://mozilla.github.com"
</IfModule>
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@pantaovay
pantaovay / gist:6821078
Last active December 24, 2015 15:29
Delete directory in Qiniu cloud storage using Python and Qiniu's Python SDK.
# -*- coding: utf-8 -*-
#author: pantaovay@gmail.com
#date: 2013/10/4
import qiniu.conf
import qiniu.rs
import qiniu.rsf
import sys.stderr
qiniu.conf.ACCESS_KEY = "<YOUR_APP_ACCESS_KEY>"
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot