Last active
October 19, 2021 12:33
Revisions
-
chesio revised this gist
Oct 19, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,8 +25,8 @@ alias lesss='less -S' alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' # - get list of all URLs on the website excluding asset files alias wget_spider="wget --spider -r https://www.hpe.at 2>&1 | grep '^--' | awk '{ print $3 }' | grep -v '\.\(css\|js\|png\|gif\|jpg\|jpeg\|webp\)$'" ## Git -
chesio revised this gist
Oct 19, 2021 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,12 +19,15 @@ alias lfc='find . -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$d alias lesss='less -S' ## curl and wget # - show response headers alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' # - get list of all URLs on the website alias wget_spider="wget --spider -r https://www.hpe.at 2>&1 | grep '^--' | awk '{ print $3 }' | grep -v '\.\(css\|js\|png\|gif\|jpg\|JPG\)$'" ## Git -
chesio revised this gist
Feb 10, 2021 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,9 @@ alias lu='ls | xargs -d "\n" du -sh' # - [l]ist [u]sage [s]orted alias lus='ls | xargs -d "\n" du -sh | sort -hr' # - list file counts per directory alias lfc='find . -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done' # - [less] with e[s] alias lesss='less -S' -
chesio revised this gist
Jul 25, 2019 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,6 +39,8 @@ alias npm_list_flat='npm list --depth=0' # - convert Windows line endings with Unix line endings [i]n place (= needs filename) alias dos2unix='sed -i "s/\r//g"' # - convert Windows line endings in specific text files (CSS, HTML, JS, PHP and TXT) in current directory alias convert-line-endings="find . \( -name '*.css' -o -name '*.html' -o -name '*.js' -o -name '*.php' -o -name '*.txt' \) -type f -execdir sed -i 's/\r//g' '{}' +" # - drop any lines that are visually empty (ie. have only tabs and spaces) alias remove-empty-lines='sed "/^\s*$/d"' -
chesio revised this gist
Dec 20, 2018 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,12 +22,14 @@ alias lesss='less -S' alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' ## Git # - reset local commits, stash the changes, pull from remote and reapply them from stash alias reroll_local_commits='git reset --soft HEAD^ && git stash && git pull && git stash pop' ## NPM # - list installed packages without dependencies (append -g to display globally installed packages) alias npm_list_flat='npm list --depth=0' -
chesio renamed this gist
Dec 20, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
chesio revised this gist
Dec 20, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,10 @@ alias lesss='less -S' alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' # Git # - reset local commits, stash the changes, pull from remote and reapply them from stash alias reroll_local_commits='git reset --soft HEAD^ && git stash && git pull && git stash pop' # NPM -
chesio revised this gist
Nov 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ alias curl_headers='curl -s -I -X GET' # NPM # - list installed packages without dependencies (append -g to display globally installed packages) alias npm_list_flat='npm list --depth=0' -
chesio revised this gist
Nov 29, 2018 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,12 @@ alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' # NPM # List installed packages without dependencies (append -g to display globally installed packages) alias npm_list_flat='npm list --depth=0' ## Working with text files # - convert Windows line endings with Unix line endings [i]n place (= needs filename) -
chesio revised this gist
Oct 2, 2018 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,11 +23,20 @@ alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' ## Working with text files # - convert Windows line endings with Unix line endings [i]n place (= needs filename) alias dos2unix='sed -i "s/\r//g"' # - drop any lines that are visually empty (ie. have only tabs and spaces) alias remove-empty-lines='sed "/^\s*$/d"' # - drop any lines that are (truly) empty alias remove-truly-empty-lines='sed "/^$/d"' ## Random utils # - pseudo random string (append length parameter) alias pseudorandomstring='< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c' -
chesio revised this gist
Sep 14, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,9 @@ alias curl_headers='curl -s -I -X GET' ## Random utils # - convert Windows line endings with Unix line endings [i]n place (= needs filename) alias dos2unix='sed -i "s/\r//g"' # - pseudo random string (append length parameter) alias pseudorandomstring='< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c' -
chesio revised this gist
Jul 6, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ alias rsync_web='rsync -rltzv --delete' ## Sysadmin # Debian: list all services ([-] stopped or [+] running) alias list_services='service --status-all' -
chesio revised this gist
Jul 6, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,4 @@ alias rsync_web='rsync -rltzv --delete' ## Sysadmin # Debian: list all services ([-] stopped or [+] running) list_services='service --status-all' -
chesio revised this gist
Jul 6, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,6 +42,8 @@ alias rsync_repo='rsync -rtzv --delete --delete-excluded --exclude=".*"' # Params: -[r]ecursive -preserve sym[l]inks -preserve [t]imestamps -compre[z] -[v]erbose alias rsync_web='rsync -rltzv --delete' ## Sysadmin # Debian: list all services ([-] stopped or [+] running) service --status-all -
chesio revised this gist
Jul 6, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,3 +41,7 @@ alias rsync_repo='rsync -rtzv --delete --delete-excluded --exclude=".*"' # Example: rsync_web ~/local/project_dir/ ~/remote/project_dir/web/ # Params: -[r]ecursive -preserve sym[l]inks -preserve [t]imestamps -compre[z] -[v]erbose alias rsync_web='rsync -rltzv --delete' ## Sysadmin # Debian: list all services ([-] stopped or [+] running) service --status-all -
chesio created this gist
Jun 24, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ ## Working with shell # - [r]e[m]ove [d]irectory alias rmd='rm -rf' # - [l]ist in [h]uman format alias lh='ls -lh' # - [l]ist [u]sage alias lu='ls | xargs -d "\n" du -sh' # - [l]ist [u]sage [s]orted alias lus='ls | xargs -d "\n" du -sh | sort -hr' # - [less] with e[s] alias lesss='less -S' ## cUrl # - show response headers alias curl_headers='curl -s -I -X GET' # alias curl_headers='curl -s -D - -o /dev/null' ## Random utils # - pseudo random string (append length parameter) alias pseudorandomstring='< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c' ## Syncing (and deploying) # Sync a (git) repository # Params: -[r]ecursive -preserve [t]imestamps -compre[z] -[v]erbose # Also, exclude any hidden files and directories. alias rsync_repo='rsync -rtzv --delete --delete-excluded --exclude=".*"' # Deploy web (development to production) via rsync # Note: add trailing slash to <src-dir> in order to sync directory contents rather than directory itself (adding trailing slash to <tgt-dir> makes no difference) # Example: rsync_web ~/local/project_dir/ ~/remote/project_dir/web/ # Params: -[r]ecursive -preserve sym[l]inks -preserve [t]imestamps -compre[z] -[v]erbose alias rsync_web='rsync -rltzv --delete'