Page content

some adaption for macOS


macOS is using zsh since while. If you wanna switch back to bash, here some Notes …"

Switch to Bash

chsh -s /bin/bash

install brew

the famous package manager for macOS

/bin/bash -c "$(curl -fsSL"

install keychain

if you work with ssh agent, you may wanna try keychain …

brew install keychain

build .bash_profile

this will overwrite your existing .bash_profile

cp ~/.bash_profile ~/.bash_profile.$(date "+%s")~

cat << 'EOF' > ~/.bash_profile
echo "hi .bash_profile"

eval "$(/opt/homebrew/bin/brew shellenv)"
[ -r ~/.bashrc ] && . ~/.bashrc

echo "bye .bash_profile"

chmod 700 ~/.bash_profile

build .bashrc

same here …

cp ~/.bashrc ~/.bashrc.$(date "+%s")~

cat << 'EOF' > ~/.bashrc
echo "hi .bashrc"

# Keychain Startup
eval $(keychain --eval id_ed25519)

alias ..="cd .."
alias ...="cd ..."
alias ll="ls -l"
alias lla="ls -la"

echo "bye .bashrc"

chmod 700 ~/.bashrc


let’s create some profile folder

cat << 'EOF' >> ~/.bashrc

# include /etc/profile.d
if [ -d /etc/profile.d ]; then
  for f in `ls /etc/profile.d`; do . /etc/profile.d/$f; done

test -d /etc/profile.d || sudo mkdir /etc/profile.d
sudo chmod 777 /etc/profile.d

add profile.git

add some aliases for git …

cat << 'EOF' > /etc/profile.d/profile.git
# Git Stuff, by Stöge, 2022-09-08


# Pull/Push
alias gil='git pull'
alias gis='git push'
alias gipupu='git push; git pull; git push; git pull'

# Status
alias gs="git status"
alias gss="git status -s"
alias gssb="git status -s -b"

# Config
alias gcl="git config --list --show-origin |sort"
alias git_config_list="git config --list --show-origin |sort"

# Remote
alias gr="git remote"
alias grv="git remote -v"
alias grso="git remote show origin"

# Log
alias gl='git log'
alias gls='git log --stat'
alias glp1='git log -p -1'
alias glp2='git log -p -2'
alias glp3='git log -p -3'
alias glpo='git log --pretty=oneline'
alias glpr='git log --pretty=reference'
alias glpf='git log --pretty=format:"%h - %an, %ar : %s"'

# All in One
alias gitac='git add . && git commit -m "update"'
alias gitacp='git add . && git commit -m "update" && git push'
alias gitacfp='git add . && git commit -m "$(curl -sk" && git push'

sudo chmod 755 /etc/profile.d/profile.git


sudo launchctl load -w /System/Library/LaunchDaemons/


mkdir ~/SolidColors
cp /System/Library/Desktop\ Pictures/Solid\ Colors/* ~/SolidColors/

Terminal -> Preferences -> Profiles -> Background -> Image -> ~/SolidColors

-> delete unwanted Colors from ~/SolidColors


Script to grab your Public IP, Dualstack capable

cd /tmp
tar xfz i3.tar.gz i3
sudo mv i3/i3 /usr/local/bin/

Test Script

user@host $ i3
IPv6: 2a0b:xxxx:xxxx:xxxx::1

Put PublicIP to Variable

user@host $ myip=$(i3 -b -4)
user@host  $ echo $myip

Bash Autocompletion

brew install bash-completion
echo -e "# Bash Autocompletion\n[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion\n" >> .bashrc
source ~/.bashrc


brew install vnstat
  /opt/homebrew/opt/vnstat/bin/vnstatd --nodaemon --config /opt/homebrew/etc/vnstat.conf

Find App Listening on Port

sudo lsof -i -n -P | grep TCP

hidden command for ‘install-app-allow-anywhere’ on ventura

you wanna install apps via brew and run them on your mac ? -> this needs the “Allow applications downloaded from ‘Anywhere’” - button, which you can enable with the following hidden command:

sudo spctl --master-disable

Terminal & CLI

  • CTRL-A -> Beginning of the Line
  • CTRL-E -> End of the Line
  • CTRL-K -> Delete from Cursor until EOL

Terminal Settings, Keyboard, enable ‘Use Option as Meta key’

-> # and other Stuff will not work anymore :(

  • OPT-B -> one Word backward
  • OPT-F -> one Word forward

sha256: b267537f4260bf42b8e354cd6951bdee41b9b54b00c412bfa670da370cc588ac