diff --git a/README.md b/README.md index 6c1ff97..216dff6 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,25 @@
-* **[shell scripts](shell_scripts)** +### dirs in this repo + +
+ * **[awk](awk)** * **[chef](chef)** -* **[git](git)** -* **[pgp](gpg)** -* **[tmux](tmux)** -* **[iterm](iterm)** -* **[network](network)** -* **[gcloud](gcloud)** -* **[vim](vim)** -* **[vscode](vscode)** -* **[vpn](vpn)** -* **[elastic search](elasticsearch)** * **[data science](data_science)** -* **[ubuntu](ubuntu)** +* **[elastic search](elasticsearch)** * **[funny](funny)** +* **[gcloud](gcloud)** +* **[git](git)** +* **[gpg](gpg)** +* **[iterm](iterm)** +* **[shell](shell)** +* **[tmux](tmux)** +* **[vim](vim)** +* **[vpn](vpn)** +* **[vscode](vscode)** +
diff --git a/awk/AWK_TIPS.md b/awk/README.md similarity index 74% rename from awk/AWK_TIPS.md rename to awk/README.md index 3934e8b..4ba5ad9 100644 --- a/awk/AWK_TIPS.md +++ b/awk/README.md @@ -1,20 +1,25 @@ -Data Manipulation ------------------ +## awk + +
-Print elements in the column 3 that has the word "good" in the other columns +### data manipulation + +
+ +* print elements in the column 3 that has the word "good" in the other columns ``` $ awk '/good/ { print $3 }' inventory ``` -Syntax: +* syntax: ``` $ awk -f {PROGRAM FILE} FILENAME ``` -awk program is: +* awk program is: ``` PATTERN{ @@ -24,6 +29,9 @@ PATTERN{ } ``` +with + +``` . (Dot) Match any character * Match zero or more character ^ Match beginning of line @@ -34,11 +42,15 @@ $ Match end of line + Match one more preceding ? Match zero or one preceding | Separate choices to match +``` +
+--- -IF condition ------------- +### if condition + +
``` if (condition) diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 860b061..1078c96 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -1,4 +1,6 @@ -# Elastalert hacks +## elastalert hacks + +
``` curl -s logs.HOST.com:9200/logstash-2017.09.08/_search\?q=ty_params.ProcessName:osqueryd\&size=10000\&sort=@timestamp:desc | jq -r '.hits.hits[]._source.ty_params.Username' | sort | uniq -c | sort -nr diff --git a/shell_scripts/SHELL_USEFUL.md b/shell/README.md similarity index 69% rename from shell_scripts/SHELL_USEFUL.md rename to shell/README.md index 0d6394e..1ed8a32 100644 --- a/shell_scripts/SHELL_USEFUL.md +++ b/shell/README.md @@ -1,9 +1,11 @@ -# Some Quick and Useful Shell Commands +## some quick and useful shell commands
-## Downloading all pdfs of url +* downloading all pdfs of url + +
```shell $ wget --recursive --level=2 --no-directories --no-host-directories --accept pdf @@ -11,7 +13,8 @@ $ wget --recursive --level=2 --no-directories --no-host-directories --accept pdf
-## Extended attributes of files + +* extended attributes of files ```shell $ xattr -l $file @@ -19,7 +22,7 @@ $ xattr -l $file
-## Check signatures of Apps +* check signatures of apps
@@ -29,7 +32,7 @@ $ codesign -dvvv $file.app
-## Show all the configs +* show all the configs
@@ -39,7 +42,7 @@ $ system_profiler -detaillevel full
-## 瑪麗 +* 瑪麗
diff --git a/shell_scripts/SAB.sh b/shell/shell_scripts/SAB.sh similarity index 100% rename from shell_scripts/SAB.sh rename to shell/shell_scripts/SAB.sh diff --git a/shell_scripts/USENET.sh b/shell/shell_scripts/USENET.sh similarity index 100% rename from shell_scripts/USENET.sh rename to shell/shell_scripts/USENET.sh diff --git a/shell_scripts/backup.sh b/shell/shell_scripts/backup.sh similarity index 100% rename from shell_scripts/backup.sh rename to shell/shell_scripts/backup.sh diff --git a/shell_scripts/bye.sh b/shell/shell_scripts/bye.sh similarity index 100% rename from shell_scripts/bye.sh rename to shell/shell_scripts/bye.sh diff --git a/shell_scripts/check_if_req_are_update.sh b/shell/shell_scripts/check_if_req_are_update.sh similarity index 100% rename from shell_scripts/check_if_req_are_update.sh rename to shell/shell_scripts/check_if_req_are_update.sh diff --git a/network/check_port.sh b/shell/shell_scripts/check_port_network.sh similarity index 100% rename from network/check_port.sh rename to shell/shell_scripts/check_port_network.sh diff --git a/shell_scripts/check_time_zone.sh b/shell/shell_scripts/check_time_zone.sh similarity index 100% rename from shell_scripts/check_time_zone.sh rename to shell/shell_scripts/check_time_zone.sh diff --git a/shell_scripts/find_if_file_exists.sh b/shell/shell_scripts/find_if_file_exists.sh similarity index 100% rename from shell_scripts/find_if_file_exists.sh rename to shell/shell_scripts/find_if_file_exists.sh diff --git a/shell_scripts/i2p.sh b/shell/shell_scripts/i2p.sh similarity index 100% rename from shell_scripts/i2p.sh rename to shell/shell_scripts/i2p.sh diff --git a/shell_scripts/lessons/TRICKS.md b/shell/shell_scripts/lessons/TRICKS.md similarity index 100% rename from shell_scripts/lessons/TRICKS.md rename to shell/shell_scripts/lessons/TRICKS.md diff --git a/shell_scripts/lessons/arguments.ssh b/shell/shell_scripts/lessons/arguments.ssh similarity index 100% rename from shell_scripts/lessons/arguments.ssh rename to shell/shell_scripts/lessons/arguments.ssh diff --git a/shell_scripts/lessons/average_number.sh b/shell/shell_scripts/lessons/average_number.sh similarity index 100% rename from shell_scripts/lessons/average_number.sh rename to shell/shell_scripts/lessons/average_number.sh diff --git a/shell_scripts/lessons/case_loop_example.sh b/shell/shell_scripts/lessons/case_loop_example.sh similarity index 100% rename from shell_scripts/lessons/case_loop_example.sh rename to shell/shell_scripts/lessons/case_loop_example.sh diff --git a/shell_scripts/lessons/cheesboard.sh b/shell/shell_scripts/lessons/cheesboard.sh similarity index 100% rename from shell_scripts/lessons/cheesboard.sh rename to shell/shell_scripts/lessons/cheesboard.sh diff --git a/shell_scripts/lessons/echo_cmds.sh b/shell/shell_scripts/lessons/echo_cmds.sh similarity index 100% rename from shell_scripts/lessons/echo_cmds.sh rename to shell/shell_scripts/lessons/echo_cmds.sh diff --git a/shell_scripts/lessons/factorial.sh b/shell/shell_scripts/lessons/factorial.sh similarity index 100% rename from shell_scripts/lessons/factorial.sh rename to shell/shell_scripts/lessons/factorial.sh diff --git a/shell_scripts/lessons/file_descriptors.sh b/shell/shell_scripts/lessons/file_descriptors.sh similarity index 100% rename from shell_scripts/lessons/file_descriptors.sh rename to shell/shell_scripts/lessons/file_descriptors.sh diff --git a/shell_scripts/lessons/for_loop_example.sh b/shell/shell_scripts/lessons/for_loop_example.sh similarity index 100% rename from shell_scripts/lessons/for_loop_example.sh rename to shell/shell_scripts/lessons/for_loop_example.sh diff --git a/shell_scripts/lessons/getopts.sh b/shell/shell_scripts/lessons/getopts.sh similarity index 100% rename from shell_scripts/lessons/getopts.sh rename to shell/shell_scripts/lessons/getopts.sh diff --git a/shell_scripts/lessons/hex_converter_real_numbers.sh b/shell/shell_scripts/lessons/hex_converter_real_numbers.sh similarity index 100% rename from shell_scripts/lessons/hex_converter_real_numbers.sh rename to shell/shell_scripts/lessons/hex_converter_real_numbers.sh diff --git a/shell_scripts/lessons/if_example.sh b/shell/shell_scripts/lessons/if_example.sh similarity index 100% rename from shell_scripts/lessons/if_example.sh rename to shell/shell_scripts/lessons/if_example.sh diff --git a/shell_scripts/lessons/inputs.sh b/shell/shell_scripts/lessons/inputs.sh similarity index 100% rename from shell_scripts/lessons/inputs.sh rename to shell/shell_scripts/lessons/inputs.sh diff --git a/shell_scripts/lessons/linux_console.sh b/shell/shell_scripts/lessons/linux_console.sh similarity index 100% rename from shell_scripts/lessons/linux_console.sh rename to shell/shell_scripts/lessons/linux_console.sh diff --git a/shell_scripts/lessons/menu_fancy.sh b/shell/shell_scripts/lessons/menu_fancy.sh similarity index 100% rename from shell_scripts/lessons/menu_fancy.sh rename to shell/shell_scripts/lessons/menu_fancy.sh diff --git a/shell_scripts/lessons/real_numbers.sh b/shell/shell_scripts/lessons/real_numbers.sh similarity index 100% rename from shell_scripts/lessons/real_numbers.sh rename to shell/shell_scripts/lessons/real_numbers.sh diff --git a/shell_scripts/lessons/red_hello_world.sh b/shell/shell_scripts/lessons/red_hello_world.sh similarity index 100% rename from shell_scripts/lessons/red_hello_world.sh rename to shell/shell_scripts/lessons/red_hello_world.sh diff --git a/shell_scripts/lessons/shell_variables.sh b/shell/shell_scripts/lessons/shell_variables.sh similarity index 100% rename from shell_scripts/lessons/shell_variables.sh rename to shell/shell_scripts/lessons/shell_variables.sh diff --git a/shell_scripts/lessons/while_loop_example.sh b/shell/shell_scripts/lessons/while_loop_example.sh similarity index 100% rename from shell_scripts/lessons/while_loop_example.sh rename to shell/shell_scripts/lessons/while_loop_example.sh diff --git a/shell_scripts/menu.sh b/shell/shell_scripts/menu.sh similarity index 100% rename from shell_scripts/menu.sh rename to shell/shell_scripts/menu.sh diff --git a/ubuntu/post_install_ubuntu.sh b/shell/shell_scripts/post_install_ubuntu.sh similarity index 100% rename from ubuntu/post_install_ubuntu.sh rename to shell/shell_scripts/post_install_ubuntu.sh diff --git a/shell_scripts/red_hello_world.sh b/shell/shell_scripts/red_hello_world.sh similarity index 100% rename from shell_scripts/red_hello_world.sh rename to shell/shell_scripts/red_hello_world.sh diff --git a/shell_scripts/rsync.sh b/shell/shell_scripts/rsync.sh similarity index 100% rename from shell_scripts/rsync.sh rename to shell/shell_scripts/rsync.sh diff --git a/shell_scripts/secure_pan.sh b/shell/shell_scripts/secure_pan.sh similarity index 100% rename from shell_scripts/secure_pan.sh rename to shell/shell_scripts/secure_pan.sh diff --git a/shell_scripts/sshfs.sh b/shell/shell_scripts/sshfs.sh similarity index 100% rename from shell_scripts/sshfs.sh rename to shell/shell_scripts/sshfs.sh diff --git a/shell_scripts/system_info.sh b/shell/shell_scripts/system_info.sh similarity index 100% rename from shell_scripts/system_info.sh rename to shell/shell_scripts/system_info.sh diff --git a/zsh/README.md b/shell/zsh/README.md similarity index 100% rename from zsh/README.md rename to shell/zsh/README.md diff --git a/zsh/zshrc b/shell/zsh/zshrc similarity index 100% rename from zsh/zshrc rename to shell/zsh/zshrc diff --git a/tmux/README.md b/tmux/README.md index 624939c..f7495aa 100644 --- a/tmux/README.md +++ b/tmux/README.md @@ -1,8 +1,8 @@ -## Basic Tmux Usage +## basic tmux usage
-* Starting a new (named session): +* starting a new (named session): ``` tmux new -s my_session @@ -11,12 +11,12 @@ tmux new -s my_session
-* Detach the session with `Ctrl-b + d`. +* detach the session with `Ctrl-b + d`.
-* List sessions with: +* list sessions with: ``` tmux ls @@ -25,7 +25,7 @@ tmux ls
-* Re-attach a session: +* re-attach a session: ``` tmux attach-session -t my_session @@ -34,7 +34,7 @@ tmux attach-session -t my_session
-* Reload a tmux config file: +* reload a tmux config file: ``` tmux source-file ~/.tmux.conf @@ -43,7 +43,7 @@ tmux source-file ~/.tmux.conf
-* Kill tmux +* kill tmux ``` tmux kill-server diff --git a/vpn/README.md b/vpn/README.md index 8c2bf3f..ebbcfbb 100644 --- a/vpn/README.md +++ b/vpn/README.md @@ -1 +1,2 @@ -# Cloud Scripts +## cloud and vpn scripts +