Posts

Fast Node Manager (fnm) Essential Commands

Fast Node Manager (fnm) allows to install and manage node runtime in a simple way. ### Install fnm on Mac     brew install fnm ### Upgrade existing fnm on Mac     brew upgrade fnm ### Shell setup on Mac with zsh / bash For zsh, add the following to your .zshrc profile     eval "$(fnm env --use-on-cd --shell zsh)" or For bash, Add the following to your .bashrc profile     eval "$(fnm env --use-on-cd --shell bash)" ### List all available versions to install     fnm list-remote ### List only LTS versions to install     fnm list-remote --lts ### List all local installed versions     fnm list ### List the current default version     fnm default ### Install a node version     fnm install v24.22.1 ### Set version of node for current shell     fnm use v22.23.4 ### Set default version of node for all shells     fnm default v22.23.4 ### See the current version of node in the shell ...

Ollama Essential Commands

## Start Ollama Engine     ollama serve ## Pull a Model     ollama pull qwen3.5:latest ## Run a Model     ollama run qwen3.5:latest ## Disable thinking mode for a thinking model     ollama run qwen3.5:0.8b --think=false ## Disable thinking mode and disable auto stop     ollama run qwen3.5:0.8b --think=false --keepalive -1s ## Stop a Model     ollama stop qwen3.5:latest ## Remove a Model and free up space     ollama rm qwen3.5:latest ## List running Models     ollama ps ## List all downloaded Models     ollama list

Access Services on Macbook from another Macbook or Android phone using local wifi network

Run a sample docker nginx service docker run -it --rm -p 8080:80 --name my-web-service nginx Check the service locally curl 'http://localhost:8080/' Disable firewall on Macbook sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off Check the firewall status sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate Set the network name of the macbook sudo scutil --set LocalHostName macbook-pro-2020 Check the network name of the macbook scutil --get LocalHostName Check the local network ip address of the macbook ifconfig en0 | grep 'inet ' Ping from another macbook to confirm the ip address ping macbook-pro-2020.local Access the sample docker service using the network name from another macbook or android phone curl 'http://macbook-pro-2020.local:8080/'

Open Macbook Application from command line

List available application names ls -1 /Applications  Open an application by name open -a 'IntelliJ IDEA OSS.app'

Make MacOS zsh shell to be compatible with bash shell commands

Enable it temporarily in current shell / terminal # Load Zsh's native completion system, then load the Bash compatibility bridge autoload -Uz compinit && compinit autoload -Uz bashcompinit && bashcompinit Enable it automatically by adding the above commands to ~/.zprofile or ~/.zshrc file 

Define and Execute custom shell function on Unix Bash or Mac Zsh

Add the below function to ~/.bash_profile or ~/.zprofile file # Continuously print the current timestamp until Ctrl+C is pressed clockon() {     # Clear the screen initially (optional)     clear     echo "Press [CTRL+C] to stop."     echo "------------------------"          while true; do         # \r overwrites the current line instead of scrolling down         printf "\rCurrent Time: %s" "$(date '+%Y-%m-%d %H:%M:%S')"         sleep 1     done } Source the file or close and reopen the Terminal     source ~/.bash_profile  or      source ~/.zprofile List the function available on the shell     compgen -A function | grep 'clockon' Execute the function     clockon  

Apple MacOS allow downloaded programs to run

In MacOS, when we try to run a standalone program or open an app downloaded from Internet, then MacOS's security will prevent us from running the program. In order to execute the program or app, the following commands can be executed in Terminal to remove the quarantine attribute associated with the file. Unblock a standalone program sudo xattr -d com.apple.quarantine /path/to/your/program Unblock an app Recursively remove the attribute in the app bundle sudo xattr -rd com.apple.quarantine /path/to/YourApp.app