Skip to content

Instantly share code, notes, and snippets.

#################################
#
# 本清单基于 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
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]
#!/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
@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 "
####################################################
# #
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
#!/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 || {
@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、关闭右边标签页:
//代码

本文完全参照 http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1420886 ,两者原理一样,内容大同小异,本文方便没有 osx 系统和初次安装的人。

本文适用范围:thinkpad t410 配有独显的型号,并且机器上原来只有 windows 8.1 (或者 7 或者 8,xp 不知道能否成功)系统,并且硬盘有足够空间,并且硬盘是 mbr 分区的。除非你知道你自己在干什么,以上条件缺一不可。

本文涉及到的帖子为:

请预先下载以下文件:

@dearmark
dearmark / si.rb
Last active August 29, 2015 14:07 — forked from rasefon/si.rb
require 'RMagick'
$scale_size = 256.0
$img_fn1 = ARGV[0]
$img_fn2 = ARGV[1]
$scale_size = ARGV[2].to_f if ARGV[2]
def calculate_threshold(img_fn)
dir_name = File.dirname(img_fn)