Skip to content

Instantly share code, notes, and snippets.

@dearmark
dearmark / FireGestures
Last active August 29, 2015 14:02
FireGestures Code
//1、关闭左边标签页:
//代码:
var tab = gBrowser.mCurrentTab.boxObject.previousSibling;
if(tab) gBrowser.removeTab(tab);
//2、关闭右边标签页:
//代码
#!/bin/sh
if [ `id -u` -ne 0 ]
then
echo "please run it by root"
exit 0
fi
apt-get -y update
apt-get -y install pptpd || {
sudo su
wget https://raw.github.com/fivesheep/chnroutes/master/chnroutes.py
python chnroutes.py -p linux
cp -a ip-pre-up /etc/ppp
chmod +x /etc/ppp/ip-pre-up
cp -a ip-down /etc/ppp/ip-down.d
chmod +x /etc/ppp/ip-down.d/ip-down
link:https://code.google.com/p/chnroutes/wiki/Usage
@dearmark
dearmark / l2tp.sh
Created May 5, 2014 23:54 — forked from yaoyi/l2tp.sh
#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
# #
#!/bin/sh
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
set -e
# Must be a valid filename
NAME=shadowsocks_client
PIDFILE=/var/run/$NAME.pid
#This is the command to be run, give the full pathname
DAEMON=/opt/ShadowSPDY/bin/splocal
import requests
import sys
import re
import urllib
cookie = {'PHPSESSID': 'phulssv3eg4bijf3cb423beve4'}
def get_lesson_urls(html):
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', html)
return [url for url in urls if 'lesson' in url]
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks