From 234d86b6fb84d45522f521087b9a3f15de7de237 Mon Sep 17 00:00:00 2001 From: "R. P. Clark" Date: Mon, 1 Dec 2025 15:52:40 +0000 Subject: [PATCH 1/2] rename a mac on the lan --- rename_mac.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 rename_mac.sh diff --git a/rename_mac.sh b/rename_mac.sh new file mode 100755 index 0000000..194f97c --- /dev/null +++ b/rename_mac.sh @@ -0,0 +1,4 @@ +sudo scutil --set ComputerName $1 +sudo scutil --set HostName $1 +sudo scutil --set LocalHostName $1 + From e3c22cb86708b9a910a8bee48ee7da2ab4c732ab Mon Sep 17 00:00:00 2001 From: robin Date: Sat, 31 Jan 2026 09:46:35 +0000 Subject: [PATCH 2/2] MAC copy to ~/.zshrc --- zshrc.zshrc | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 zshrc.zshrc diff --git a/zshrc.zshrc b/zshrc.zshrc new file mode 100644 index 0000000..4027f48 --- /dev/null +++ b/zshrc.zshrc @@ -0,0 +1,81 @@ +alias pyviz='source ~/pyviz/bin/activate' + +export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin + +# ------------------------------------------------------------ +# Basic environment +# ------------------------------------------------------------ + +export EDITOR=vi +export PAGER=less +export LANG=en_GB.UTF-8 + +# ------------------------------------------------------------ +# History (zsh-native, better than bash) +# ------------------------------------------------------------ + +HISTFILE=~/.zsh_history +HISTSIZE=50000 +SAVEHIST=50000 + +setopt INC_APPEND_HISTORY +setopt SHARE_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_REDUCE_BLANKS + +# ------------------------------------------------------------ +# Completion system +# ------------------------------------------------------------ + +autoload -Uz compinit +compinit + +# ------------------------------------------------------------ +# Git branch helper (explicit NO GIT REPO) +# ------------------------------------------------------------ + + + + + +# ------------------------------------------------------------ +# Aliases (bash-compatible) +# ------------------------------------------------------------ + +alias ll='ls -lh' +alias la='ls -A' +alias l='ls -CF' +alias gs='git status' +alias gd='git diff' + +# ------------------------------------------------------------ +# Path additions (example) +# ------------------------------------------------------------ + +export PATH="$HOME/bin:$PATH" + + +# ------------------------------------------------------------ +# Git branch helper (branch only, explicit NO GIT REPO) +# ------------------------------------------------------------ + +git_branch() { + if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then + git symbolic-ref --short HEAD 2>/dev/null || echo "DETACHED" + else + echo "NO GIT REPO" + fi +} + +# ------------------------------------------------------------ +# Prompt with colours +# ------------------------------------------------------------ + +setopt PROMPT_SUBST +setopt NO_NOMATCH + +# Colours: +# %F{colour} ... %f = foreground colour on/off + +PROMPT='%n@%F{208}%m%f %F{green}%~%f [%F{red}$(git_branch)%f] %# ' +