Skip to content

Instantly share code, notes, and snippets.

@yqt
yqt / start_spooler.bat
Created May 18, 2020 06:41
start Spooler service with Admin privilege
::::::::::::::::::::::::::::::::::::::::::::
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
@yqt
yqt / sample.md
Last active May 1, 2020 17:17
MT7621A iperf

config

-P 8

raw

243 Mbits/sec

ss-tunnel(4 process with reuse_port)

160 Mbits/sec

package main
import (
"github.com/patrickmn/go-cache"
"github.com/gin-gonic/gin"
"log"
"time"
)
func Logger() gin.HandlerFunc {
@yqt
yqt / merge.sh
Last active October 15, 2019 09:36
awk every N lines into one with delimiter
grep -E 'symptom_id|symptom_name|symptom_alias' encyclopedias.xml* | awk -F '[\\[\\]]' '{line=line "\t" $3} NR%3==0{print substr(line,2); line=""}'
cat symptom.jl | python2.7 -c 'import sys; reload(sys); sys.setdefaultencoding("utf-8"); import json; [sys.stdout.write(json.dumps(json.loads(i)["symptom"], ensure_ascii=False, indent=4, sort_keys=True) + "\n") for i in sys.stdin]' | grep -E '"chineseName"|"englishName"|"id"|"otherName"' | awk -F '[: ,]' '{line=line "\t" $7} NR%4==0{print substr(line,2); line=""}'
@yqt
yqt / cmd.sh
Last active October 15, 2019 08:16
kill inactive ssh session
pstree -p | grep ssh | grep -v grep | awk -F '[()]' '{print $2}' | xargs -I {} sudo kill -9 {}
https://backend.deviantart.com/rss.xml?q=boost%3Apopular+max_age%3A24h+%23dota2+%23wallpaper&type=deviation
https://www.deviantart.com/biggreenpepper/art/Dota2-Wallpaper-517728486
https://t00.deviantart.net/kYtbb_duDumlTIyULIjYUtkInS4=/300x200/filters:fixed_height(100,100):origin()/pre00/336a/th/pre/f/2015/062/9/2/dota2_wallpaper_by_biggreenpepper-d8k8puu.jpg
https://pre00.deviantart.net/336a/th/pre/f/2015/062/9/2/dota2_wallpaper_by_biggreenpepper-d8k8puu.jpg
https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/69306615-010a-4f72-bffb-ec6ed4614e31/d8k8puu-88a50f18-3aea-40a4-b523-26f4c02c9f32.jpg
@yqt
yqt / opkg_src.txt
Last active October 15, 2018 08:50
[pandorabox opkg] #pandorabox #opkg
#src/gz 17.08_core http://downloads.pandorabox.com.cn/pandorabox/targets/ralink/mt7621/packages
#src/gz 17.08_base http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/base
#src/gz 17.08_lafite http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/lafite
#src/gz 17.08_luci http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/luci
#src/gz 17.08_mtkdrv http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/mtkdrv
#src/gz 17.08_newifi http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/newifi
#src/gz 17.08_packages http://downloads.pandorabox.com.cn/pandorabox/packages/mipsel_1004kc_dsp/packages
src/gz 17.09_core http://pandorabox.leoslion.cn/pandorabox/17.09/targets/ralink/mt7621/packages
src/gz 17.09_base http://pandorabox.leoslion.cn/pandorabox/17.09/packages/mipsel_1004kc_dsp/base
#!/bin/bash
## sysctl
init_sysctl() {
cat << EOF > /etc/sysctl.d/local.conf
# max open files
fs.file-max = 1024000
# max read buffer
net.core.rmem_max = 67108864
@yqt
yqt / ocserv.route.conf
Created October 4, 2015 15:16
cisco anyconnect ocserv.conf的路由选择,使用粗略路由。请注意,新的ocserv已经支持 no route命令,因此你可以指定中国的路由不经过vpn咯(这次没有展示,下次不上)
route = 23.0.0.0/255.0.0.0
route=31.13.0.0/255.255.0.0
route = 54.0.0.0/255.0.0.0
route=64.0.0.0/255.0.0.0
route=68.0.0.0/255.248.0.0
route=69.0.0.0/255.0.0.0
route = 74.0.0.0/255.0.0.0
route = 93.0.0.0/255.0.0.0
route = 96.0.0.0/255.0.0.0
#route = 100.0.0.0/248.0.0.0
@yqt
yqt / getIEVersion.js
Created January 24, 2014 08:16
get version of IE
var _IE = (function(){
var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : false ;
}());