Skip to content

Instantly share code, notes, and snippets.

@xream
xream / 10010.coffee
Last active August 29, 2015 14:07
查询联通剩余流量
# npm install zombie
Browser = require("zombie")
browser = new Browser()
browser.visit "http://wap.10010.com/t/logout.htm", ->
browser.clickLink "[登录]", ->
browser.fill("user_id", "此处填写你的手机号").fill("user_pwd", "此处填写你的服务密码").pressButton "登  录", ->
browser.clickLink "上网流量", ->
console.log("剩余流量: "+browser.text("span.color-red:nth-child(7)"))
@xorrbit
xorrbit / setup_mosh_centos.sh
Last active July 27, 2016 16:18 — forked from tancnle/setup_mosh_centos.sh
Setup mosh 1.2.5 on Centos 6.x
#!/bin/sh
# Update latest epel
sudo yum -y instlal epel-release
# perl-IO-Socket-IP isn't in the repos
wget http://rpm.mag-sol.com/Centos/6/x86_64/perl-IO-Socket-IP-0.31-1.el6.noarch.rpm
sudo rpm -Uvh perl-IO-Socket-IP-0.31-1.el6.noarch.rpm
rm perl-IO-Socket-IP-0.31-1.el6.noarch.rpm
@wynemo
wynemo / ssl_proxy.md
Last active December 13, 2016 17:43 — forked from anonymous/stunnel.conf

虚拟机 ubuntu 12.04

$ sudo aptitude install stunnel
$ sudo aptitude install squid3

squid3的默认http端口是3128

/etc/stunnel/stunnel.conf中的foreground = yes, 是用来调试用的 如果用superviord来管理stunnel 这个选项也会用得到

/etc/stunnel/stunnel.pem, 这个pair是这样得到的

@mcxiaoke
mcxiaoke / surge_main.conf
Created October 26, 2015 06:39
Config for surge.app
# This config file was created for myself (@shanskc). You may want to add or remove some rules to make efficient use of the Internet.
# NOTE: this config requires Surge.app build 243 or newer version.
# 从243开始Surge 加入了proxy和rule分离的配置Override,此文件为rules main.conf,在你的proxy中你可以引入此conf
# eg: 下面为你的proxy.conf,只需引入此main.conf 即可.
# -----START-----
# #!PROXY-OVERRIDE:main.conf
#
# [Proxy]
# Proxy = custom, ip, port, Methor, password
# -----END-----
@iflamed
iflamed / com.shadowsocks.chinadns.plist
Created May 7, 2015 18:00
a plist file for mac os x launchctl damoen
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.shadowsocks.chinadns</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/chinadns</string>
<string>-l</string>
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
@maxbelyanin
maxbelyanin / ntp.bat
Created August 18, 2015 13:14
Starts the Windows NTP-Server
reg add "HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config" /v "AnnounceFlags" /t REG_DWORD /d 5 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" /v "Enabled" /t REG_DWORD /d 1 /f
net stop w32time && net start w32time
@ivikash
ivikash / mpd.conf
Created August 4, 2016 07:15
Config file for Music Player Daemon (MPD) on Mac OSX
# Basic configuration
music_directory "~/Music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd.pid"
state_file "~/.mpd/mpdstate"
# Audio configuration
@luosheng
luosheng / default.custom.yaml
Created May 18, 2012 05:58
鼠须管中加入五笔
# 在 ~/Library/Rime 下建立 default.custom.yaml,输入如下内容,然后在菜单栏点「重新部署」
patch:
schema_list:
- schema: wubi86
@blueset
blueset / telegram-zh.scpt
Last active September 6, 2018 10:39
Telegram Swift Native load language file
-- Telegram Native Swift 汉化脚本
-- 制作:Eana Hufwe
set zh_cn to "简体中文语言文件,来自 @zh_CN 的 GitHub Repo"
set zh_tw to "正體中文化文件(台灣),尚未收录"
set zh_hk to "繁體中文化文件(香港),尚未收录"
set tlocal to "本地语言文件"
set iinput to (choose file with prompt "选择您的 Telegram Native Swift 程序。" of type {"app"} default location "Applications") as string
set tgpath to POSIX path of iinput