Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# ./coding-style.sh [File or Directory]
#
options="--style=kr
--mode=c
--indent=tab=4
--brackets=linux
--indent-labels
#!/bin/sh
#
DST=${1:-$PWD}
rm -f /tmp/result.txt
for i in $(find $DST -name "*"); do
file $i >/dev/null 2>&1
if [ $? -eq 0 ]; then
#!/bin/sh
#
REPO_URL=$1
CNAME=$2
PNAME=$3
LATES_TAG=
[ "REPO_URL" == "" ] && {
#!/bin/sh
#
## Use port 8080 to connect, 10.5.1.101 company DNS server
docker run -d \
-p 8080:8080 -p 50000:50000 \
--name=jenkins-2.7.3 \
--dns=10.5.1.101 \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
#!/bin/sh
#
VERSION=2.60.3
## 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
#
# test-uci-set-commit.sh [config name] [number of entry]
#
usage() {
echo "test-uci-set-commit.sh [config name] [number of entry]"
}
# $1: argc
#!/bin/sh
#
# Apple OUI = D8:96:95
BASE="d8:96:95:08:97"
FROM=$1
TO=$2
if [ -e $FROM ]; then FROM=1; fi
if [ -e $TO ]; then TO=1; fi
#!/bin/sh
#
# ping-via-gateway.sh [Destination IP Address] [Default Gateway IP Address] [Output Interface Name]
#
SRC_IP=
DST_IP=$1
DEFAULT_GW=$2
OUT_INF=$3
#!/bin/sh
#
for i in $(ip6tables -S | awk '{print $2}' | uniq); do
ip6tables -F $i
ip6tables -Z $i
ip6tables -X $i
done
ip6tables -F INPUT
@dan82840
dan82840 / test-oap-state.sh
Last active August 15, 2018 09:36
test-oap-state.sh
#!/bin/sh
#
. /lib/oap/uci.sh
_foreach_wifi_iface_cb() {
local section=$1
local ifname=$(oap_state_get wireless.$section.ifname)
local ssid=$(oap_state_get wireless.$section.ssid)