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("โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–„โ–ˆโ”€โ”€โ–„โ–ˆโ–„โ”€โ–€โ–ˆ")