mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-05-12 03:35:02 -04:00
move shell scripts and zsh and add fav vscode themes
This commit is contained in:
parent
40077637ce
commit
e6794a8954
43 changed files with 55 additions and 34 deletions
27
README.md
27
README.md
|
@ -2,22 +2,25 @@
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
* **[shell scripts](shell_scripts)**
|
### dirs in this repo
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
* **[awk](awk)**
|
* **[awk](awk)**
|
||||||
* **[chef](chef)**
|
* **[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)**
|
* **[data science](data_science)**
|
||||||
* **[ubuntu](ubuntu)**
|
* **[elastic search](elasticsearch)**
|
||||||
* **[funny](funny)**
|
* **[funny](funny)**
|
||||||
|
* **[gcloud](gcloud)**
|
||||||
|
* **[git](git)**
|
||||||
|
* **[gpg](gpg)**
|
||||||
|
* **[iterm](iterm)**
|
||||||
|
* **[shell](shell)**
|
||||||
|
* **[tmux](tmux)**
|
||||||
|
* **[vim](vim)**
|
||||||
|
* **[vpn](vpn)**
|
||||||
|
* **[vscode](vscode)**
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,25 @@
|
||||||
Data Manipulation
|
## awk
|
||||||
-----------------
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
Print elements in the column 3 that has the word "good" in the other columns
|
### data manipulation
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
* print elements in the column 3 that has the word "good" in the other columns
|
||||||
|
|
||||||
```
|
```
|
||||||
$ awk '/good/ { print $3 }' inventory
|
$ awk '/good/ { print $3 }' inventory
|
||||||
```
|
```
|
||||||
|
|
||||||
Syntax:
|
* syntax:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ awk -f {PROGRAM FILE} FILENAME
|
$ awk -f {PROGRAM FILE} FILENAME
|
||||||
```
|
```
|
||||||
|
|
||||||
awk program is:
|
* awk program is:
|
||||||
|
|
||||||
```
|
```
|
||||||
PATTERN{
|
PATTERN{
|
||||||
|
@ -24,6 +29,9 @@ PATTERN{
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
with
|
||||||
|
|
||||||
|
```
|
||||||
. (Dot) Match any character
|
. (Dot) Match any character
|
||||||
* Match zero or more character
|
* Match zero or more character
|
||||||
^ Match beginning of line
|
^ Match beginning of line
|
||||||
|
@ -34,11 +42,15 @@ $ Match end of line
|
||||||
+ Match one more preceding
|
+ Match one more preceding
|
||||||
? Match zero or one preceding
|
? Match zero or one preceding
|
||||||
| Separate choices to match
|
| Separate choices to match
|
||||||
|
```
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
IF condition
|
### if condition
|
||||||
------------
|
|
||||||
|
<br>
|
||||||
|
|
||||||
```
|
```
|
||||||
if (condition)
|
if (condition)
|
|
@ -1,4 +1,6 @@
|
||||||
# Elastalert hacks
|
## elastalert hacks
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
```
|
```
|
||||||
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
|
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
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
# Some Quick and Useful Shell Commands
|
## some quick and useful shell commands
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
## Downloading all pdfs of url
|
* downloading all pdfs of url
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ wget --recursive --level=2 --no-directories --no-host-directories --accept pdf
|
$ 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
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## Extended attributes of files
|
|
||||||
|
* extended attributes of files
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ xattr -l $file
|
$ xattr -l $file
|
||||||
|
@ -19,7 +22,7 @@ $ xattr -l $file
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## Check signatures of Apps
|
* check signatures of apps
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -29,7 +32,7 @@ $ codesign -dvvv $file.app
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## Show all the configs
|
* show all the configs
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -39,7 +42,7 @@ $ system_profiler -detaillevel full
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## 瑪麗
|
* 瑪麗
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
|
@ -1,8 +1,8 @@
|
||||||
## Basic Tmux Usage
|
## basic tmux usage
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
* Starting a new (named session):
|
* starting a new (named session):
|
||||||
|
|
||||||
```
|
```
|
||||||
tmux new -s my_session
|
tmux new -s my_session
|
||||||
|
@ -11,12 +11,12 @@ tmux new -s my_session
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
* Detach the session with `Ctrl-b + d`.
|
* detach the session with `Ctrl-b + d`.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
* List sessions with:
|
* list sessions with:
|
||||||
|
|
||||||
```
|
```
|
||||||
tmux ls
|
tmux ls
|
||||||
|
@ -25,7 +25,7 @@ tmux ls
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
* Re-attach a session:
|
* re-attach a session:
|
||||||
|
|
||||||
```
|
```
|
||||||
tmux attach-session -t my_session
|
tmux attach-session -t my_session
|
||||||
|
@ -34,7 +34,7 @@ tmux attach-session -t my_session
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
* Reload a tmux config file:
|
* reload a tmux config file:
|
||||||
|
|
||||||
```
|
```
|
||||||
tmux source-file ~/.tmux.conf
|
tmux source-file ~/.tmux.conf
|
||||||
|
@ -43,7 +43,7 @@ tmux source-file ~/.tmux.conf
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
||||||
* Kill tmux
|
* kill tmux
|
||||||
|
|
||||||
```
|
```
|
||||||
tmux kill-server
|
tmux kill-server
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
# Cloud Scripts
|
## cloud and vpn scripts
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue