Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
SSH=/usr/bin/ssh
SSH_CONNECT_TIMEOUT=5
for i in $(seq 1 3); do
eval "$SSH -o ConnectTimeout=$SSH_CONNECT_TIMEOUT $@"
ret=$?
if [ $ret -eq 0 -o $ret -eq 127 ]; then
#!/bin/sh /etc/rc.common
#
# inotify-dir.sh start [dir/to/monitor]
# stop
#
_inotify() {
local dir="$1"
local d
#/bin/sh
#
# ref: https://gist.github.com/braian87b/64440dec125d2b2f0ddc600c490988db
#
# a new network interface for tun:
uci set network.rogervpn=interface
uci set network.rogervpn.proto='none' #dhcp #none
uci set network.rogervpn.ifname='tun0'
#!/bin/sh
#
VERSION=2.194
## Use port 8080 to connect, 10.5.1.101 company DNS server
docker run -d \
-p 8080:8080 -p 50000:50000 \
--name=jenkins-$VERSION \
--restart always \
#!/bin/sh
#
# setup-moti-fitness-data-v2.sh [MAC Address] {[Sleep Time]}
MAC=${1:-DB:52:25:C6:33:58}
ST=${2:-600}
echo "Sync time !!!"
moti $MAC write 0x001f FD1004894AD15CFE
#!/bin/sh
#
MAC=DB:52:25:C6:33:58
echo "Sync time !!!"
test-moti-client $MAC write 0x001f FD1004894AD15CFE
echo "Finish Data !!!"
test-moti-client $MAC write 0x001f FD400101FE
@dan82840
dan82840 / show-task-states.ttl
Last active February 25, 2019 02:07
Show Kernel Task Information by Magic Sysrq
; Calls the help messgges of Magic SysRq(Linux).
sendbreak
send 't'
#!/bin/sh
#
# Run this script under openwrt box
#
MAX_DL_RATE=1000
MAX_UP_RATE=1000
tc() {
local ret
@dan82840
dan82840 / udhcpc.user
Created October 16, 2018 03:50
Put udhcpc.user to /etc/udhcpc.user
#!/bin/sh
#
echo "$@" >>/tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
set >> /tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
-- Test-MIB.my
Test-MIB DEFINITIONS ::= BEGIN
IMPORTS
OBJECT-GROUP, MODULE-COMPLIANCE, NOTIFICATION-GROUP
FROM SNMPv2-CONF
enterprises, Integer32, Unsigned32, OBJECT-TYPE, MODULE-IDENTITY,
NOTIFICATION-TYPE
FROM SNMPv2-SMI
DisplayString