Skip to content

Instantly share code, notes, and snippets.

[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
@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-----
@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
@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>
@julianlam
julianlam / expose-directory-on-host-to-lxc-container.md
Last active May 6, 2024 06:41
Exposing a directory on the host machine to an LXC container #blog

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.
@preshing
preshing / build_cross_gcc
Last active April 11, 2024 02:14
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@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)"))
@lanceliao
lanceliao / dnsmasq-gfwlist.py
Last active August 18, 2023 11:26
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@bao3
bao3 / autopin.sh
Last active July 4, 2021 03:10
reaver PIN时每10分钟模拟键盘输入Ctrl+C中断,因为无线网卡运行在monitor模式大约10分钟后就性能下降,因此需要强制中断reaver。使用时 sudo ./10pin aa:bb:cc:dd:ee:ff:11(即路由器MAC) 额外的reaver指令 请在空格后使用""(双引号)中写入,例如channel 6 ,可以使用 sudo ./10pin aa:bb:cc:dd:ee:ff:11 "-c 6" 如果你要实时查看进度,可以使用 tail -f /var/log/reaer.pin.log
#!/bin/sh
reaverCMD()
{
reaver -i mon0 -b $1 -v -a -S -N -r 100:60 $2 >>/var/log/reaver.pin.log &
tmp_pid=$(ps a| grep reaver | grep -v grep | awk '{print $1}' );
echo $tmp_pid;
}
while true :
do
@lembacon
lembacon / luna_pinyin.emoji.dict.yaml
Last active November 20, 2023 16:09
Pinyin-Emoji Dictionary for Squirrel
# Rime dictionary
# encoding: utf-8
---
name: luna_pinyin.emoji
version: "2017.02.10"
sort: by_weight
use_preset_vocabulary: true
...