Skip to content

Instantly share code, notes, and snippets.

@mo-han
mo-han / install-tag-cachedir.sh
Last active March 21, 2020 08:50
create/remove a CACHEDIR.TAG file inside the given directory
#!/bin/bash
curl -L https://gist.githubusercontent.com/mo-han/dff1e13f1fff8b5df0d1c8de57597a53/raw/69c68a0f77a0670f8d6cfa10139b7feb5a30f9f2/tag-cachedir.sh > /usr/local/bin/tagcachedir
chmod +x /usr/local/bin/tagcachedir
curl -L https://gist.githubusercontent.com/mo-han/dff1e13f1fff8b5df0d1c8de57597a53/raw/69ee94866357c69f9716449142580af9d4ea7901/untag-cachedir.sh > /usr/local/bin/untagcachedir
chmod +x /usr/local/bin/untagcachedir
splinter<0.8 (0.7.x) compatible with phantomjs
selenium<3.8 (3.7.x) last version supporting phantomjs
@mo-han
mo-han / pyseridge.py
Last active November 20, 2018 05:47
A serial port bridge monitor written by python3
#!/usr/bin/env python3
import queue
import signal
import sys
import threading
from datetime import datetime
from time import time
from serial import Serial
@mo-han
mo-han / 20-mf832s.sh
Last active June 17, 2018 09:16
OpenWrt/LEDE scripts for ZTE MF832S
#!/bin/sh
MF832S_PRODUCT="19d2/199/100"
MODEM=/dev/ttyUSB0
NETIF=network.interface.mf832s
[ "$PRODUCT" = "$MF832S_PRODUCT" ] && [ "${DEVICENAME##*.}" = "4" ] || exit
[ "$ACTION" = "remove" ] &&\
{ logger -t hotplug "MF832S: detach" &&\