Last active
October 13, 2019 14:30
-
-
Save imjamespond/ec52758aa22937327e65b9c3e4aede01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh_tunnel.sh | |
sed_reg_replacement_on_mac.sh | |
netcat udp hole punching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ((i=1; i<=$2; i ++)) | |
do | |
curl.exe $1/${i}.jpg -o ${i}.jpg | |
echo $i | |
done | |
for ((i=1; i<=100; i ++)) | |
do | |
echo $i | |
done | |
for i in {1..100} | |
do | |
echo $i | |
done | |
for i in `seq 1 100` | |
do | |
echo $i | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locah host | |
nc -up 22222 jamespond.eicp.net 11111 | |
remote host | |
nc -lu 11111 -v | |
send something from local... | |
remote host | |
netstat -plan | |
udp 0 0 104.194.77.241:11111 219.137.141.100:35247 ESTABLISHED 19946/nc | |
shutdown local nc | |
nc -lu 22222 | |
remote host | |
nc -up 11111 219.137.141.100 35247 | |
these commands above should run fast or the nat session will be expired soon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in ./*; do | |
if [ -f $f ]&&[ `echo $f | grep -c ".js" ` -gt 0 ]; then | |
echo `pwd`/$f | |
sed -E -i '' "s#\"/(management|service-center)/.*\"#GetAbsUrl(&)#" $f | |
sed -E -i '' "s#'/(management|service-center)/.*'#GetAbsUrl(&)#" $f | |
fi | |
done | |
########## | |
Page='./build/index.html' | |
CSS=`grep -oe '/html/static/css/main.*.css' $Page` | |
JS=`grep -oe '/html/static/js/main.*.js' $Page` | |
echo $CSS $JS | |
sed -E -i '' "s#/html/static/css/main\..*\.css#${CSS}#" ${FTL}/html-head.ftl | |
sed -E -i '' "s#/html/static/js/main\..*\.js#${JS}#" ${FTL}/html-foot.ftl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $(id -u) -ne 0 ]]; then | |
echo "Please run as root" | |
exit | |
fi | |
#echo "docker:1212" | chpasswd | |
#chmod 0600 ./qy1_rsa | |
LOCAL=${1:-'12300'} | |
REMOTE=${2:-'12300'} | |
while true | |
do | |
echo $(date)" ssh tunnel start..." | |
ssh -NT -o ExitOnForwardFailure=yes -o ServerAliveInterval=60 -o ServerAliveCountMax=100 \ | |
-R *:${REMOTE}:localhost:${LOCAL} git@121.201.24.170 -i ./qy1_rsa | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
find some file larger than
find . -type f -size +4096c
to find files bigger than 4096 bytes.
And :
find . -type f -size -4096c
to find files smaller than 4096 bytes.
Notice the + and - difference after the size switch.
The -size switch explained:
-size n[cwbkMG]