🖥️my_neue

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the my_neue command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███╗   ███╗██╗   ██╗     ███╗   ██╗███████╗██╗   ██╗███████╗
#                ████╗ ████║╚██╗ ██╔╝     ████╗  ██║██╔════╝██║   ██║██╔════╝
#                ██╔████╔██║ ╚████╔╝      ██╔██╗ ██║█████╗  ██║   ██║█████╗  
#                ██║╚██╔╝██║  ╚██╔╝       ██║╚██╗██║██╔══╝  ██║   ██║██╔══╝  
#                ██║ ╚═╝ ██║   ██║███████╗██║ ╚████║███████╗╚██████╔╝███████╗
#                ╚═╝     ╚═╝   ╚═╝╚══════╝╚═╝  ╚═══╝╚══════╝ ╚═════╝ ╚══════╝
                                                                            

tshark -ni en0 -Y "bootp.option.type == 53" -T fields -e bootp.option.hostname -e eth.src_resolved 
# See who's on the Starbucks WiFi with you 

# The solution is to convert the file to Unix line endings.
# This can be done using the dos2unix program:
dos2unix run-nw
# Or open the file in Vim and run the following command before saving:
:set fileformat=unix

[Ctrl-b] s 
# Have more than one tmux sessions running? Start tmux first and this keystroke lets you choose other tmux sessions easily.

[command] 2> >(fb=$(dd bs=1 count=1 2>/dev/null | od -t o1 -A n); [ "$fb" ] && err=$(printf "\\${fb# }"; cat) && echo "ERROR - $err")
# Add Rudimentary Logging Levels According to STDOUT/STDERR. This is a bit of a bash hack to catch STDERR and append a log level to it. So for example, if your script has pseudo loglevels like so: echo "INFO - finding files"

[ -f ${files} ] || echo "WARN - no files found"
# Any subcommands that write to STDERR will screw that up

2> >(fb=$(dd bs=1 count=1 2>/dev/null | od -t o1 -A n); [ "$fb" ] && err=$(printf "\\${fb# }"; cat) && echo "ERROR - $err") 
# Adding to the command does the following:
#		 2>								Redirect STDERR
#		 >(								Spawn a subshell (STDERR is then redirected to the file descriptor for this subshell)
#		 fb=$(....)					get the first byte of input
#		 [ "$fb" ]						test if there is a first byte
#		 && err=$(printf....)		save the output to the $err variable
#		 && echo "ERROR - $err"	append your pseudo loglevel and the error message

################################################# yes/no Abfrage - Möglichkeit 01
while true; do
    read -p "Do you wish to install this program?" yn
    case $yn in
        [Yy]* ) make install; break;;
        [Nn]* ) exit;;
        * ) echo "Please answer yes or no.";;
    esac
done
#################################################

# oder

################################################# yes/no Abfrage - Möglichkeit 02
echo "Do you wish to install this program?"
select yn in "Yes" "No"; do
    case $yn in
        Yes ) make install; break;;
        No ) exit;;
    esac
done
#################################################

shell-pipe-status.sh
<command> | tee out.txt; test ${PIPESTATUS[0]} -eq 0
echo ${PIPESTATUS[*}} all status in commands

# bash-parse-href-url.sh
shopt -s nocasematch    #Dont care about the character case
text='<a href="http://www.google.com/here2;i=!mfo1iu489fn1o2jlk21m4098mdoi">"test link"</a><br>'
regex='(<a\ +href=\")([^\"]+)(\">)'
[[ $text =~ $regex ]] && echo ${BASH_REMATCH[2]}

# bash-test-function.sh
isFunction() { [[ "$(declare -Ff "$1")" ]]; }
#	Usage:
isFunction some_name && echo yes || echo no

# bash-stop-screen-session.sh
# Start detached screen session `info bash'
screen -d -m -S <screen-name> -m <command>
screen -S info -d -m info bash
# Stop screen session `info bash' by sending key `q'
screen -S info -p 0 -X stuff q
# Alternative: Stop screen session `info bash' by sending key `CTRL-C'
screen -S info -p 0 -X stuff ^C       # Enter literal `^C' in bash by pressing CTRL-V followed by CTRL-C
screen -S info -p 0 -X stuff $'\003'  # $'\003' is octal notation for CTRL-C
screen -S info -p 0 -X stuff $'\cC' # $'\cx' is bash notation for a control-x character

JENKINS_VER=$(tr -dc '[[:print:]]' <<< "${JENKINS_VER}")
# bash-remove-non-printable-chars.sh

1. Convert PEM into pub SSH key file:
ssh-keygen -e -f amazon-ec2-key.pem >> amazon-ec2-key.pem.pub

2. Generate a PEM from a SSH key: 
openssl rsa -in my_tunneler -outform pem > my_tunneler.pem

#==============================##==============================#
# CMD MY_NEUE						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░