Skip to content

Instantly share code, notes, and snippets.

@lesgle
lesgle / routeros_ip_list_generator.sh
Created October 12, 2017 10:09 — forked from Jamesits/routeros_ip_list_generator.sh
Convert bgp.he.net search result to RouterOS IP List
#!/bin/bash
# https://gist.github.com/Jamesits/944ab9a484ad34522f6c4bce8d085132
# Captures every IP-CIDR notation in HTML file
# then convert it to RouterOS IP List format
# Usage: convert.sh source-file.html List-Name
# Then use /import file-name=List-Name.scr to
# import this list on RouterOS
# You can save bgp.he.net search result as HTML
# then use this script to convert.
@lesgle
lesgle / vps2routeros.sh
Created October 12, 2017 10:09 — forked from Jamesits/vps2routeros.sh
Convert your VPS to RouterOS - works on Ubuntu 16.04+. https://blog.swineson.me/install-routeros-on-any-ubuntu-vps/
#!/bin/bash
# VPS2RouterOS
#
# !!!!!!!!!PLEASE READ ALL THE FOLLOWING TEXT BEFORE RUNNING THIS!!!!!!!!!!!
#
# You can use `wget go.swineson.me/vps2routeros` to download this script
# if you have trouble in copy/paste. If you use `curl`, remember to add `-L`
# flag.
#
@lesgle
lesgle / reflect.py
Last active August 9, 2018 03:35 — forked from huyng/reflect.py
A simple echo server to inspect http web requests 一个简单的回送服务器,用于检查http web请求。
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@lesgle
lesgle / shadowiptables.sh
Created August 3, 2017 02:13 — forked from qwIvan/shadowiptables.sh
自动翻墙脚本,配合shadowsocks-libev的ss-redir使用,需要ipset(sudo apt-get install ipset)
#!/bin/bash
#自动翻墙脚本,配合shadowsocks-libev的ss-redir使用。需要ipset
chnroute_file=~/.chnroute
ignore_ips=(
45.32.50.160
45.127.93.239
103.214.68.175
0.0.0.0/8
10.0.0.0/8
127.0.0.0/8
@lesgle
lesgle / ffmpeg command line
Created March 23, 2016 01:47
ffmpeg command line
ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
<---fast/poor quality----------------------------------slow/good quality--->
Batch:
for %i in (G:\*.flv) do ffmpeg.exe -threads 4 -i %i -preset placebo -c:v libx264 -qp 25 -pix_fmt yuv420p -c:a libvo_aacenc -ac 2 -ar 22050 -b:a 64k "D:\TempData\3\%~ni.mp4"
JPG2AVI:
ffmpeg.exe -r 5/1 -i "D:\My Documents\Desktop\motion\Image%05d.jpg" -preset placebo -c:v libx264 -qp 1 -pix_fmt yuv420p "D:\My Documents\Desktop\Output_Lossless.mp4"
Sina:
# Surge for Mac 配置文件
# 显示 Finder 隐藏文件,将 .surge.conf 文件复制到 ~/ 也就是「个人」目录下。
[General]
# warning, notify, info, verbose
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10
loglevel = notify
# 默认 IP 和端口,不修改的话系统网络 HTTP 和 HTTPS 代理设置中就是 127.0.0.1:6152
@lesgle
lesgle / sip.conf
Created February 17, 2016 12:29 — forked from bao3/sip.conf
root@v2:~# cat /etc/asterisk/sip.conf
;=================================
; SIP Configuration for Asterisk
;
[general]
context=sip ;默认使用extension.conf中的sip字段
videosupport=yes ;打开视频支持,有些客户端(手机)支持视频
textsupport = yes ;短信支持
ccept_outofcall_message = yes
outofcall_message_context = messages