From ef644d42eca6b725fb69cfe8bb40425e18303c53 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Wed, 13 Nov 2013 22:48:32 +0100 Subject: [PATCH 1/9] Add python --- cheatsheets/python | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cheatsheets/python diff --git a/cheatsheets/python b/cheatsheets/python new file mode 100644 index 0000000..0dee0ec --- /dev/null +++ b/cheatsheets/python @@ -0,0 +1,8 @@ +# Basic example of server with python +# Will start a web server in the current dirrectory on port 8000 +# go to http://127.0.0.1:8000 + +# Python v2.7 +python -m SimpleHTTPServer +# Python 3 +python -m http.server 8000 From a200fdd52dad49e3617220995e78891c79b2be30 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Wed, 13 Nov 2013 22:52:06 +0100 Subject: [PATCH 2/9] Correct description for python --- cheatsheets/python | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cheatsheets/python b/cheatsheets/python index 0dee0ec..ca7f846 100644 --- a/cheatsheets/python +++ b/cheatsheets/python @@ -1,5 +1,7 @@ +# Desc: Python is a high-level programming language. + # Basic example of server with python -# Will start a web server in the current dirrectory on port 8000 +# Will start a WebServer in the current dirrectory on port 8000 # go to http://127.0.0.1:8000 # Python v2.7 From 3b48257b4504fda45686f03c43887cce1fed50ad Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Wed, 13 Nov 2013 22:55:19 +0100 Subject: [PATCH 3/9] Correct description for python --- cheatsheets/python | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cheatsheets/python b/cheatsheets/python index ca7f846..62c9e8d 100644 --- a/cheatsheets/python +++ b/cheatsheets/python @@ -1,7 +1,7 @@ # Desc: Python is a high-level programming language. # Basic example of server with python -# Will start a WebServer in the current dirrectory on port 8000 +# Will start a Web Server in the current directory on port 8000 # go to http://127.0.0.1:8000 # Python v2.7 From 6762bae8666f543ead4d1f098e5c02d735133ff7 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Wed, 13 Nov 2013 23:07:00 +0100 Subject: [PATCH 4/9] Add warning on netstat: netstat is deprecated and add the new command. --- cheatsheets/netstat | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cheatsheets/netstat b/cheatsheets/netstat index c479fae..d932ab2 100644 --- a/cheatsheets/netstat +++ b/cheatsheets/netstat @@ -1,3 +1,5 @@ +# WARNING ! netstat is deprecated. Look below. + # To view which users/processes are listening to which ports: sudo netstat -lnptu @@ -11,3 +13,16 @@ Example output: 1507/python # Fast display of ipv4 tcp listening programs sudo netstat -vtlnp --listening -4 + +# WARNING ! netstat is deprecated. +# Replace it by: +ss + +# For netstat-r +ip route + +# For netstat -i +ip -s link + +# For netstat-g +ip maddr From 663d72012d1c64dd376062250bf27f9e26795661 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Mon, 18 Nov 2013 10:08:18 +0100 Subject: [PATCH 5/9] [Add] dd --- cheatsheets/dd | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cheatsheets/dd diff --git a/cheatsheets/dd b/cheatsheets/dd new file mode 100644 index 0000000..c1db5f3 --- /dev/null +++ b/cheatsheets/dd @@ -0,0 +1,4 @@ +# Read from {/dev/urandom} 2*512 Bytes and put it into {/tmp/test.txt} +# Note: At the first iteration, we read 512 Bytes. +# Note: At the second iteration, we read 512 Bytes. +dd if=/dev/urandom of=/tmp/test.txt count=512 bs=2 From ad744eea9fbabe4cbe3eccc0383028df53e8f21b Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Mon, 25 Nov 2013 00:52:17 +0100 Subject: [PATCH 6/9] [Python] Add basic SMTP server --- cheatsheets/python | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cheatsheets/python b/cheatsheets/python index 62c9e8d..498cd15 100644 --- a/cheatsheets/python +++ b/cheatsheets/python @@ -8,3 +8,6 @@ python -m SimpleHTTPServer # Python 3 python -m http.server 8000 + +# SMTP-Server for debugging, messages will be discarded, and printed on stdout. +python -m smtpd -n -c DebuggingServer localhost:1025 From f42d28088c85b20dbc41e9e09481578366a9c40a Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Mon, 25 Nov 2013 13:44:30 +0100 Subject: [PATCH 7/9] [Change] grep Add find in files --- cheatsheets/grep | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cheatsheets/grep b/cheatsheets/grep index cd79eb5..aeb2de3 100644 --- a/cheatsheets/grep +++ b/cheatsheets/grep @@ -9,3 +9,7 @@ grep -R pattern folder # Getting pattern from file (one by line): grep -f pattern_file file + +# Find all files who contain {pattern} in the directory {directory}. +# This will show: "file:line my research" +grep -rnw 'directory' -e "pattern" From 8a3cd5dff2d6462deff673dfd747f1fccc357832 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Mon, 25 Nov 2013 20:07:32 +0100 Subject: [PATCH 8/9] [Change] Add new example for wget --- cheatsheets/wget | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cheatsheets/wget b/cheatsheets/wget index 0ba5a3c..d0bcd7b 100644 --- a/cheatsheets/wget +++ b/cheatsheets/wget @@ -10,11 +10,14 @@ wget -c http://path.to.the/file # To download multiples files with multiple URLs wget URL1 URL2 -# To parse a file that contains a list of URLs to fetch each one +# To parse a file that contains a list of URLs to fetch each one wget -i url_list.txt -# To download files according to a pattern +# To download files according to a pattern wget http://www.myserver.com/files-{1..15}.tar.bz2 # To download all the files in a directory with a specific extension if directory indexing is enabled wget -r -l1 -A.extension http://myserver.com/directory + +# Allows you to download just the headers of responses (-S --spider) and display them on Stdout (-O -). +wget -S --spider -O - http://google.com From c5ecad85fcdb99446bd831c2fb8086ffb05fd471 Mon Sep 17 00:00:00 2001 From: ImmortalPC Date: Mon, 25 Nov 2013 20:20:12 +0100 Subject: [PATCH 9/9] [Change] GCC Add some samples --- cheatsheets/gcc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cheatsheets/gcc b/cheatsheets/gcc index fa8b245..28a78c0 100644 --- a/cheatsheets/gcc +++ b/cheatsheets/gcc @@ -6,3 +6,16 @@ gcc -o file file.c # Debug symbols gcc -g + +# Debug with all symbols. +gcc -ggdb3 + +# Build for 64 bytes +gcc -m64 + +# Include the directory {/usr/include/myPersonnal/lib/} to the list of path for #include <....> +# With this option, no warning / error will be reported for the files in {/usr/include/myPersonnal/lib/} +gcc -isystem /usr/include/myPersonnal/lib/ + +# Build a GUI for windows (Mingw) (Will disable the term/console) +gcc -mwindows