Skip to content

Instantly share code, notes, and snippets.

@holys
holys / monssh.sh
Created November 5, 2012 17:06 — forked from iwinux/monssh.sh
monitor SSH status
#! /bin/bash
# usage: monssh [hostname]
if [[ -z $1 ]]
then
HOST="YOURHOST"
else
HOST=$1
fi
@holys
holys / proxy-with-white-list.pac
Created November 5, 2012 17:08 — forked from iwinux/proxy-pac.js
PAC that uses a white list
/*global isPlainHostName, isInNet*/
var proxy = "SOCKS5 127.0.0.1:9999; SOCKS 127.0.0.1:9999; DIRECT";
var noProxy = "DIRECT";
var localhosts = [
['192.168.0.0', '255.255.0.0'],
['10.0.0.0', '255.0.0.0'],
['172.0.0.0', '255.0.0.0'],
['127.0.0.0', '255.255.255.0']
];
#Modified by David Chen <[email protected]> at May 26,2012
# I copied it from somewhere else but I have forgot the url .
#This conkyrc suits for my ASUS laptop K42JE .ArchLinux &xfce4(wm) with 14' screen
#No copyright at all . You can modify it yourself . Have fun !
background yes
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
@holys
holys / gist:4103942
Created November 18, 2012 07:07 — forked from cuimuxi/gist:3719516
gevent crawler
import gevent
from gevent import monkey, queue
monkey.patch_all()
import urllib2
from time import sleep
import traceback
import logging
@holys
holys / checklink.py
Created December 5, 2012 12:07 — forked from tonyseek/checklink.py
Visit all links of a website.
#!/usr/bin/env python
# -*- coding: utf8 -*-
import re
import requests
import urlparse
import MySQLdb
cookie = 'http://strs.gdufs.edu.cn/web'
base = 'http://202.116.194.117/'
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@holys
holys / case.sh
Last active December 11, 2015 00:29 — forked from anonymous/case.sh.txt
#!/bin/bash
read -p "please input a file name:" file
cat <<- MENU
d or D:delete file
s or S:show file detail infomation
q or Q:quit
MENU
read -p "input your option:" option
@holys
holys / exam
Last active December 11, 2015 00:29 — forked from anonymous/exam.txt
#!/bin/bash
main() {
clear
while true
do
cat <<- MENU
1) select
2) command