Skip to content

Instantly share code, notes, and snippets.

View ShawnHuang's full-sized avatar
😅
Happy investigating and coding

Shawn ShawnHuang

😅
Happy investigating and coding
View GitHub Profile
@ShawnHuang
ShawnHuang / google.sh
Last active December 21, 2015 06:39 — forked from deanet/google.sh
upload to google drive
if [ ! -f $1 ]
then
echo "please provide a file in arg"
exit -1
fi
#assign folder to upload
if [ -z "$2" ]
then
folderid="root"
#!/bin/sh
sudo /usr/share/ati/amd-uninstall.sh --force
cd /etc
sudo rm -rf ati
cd /usr/share
sudo rm -rf ati
@ShawnHuang
ShawnHuang / ufw.md
Created February 24, 2016 06:07 — forked from kimus/ufw.md
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

function string.fromhex(str)
return (str:gsub('..', function (cc)
return string.char(tonumber(cc, 16))
end))
end
function string.tohex(str)
return (str:gsub('.', function (c)
return string.format('%02X', string.byte(c))
end))
@ShawnHuang
ShawnHuang / WebSocketServer.sh
Created August 16, 2018 01:08 — forked from suxue/WebSocketServer.sh
simple WebSocket Server make use of netcat
#!/bin/ksh
typeset port=$((RANDOM % 60000))
while ((port < 30000)); do
port=$((RANDOM % 60000))
done
typeset pipe=`mktemp -u`
mkfifo $pipe
trap "rm -f $pipe" INT

#HOW-TO: Virtualize Raspian with Qemu

0.Workspace

mkdir -p ~/workspace/raspdev
cd ~/workspace/raspdev

1.Install Qemu