Skip to content

Instantly share code, notes, and snippets.

View qyin's full-sized avatar

Qiang Yin qyin

  • Shanghai, China
View GitHub Profile
@iongion
iongion / wsl-ext4-drivemount.py
Created April 14, 2025 10:49
WSL physical ext4 drive mount utility with normal user permissions - useful in dual boot and others
"""
# WSL ext4 drive mount utility
- Able to automatically mount `\\.\PHYSICALDRIVE{X}` to a desired path
- Mounted with normal user permissions (you don't need root)
## Setup
Create a `settings.json` next to the python script itself with the following:
@Mygod
Mygod / export-ble-infos.py
Last active September 17, 2025 08:55
Export your Windows Bluetooth LE keys into Linux!
#!/usr/bin/python3
"""
Copyright 2021 Mygod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@antillean
antillean / le-sub.example.com-renewal.sh
Last active March 18, 2020 19:05
Let's Encrypt renewal script for VSFTPD, mumble-server (and possibly other things)
#!/bin/sh
## Some notes:
## 1. This should be run as root!
## 2. This assumes that /etc/letsencrypt/cli.ini is sensibly specified.
## 3. /usr/local/sbin/le-sub.example.com-renewal.sh is a sensible place to put this.
## 4. A sensible crontab entry for this: 15 2 * * 1 /usr/local/sbin/le-sub.example.com-renewal.sh >> /var/log/le-sub.example.com-renewal.log
exp_limit=15;
le_path='/opt/letsencrypt';
@benmaughan
benmaughan / readme.markdown
Created November 29, 2015 23:01 — forked from larrybotha/readme.markdown
Postfix Using Gmail SMTP in Mac OSX Mavericks
@janlay
janlay / README.md
Last active October 19, 2025 11:30
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@luginbash
luginbash / ocsetup.sh
Last active December 13, 2018 06:05
setting up ocserv (open source AnyConnect alternative) on a new Debian, use passwd auth by default
echo "this file isn't supposed to run"
exit 0
# <------------------------------ Enviroment Variables ------------------------------->
FQDN = <Server DNS Name> # can also get from PTR record
ORG_NAME = <Org name>
RELEASE_NAME = $(lsb_release -sc)
# <------------------------------ Network Stack Setups ------------------------------->
# Please edit /etc/default/ufw first
@laurenorsini
laurenorsini / MakeOpenVPN.sh
Last active June 25, 2025 05:19
MakeOpenVPN.sh by Eric Jodoin
#!/bin/bash
# Default Variable Declarations
DEFAULT="Default.txt"
FILEEXT=".ovpn"
CRT=".crt"
KEY=".3des.key"
CA="ca.crt"
TA="ta.key"
@kevinzhow
kevinzhow / route.sh
Last active October 2, 2022 08:01
AnyConnect 路由表
route = 8.0.0.0/255.0.0.0
route = 58.0.0.0/255.0.0.0
route = 23.0.0.0/255.0.0.0
route = 117.0.0.0/255.0.0.0
route = 199.0.0.0/255.0.0.0
route = 190.0.0.0/255.0.0.0
route = 198.0.0.0/255.0.0.0
route = 173.0.0.0/255.0.0.0
route = 174.0.0.0/255.0.0.0
route = 168.0.0.0/255.0.0.0
@robertpfeiffer
robertpfeiffer / headers.txt
Created September 27, 2011 11:06
XeTex für Org Mode
#+LATEX_CMD: xelatex
#+LATEX_HEADER: \setmainfont[Mapping=tex-text]{Gentium}
#+LATEX_HEADER: \setdefaultlanguage{german}
@tlatsas
tlatsas / gmail-tunnel.sh
Created September 9, 2011 12:15
tunel gmail imap though your server
#!/bin/sh
# Tunnel imap connection through your server
_server="your-server-here"
_port="your-server-port-here"
_username="your-server-login-name"
# tunnel gmail imap (imap.gmail.com:993) <-> (localhost:10993)
ssh -f -N -L localhost:10993:imap.gmail.com:993 -p ${_port} -l ${_username} ${_server}