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
#!/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 / plantUML
Created December 23, 2015 03:39
qumleditor with plantUML
@startuml
class Shape {
boolean : selected
int : x
int : y
int : depth
+paint()
}
@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.

1. offset vs addr ?
"有同學說他 invoke 也可以用 offset"
我的想法:
array 的位址一開始就配置在 data segment,位址是固定的,所以可以用 offset 來取值
var1 是執行時期才配置出來的記憶體空間,所以要透過 addr 來計算位址。
INCLUDE irvine32.inc
@ShawnHuang
ShawnHuang / avl.c
Created October 1, 2016 09:48
sort with avl
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
struct TNode{
struct ListNode *node;
@ShawnHuang
ShawnHuang / stdin.md
Last active January 22, 2017 01:54
stdin
$ find /etc/ -name passwd
find: /etc//cups/certs: Permission denied ->stderr(2)
/etc//pam.d/passwd ->stdout(1)
/etc//passwd

#Redirect stdout

http://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them
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
print("─────────────────────────▄▀▄")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─█")
print("─────────────────────────█─▀█▀█▄")
print("─────────────────────────█──█──█")
print("─────────────────────────█▄▄█──▀█")
print("────────────────────────▄█──▄█▄─▀█")