Skip to content

Instantly share code, notes, and snippets.

package main
import (
"log"
"fmt"
"strings"
"regexp"
"net/http"
)
@jankuo
jankuo / gist:8994831
Created February 14, 2014 02:33
tengine.sh
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_sysguard_module --with-http_concat_module --with-syslog
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
#!/bin/sh
#
# redis Startup script for Redis Server
#
# chkconfig: - 90 10
# description: Redis is an open source, advanced key-value store.
#
# processname: redis-server
# config: /etc/redis.conf
# pidfile: /var/run/redis.pid
var ids = document.querySelectorAll(".member_id");
var names = document.querySelectorAll(".member_name");
var output = "", length = ids.length;
for(var i=0; i<length; i++){
output += ids[i].innerHTML.slice(1,-1) + ":" + names[i].innerHTML + "\n";
}
console.log(output);
@jankuo
jankuo / mysqlbackup.sh
Created July 1, 2013 02:36
mysql backup bask script
#!/bin/bash
# 以下配置信息请自己修改
mysql_user="root" #MySQL备份用户
mysql_password="password" #MySQL备份用户的密码
mysql_host="localhost"
mysql_port="3306"
mysql_charset="utf8" #MySQL编码
backup_db_arr=("test_hd") #要备份的数据库名称,多个用空格分开隔开 如("db1" "db2" "db3")
backup_location=/var/backup/sql #备份数据存放位置,末尾请不要带"/",此项可以保持默认,程序会自动创建文件夹
BTW yum has last Redis too, remi repository at least.
$ sudo -i
$ yum list redis
$ redis.x86_64 2.6.13-1.el6.remi remi
But today we want compile redis from source (see http://redis.io/download)
$ yum install make gcc tcl
$ cd /usr/local/src
@jankuo
jankuo / weibo-login.py
Last active December 16, 2015 16:39
weibo login python script using requests rya more info please go :http://www.oschina.net/code/snippet_925666_20449?from=mail-notify
#coding:utf-8
import requests
import base64
import re
import urllib
import rsa
import json
import binascii
username = 'xxxx'