This is a document about how to test HTTP requests by running openssl or nc
- Edit payload, pathanme, ip etc
# Find filename with gcc under folder /usr | |
find /usr -name gcc | |
# Find directory based on filename gcc under folder /usr | |
find /usr -type d -name gcc | |
# Find file which modified today under current directory | |
find -type f -mtime 0 | |
# Find file which filesize is zero |
# Look up hostname using dns | |
host linuxfoundation.org | |
# To look up name server interactively | |
nslookup linuxfoundation.org | |
# To look up domain name server information from the name server | |
dig linuxfoundation.org | |
# redirect stdout | |
echo "hello" > a.out | |
# redirect stderr | |
echo "hello" 2> a.out | |
# redirect both of them | |
echo "hello" > a.out 2>&1 | |
# shortcut | |
echo "hello" >& a.out |
# Extract files fomr mydir.tar | |
tar xvf mydir.tar | |
# Create the archive for file mydir and compress with gzip | |
tar zcvf mydir.tar.gz mydir | |
# Create the archive for file mydir and compress with bz2 | |
tar jcvf mydir.tar.bz2 mydir | |
# Create the archive for file mydir and compress with xz |
# [MUST] Define user information which will be recorded in any newly created commits | |
[user] | |
name = Mond Wan | |
email = [email protected] | |
# [OPTIONAL] Define personal working preferences | |
[core] | |
# for window, use true | |
# for linux, MacOS, use input | |
autocrlf = input | |
editor = vim |
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"node": true, | |
"amd": true | |
}, | |
"settings": { | |
"ecmascript": 6, | |
"jsx": true |
from bisect import bisect_left | |
# Source https://docs.python.org/2/library/bisect.html | |
def index(a, x): | |
'Locate the leftmost value exactly equal to x' | |
i = bisect_left(a, x) | |
if i != len(a) and a[i] == x: | |
return i | |
raise ValueError |
from treelib import Tree | |
tree = Tree() | |
# Create a tree for demo purpose | |
tree.create_node('A', 'a') | |
tree.create_node('B', 'b', parent='a') | |
tree.create_node('C', 'c', parent='a') | |
tree.create_node('D', 'd', parent='b') | |
tree.create_node('E', 'e', parent='b') | |
tree.create_node('F', 'f', parent='c') |
from treelib import Tree | |
tree = Tree() | |
# Create a tree for demo purpose | |
tree.create_node('A', 'a') | |
tree.create_node('B', 'b', parent='a') | |
tree.create_node('C', 'c', parent='a') | |
tree.create_node('D', 'd', parent='b') | |
tree.create_node('E', 'e', parent='b') | |
tree.create_node('F', 'f', parent='c') |