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 / gist:5647710
Last active May 3, 2022 11:15
101 Great Computer Programming Quotes

#Computers

“Computers are useless. They can only give you answers.” (Pablo Picasso)

“Computers are like bikinis. They save people a lot of guesswork.” (Sam Ewing)

“They have computers, and they may have other weapons of mass destruction.” (Janet Reno)

#HOW-TO: Virtualize Raspian with Qemu

0.Workspace

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

1.Install Qemu

@ShawnHuang
ShawnHuang / cvimrc
Created October 11, 2019 04:55
cvimrc
imap jj <esc>
https://superuser.com/questions/1027957/zsh-change-prompt-just-before-command-is-run
https://gist.github.com/PaulCapestany/4736311#file-oh-my-zsh-prompt
$ \curl -sSL https://get.rvm.io | bash
$ source /home/<user>/.rvm/scripts/rvm
$ rvm -v
$ rvm install ruby
$ ruby -v
$ sudo apt-get install rubygems
$ gem update
$ sudo apt-get install ruby-dev zlib1g-dev liblzma-dev build-essential patch
print("─────────────────────────▄▀▄")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─▀█▀█▄")
print("─────────────────────────█──█──█")
print("─────────────────────────█▄▄█──▀█")
print("────────────────────────▄█──▄█▄─▀█")
@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
@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))
http://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them