Skip to content

Instantly share code, notes, and snippets.

View csrutil's full-sized avatar
🏠
Working from home

Csrutil csrutil

🏠
Working from home
  • N/A
  • Follow the white rabbit.
View GitHub Profile
wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz
tar xvJf coreutils-8.23.tar.xz
cd coreutils-8.23/
#wget http://zwicke.org/web/advcopy/advcpmv-0.5-8.23.patch
patch -p1 -i advcpmv-0.5-8.23.patch
./configure
make
#export FORCE_UNSAFE_CONFIGURE=1
sudo cp /bin/cp /bin/cp.backup
sudo cp src/cp /bin/cp2
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 127.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com
bypass-tun = 192.168.0.0/16, 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9,
第1列分钟1~59
第2列小时1~23(0表示子夜)
第3列日1~31
第4列月1~12
第5列星期0~6(0表示星期天)
第6列要运行的命令
下面是crontab的格式:
分 时 日 月 星期 要运行的命令
@csrutil
csrutil / 微信UA.md
Created November 12, 2015 08:29 — forked from stormslowly/微信UA.md
微信UA识别

iPhone 通过微信内置浏览器访问网页时得到 User Agent 是:

Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B329 MicroMessenger/5.0.1

Android 通过微信内置浏览器访问网页时得到 User Agent 是:

Mozilla/5.0 (Linux; U; Android 2.3.6; zh-cn; GT-S5660 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MicroMessenger/4.5.255
var sslocal = "SOCKS5 127.0.0.1:8899";
var DEFAULT = 'DIRECT';
var proxy = sslocal;
var whiteSLDs = {
"moe.fm": 1,
"moe.org": 1,
"miui.com": 1,
"xiaomi.com": 1,
整合了可以搜索到的列表,有广告过滤等,自行添加Proxy信息即可使用。
目前使用无恙。
不定期更新。
感谢各位分享者。
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten

Creating a redis Module in 15 lines of code!

A quick guide to write a very very simple "ECHO" style module to redis and load it. It's not really useful of course, but the idea is to illustrate how little boilerplate it takes.

Step 1: open your favorite editor and write/paste the following code in a file called module.c

#include "redismodule.h"
/* ECHO <string> - Echo back a string sent from the client */
int EchoCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
@csrutil
csrutil / vhost.conf
Created June 1, 2016 05:55 — forked from kucaahbe/vhost.conf
nginx config file for rails + unicorn + gzipped assets + rails caching
upstream rails {
server 127.0.0.1:3000;
#server unix:/tmp/thin.0.sock;
}
server {
# we haven't checked to see if Rack::Deflate on the app server is
# faster or not than doing compression via nginx. It's easier
# to configure it all in one place here for static files and also
# to disable gzip for clients who don't get gzip/deflate right.
@csrutil
csrutil / netbsd-cubieboard2.sh
Created July 5, 2016 10:41 — forked from ozaki-r/netbsd-cubieboard2.sh
How to build a bootable SSD card with a NetBSD kernel on Cubieboard2
# working on Mac OS X :)
# You have a blank or unused SSD card.
# Get latest at http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/
wget http://dl.linux-sunxi.org/nightly/u-boot-sunxi/u-boot-sunxi/u-boot-sunxi-20140413T154240-9167f4b/u-boot-sunxi-cubieboard2.tar.xz
tar xvf u-boot-sunxi-cubieboard2.tar.xz
cd u-boot-sunxi-cubieboard2-20140413T154240-9167f4b/
# Follow the instructions written in http://docs.cubieboard.org/zh/tutorials/ct1/installation/install_lubuntu_desktop_server_to_sd_card
card=/dev/disk1