enable comments in interactive shell
sudo vi /etc/zshrc
setopt interactivecomments
some enhancements to MacOS experience
## Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12
## Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 2
## Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
## Set default Finder location to home folder
defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
## Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
## Disable ext change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
## Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
## Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
## Show absolute path in finder's title bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
## Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
## Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
sudo vim /Library/LaunchDaemons/org.custom.keyboard-remap.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.custom.keyboard-remap</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/hidutil</string>
<string>property</string>
<string>--set</string>
<string>{"UserKeyMapping": [{"HIDKeyboardModifierMappingSrc":0x700000064, "HIDKeyboardModifierMappingDst":0x700000035}] }</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
sudo launchctl load -w /Library/LaunchDaemons/org.custom.keyboard-remap.plist
install lsDeluxe from
https://github.com/Peltoche/lsd
brew and software
# Install brew (automatically configure xcode command line tools)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add Homebrew to your PATH in /Users/dino/.zprofile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/dino/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# Install fonts
brew tap homebrew/cask-fonts
#brew cask install font-<FONT NAME>-nerd-font
brew install --cask font-caskaydia-cove-nerd-font
brew install --cask font-jetbrains-mono-nerd-font
# Font name installed:
# CaskaydiaCove Nerd Font
# JetBrainsMono Nerd Font
iTerm color profile
#iTerm2
wget https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Tomorrow%20Night%20Eighties.itermcolors \
-O ~/Downloads/Tomorrow\ Night\ Eighties.itermcolors && open ~/Downloads/Tomorrow\ Night\ Eighties.itermcolors
brew software
brew install \
tree \
node \
ssh-copy-id \
wget \
ack \
zenith
syntax highlighting plugin for zsh
#syntax highlighting
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/dino/.oh-my-zsh"
ZSH_THEME="agnoster"
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
COMPLETION_WAITING_DOTS="true"
plugins=(git zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# For a full list of active aliases, run `alias`.
alias ls='lsd'
setup ssh anf git setup
ssh-keygen -t rsa -C "dino.lupo@gmail.com"
#copy ssh key to clipboard for adding to github.com
pbcopy < ~/.ssh/id_rsa.pub
#test connection
ssh -T git@github.com
#set git config values
git config --global user.name "Dino Lupo" && \
git config --global user.email "dino.lupo@gmail.com" && \
git config --global github.user dinolupo && \
git config --global core.editor "code --wait" && \
git config --global color.ui true && \
git config --global push.default simple
#token
git config --global github.token your_token_here
Java SDKMAN https://sdkman.io/install
# SdkMan
curl -s "https://get.sdkman.io" | bash
Add the sdkman_rosetta2_compatbile
flag to show only Java M1 compatible
- open .sdkman/etc/config and set to false
- open a new terminal and run
sdk list java
- install the desired java version for M1
sample java install and switch versions
sdk install java 8.0.282-zulu
sdk install java 11.0.10-zulu
sdk install java 16.0.0-zulu
# switch only for current shell
sdk use java 16.0.0-zulu
# change default
sdk default java 16.0.0-zulu
Maven
sdk install maven
Postman
brew install --cask postman
disable Big Sur httpd and use the brew standard version
# remove big sur apache
sudo apachectl stop
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
# install standard apache
brew install httpd
# changes to ports and other configurations
vim /opt/homebrew/etc/httpd/httpd.conf
vim /opt/homebrew/etc/httpd/extra/httpd-ssl.conf
In the httpd.conf file find the <Directory>
block, you will find an AllowOverride
setting, this should be changed as follows:
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
enable mod_rewrite which is commented out by default. Search for mod_rewrite.so and uncomment the line by removing the leading #
LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
Apache likes to have a server name in the configuration, but this is disabled by default, so search for:
#ServerName www.example.com:8080
replace it with:
ServerName localhost
# start service
brew services start httpd
Execute vim /opt/homebrew/etc/php/8.0/php.ini
And modify short tag option
vim /opt/homebrew/etc/httpd/httpd.conf
# Virtual hosts
Include /opt/homebrew/etc/httpd/extra/httpd-vhosts.conf
https://getcomposer.org/download/
upgrade python default via brew
brew update
brew install pyenv
pyenv install --list
pyenv install 3.9.5
pyenv global 3.9.5
if you want to use a specific python version within a specific folder, go to that folder and set a local python version:
pyenv local 3.7.9
from terminal add the following
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
Install virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zprofile
brew install pyenv-virtualenv
create a virtual env and enable for a project
# sample:
# pyenv virtualenv <X.Y.Z> <env-project-name>
pyenv virtualenv 3.9.5 project-1
cd project-1
pyenv local project-1
pyenv version
theme to show the python version
Add the following to .zshrc
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
oh my zsh Theme that show virtual venv (see reference 1)
wget https://gist.githubusercontent.com/loganasherjones/bd9b7614f80b96cf700fd60e9e256f41/raw/3d182400a634c0af0f81e3c0a79ff712a3919bf0/agnoster-pyenv