Skip to content

Instantly share code, notes, and snippets.

View kasuganosora's full-sized avatar
🙎‍♀️
Working at home

KasuganoSora kasuganosora

🙎‍♀️
Working at home
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<filter>
<f t="user">e3040106</f>
<f t="user">84a7f028</f>
<f t="user">223830d4</f>
<f t="user">f372aedb</f>
<f t="user">D877013c</f>
<f t="user">1f25df33</f>
<f t="user">b7cd2dd4</f>
<f t="user">5f03f91d</f>
@kasuganosora
kasuganosora / bilibiliplayer
Last active December 20, 2015 06:49
BILIBILI禁止是用爱奇艺和youku的播放器UserScript
// ==UserScript==
// @name Bilibili Player
// @namespace http://blog.hcg.im/
// @version 0.2
// @description Bilibili Player
// @match http://www.bilibili.tv/video/av*
// @copyright 2013+,ReitsukiSion
// 请把这个规则加到 *://interface.bilibili.tv/playurl* SwitchySharp 的翻墙列表里
// ==/UserScript==
@kasuganosora
kasuganosora / gist:6148364
Created August 3, 2013 23:22
memoryforcer 获取字典
var $ = require('jquery').create();
var fs = require('fs');
var wordList = [];
var isEND =false;
function getDictContent(url,page,callback){
if(page == undefined){
page = 1;
}
var fullURL = url + "?page=" + page;
@kasuganosora
kasuganosora / localSOCK5ProxyDemo
Created August 25, 2013 03:02
local SOCK5 proxy demo
net = require("net")
util = require("util")
AUTHENTICATION =
NOAUTH: 0x00
GSSAOI: 0x01
USERPASS: 0x02
NONE:0xFF
ADDRTYPE =
@kasuganosora
kasuganosora / tv.bilibili.player.xml
Created October 5, 2013 04:17
B站小学生大全
<filters>
<item enabled="true">u=e3040106</item>
<item enabled="true">u=84a7f028</item>
<item enabled="true">u=223830d4</item>
<item enabled="true">u=f372aedb</item>
<item enabled="true">u=D877013c</item>
<item enabled="true">u=1f25df33</item>
<item enabled="true">u=b7cd2dd4</item>
<item enabled="true">u=5f03f91d</item>
<item enabled="true">u=b80a011f</item>
@kasuganosora
kasuganosora / SSWatchdog
Created November 24, 2013 04:18
Shadowsocks Watchdog 监视Shadowsocks是否正常运行 如果不正常的话就 杀掉原来的进程重新启动Shadowsocks
import socket
import threading
import os
import subprocess
Port = 123 #Shadowsocks 的端口
ShadowsocksPath = "/home/ss" #Shadowsocks 的路径
def CheckService():
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@kasuganosora
kasuganosora / gist:7714921
Last active August 20, 2019 06:40
刚配置完IPSEC(strongSwan U5.1.1/K3.11.6) 用到的配置
#生成CA密钥
ipsec pki --gen --outform pem > caKey.pem
#生成CA证书
ipsec pki --self --in caKey.pem --dn "C=US, O=你的组织名字, CN=你的CA名字" --ca --outform pem > caCert.pem
#生成服务器密钥
ipsec pki --gen --outform pem > serverKey.pem
@kasuganosora
kasuganosora / build-non-respond.js
Created December 8, 2013 12:15
提取响应式布局的某个分辨率生效的样式
var fs = require('fs');
var fileContent = fs.readFileSync("style.css", "utf8");
respond = {};
respond.regex = {
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+\s*\}/gi,
keyframes: /@.*keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]+\}/gi,
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
only: /(only\s+)?([a-zA-Z]+)\s?/,
@kasuganosora
kasuganosora / checkservice
Created December 9, 2013 13:13
用来检查某个服务是否正常使用的py脚本,如果不正常的话就会杀掉重启
import socket
import threading
import os
import subprocess
def CheckService():
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sk.settimeout(1)
try:
sk.connect(('xxx.xxx.xxx.xxx',0000))
#### 以下是HTTP PROXY的实现
net = require 'net'
localPort = 8011
findBodyStartPos = (buffer)->
length = buffer.length
for index in [0..buffer.length]
# http header end \r\n\r\n pos
return index+4 if buffer[index] == 0x0d and buffer[index+1] == 0x0a and buffer[index+2] == 0x0d and buffer[index+3] == 0x0a
return -1 # not found