Table of Contents
Python's website has a MacOS Python 3 installer we can download and use. If we use the package installation, a python3 fill will be at available in /usr/local/bin/.
Open ~/.bash_profile file.
vi ~/.bash_profile
Then put the alias as follows:
alias python='python3'
Now save the file and then run the ~/.bash_profile file.
source ~/.bash_profile
Congratulation !!! Now, you can use python3 by typing python.
python --version
Python 3.7.3
https://ss64.com/osx/
Amazon Corretto 21 is installed in /Library/Java/JavaVirtualMachines/.
sudo nano ~/.bash_profile
//or
/usr/libexec/java_home --verbose
export PS1="[Amin $]> "
alias python='python3'
export MYSCRIPTS="/Users/mohamed/amroot/env"
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home
export M2_HOME=/Users/mohamed/amroot/sw/apache-maven-3.8.1
# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="${MYSCRIPTS}:/Library/Frameworks/Python.framework/Versions/3.11/bin:$M2_HOME/bin:$JAVA_HOME/bin:${PATH}"
export PATH
export COLOR_NC='\e[0m' # No Color
export COLOR_BLACK='\e[0;30m'
export COLOR_GRAY='\e[1;30m'
export COLOR_RED='\e[0;31m'
export COLOR_LIGHT_RED='\e[1;31m'
export COLOR_GREEN='\e[0;32m'
export COLOR_LIGHT_GREEN='\e[1;32m'
export COLOR_BROWN='\e[0;33m'
export COLOR_YELLOW='\e[1;33m'
export COLOR_BLUE='\e[0;34m'
export COLOR_LIGHT_BLUE='\e[1;34m'
export COLOR_PURPLE='\e[0;35m'
export COLOR_LIGHT_PURPLE='\e[1;35m'
export COLOR_CYAN='\e[0;36m'
export COLOR_LIGHT_CYAN='\e[1;36m'
export COLOR_LIGHT_GRAY='\e[0;37m'
export COLOR_WHITE='\e[1;37m'
export PS1="[${COLOR_YELLOW}Amin \[${COLOR_GREEN}\]$\[${COLOR_WHITE}\]]> "
alias python='python3'
export MYSCRIPTS="/Users/mohamed/amroot/env"
export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-21.jdk/Contents/Home
export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.3.2/Contents/Home
export M2_HOME=/Users/mohamed/amroot/sw/apache-maven-3.8.1
# Setting PATH for Python 3.8
# The original version is saved in .bash_profile.pysave
PATH="${MYSCRIPTS}:/Library/Frameworks/Python.framework/Versions/3.11/bin:$M2_HOME/bin:$JAVA_HOME/bin:${PATH}"
export PATH
sudo nano ~/.zshrc
export PS1="%F{blue}% amin: %F{green} $>%f"
brew install putty
This will also install puttygen. To get puttygen to output a .PEM file:
puttygen privatekey.ppk -O private-openssh -o privatekey.pem
The private key must have tight security settings otherwise SSH complains. Make sure only the user can read the key.
chmod go-rw privatekey.pem
IP Tables https://www.howtogeek.com/177621/the-beginners-guide-to-iptables-the-linux-firewall/killall NotificationCenter
$> security find-generic-password -wa "wifinetworkname"
$> security find-generic-password -wa "wifinetworkname" | pbcopy
copy to clip board: cmd + ctrl + Shift + 4
edit file /etc/pam.d/sudo
sudo nano /etc/pam.d/sudo
Add Line
auth sufficient pam_tid.so
Issue : when i sudo and give my finger scan i do get to root but terminal gets switched to sh instead of .zshrc and i loose all the prompt formating like so
Last login: Tue Nov 21 20:09:35 on ttys001
amin: $>sudo su
after finget scan auth
%F{blue}% amin: %F{green} $>%f
Check the Shell for the Root User:
To determine the shell used by the root user, you can execute the following command: sudo echo $SHELL
Update Root User's Shell:
If the root user is using a different shell (e.g., /bin/sh) and you want it to use the same shell as your regular user (/bin/zsh), you can change the root user's shell using the chsh command. For example:
sudo chsh -s /bin/zsh root
Configure Root User's Shell:
After changing the root user's shell, you may want to copy your custom .zshrc configuration to the root user's home directory (typically /root) if you want the same prompt and environment settings to apply to the root user.
sudo cp ~/.zshrc /root/. ( Linux)
sudo cp ~/.zshrc /var/root/ ( MAC)
Switch to bash:
exec bash
Switch to zsh:
exec zsh
Create a new file, curlt, somewhere in your executable path, i have env folder mapped to path so i create this file there and paste in:
#!/bin/bash
curl -w @- -o /dev/null -s "$@" <<'EOF'
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
----------\n time_total: %{time_total}\n
EOF
i gave execute perm to the file after cd to the env dir :
chmod 755 *
Then call it the same way as the alias:
curlt www.ameen.guru
$> youtube-dl -f bestvideo+bestaudio <URL>
for file in *.jpg; do convert $file resize 50% small-$file; done
convert is imagemagick command , it can resize based on % or resolution e.g 1920 ( will maintain aspect ratio)
dns-sd -Q domain.com
Terminal 1
sudo su dns-sd -Q domain.com
terminal 2
sudo su killall -HUP mDNSResponder