Category: Apple
How to update nodejs on OS X
Adding here as reference. node -v npm cache clean -f npm install -g n n stable\ node -v
My .bash_profile
Don’t know why I never added it here, so doing it now. alias ll="ls -al" alias src="cd ~/workspace/" alias ap="cd ~/workspace/git/antonperez/" alias readyapi=”/Applications/ReadyAPI-2.5.0.app/Contents/java/app/bin/ready-api.sh” performGitOperations() { git fetch –all git checkout $1 git reset –hard origin/$1 git clean -fd } copom() { echo “[———- START ———-]” if [ “$2” = “all” ]; then echo “–>> blwebdriver…
Install sqlcmd on Mac OS X
In case you need to run SQL Server scripts from your Mac, do the following to install (NOTE: I use HomeBrew.): From the terminal, type: brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release ACCEPT_EULA=y brew install –no-sandbox msodbcsql mssql-tools You should see something like in the screenshot. Type “YES” if prompted and be on your way. Once done, type:…
OS X: Setting system-wide environment variables
I believe up until Yosemite, I didn’t have issues setting up environmental variables (i.e. JAVA_HOME) via my .bash_profile. As I upgraded, that no longer worked, so I found another way: use a custom .plist in your LaunchAgents folder: Go to ~/Library/LaunchAgents Add something like the below and then reboot, or unload-load it via launchctl unload…
My custom bash prompt
I wanted more information in my bash prompt, such as date/time and the directory I was in. Here’s what it looks like: And this is what I added in my ~/.bash_profile: PS1='${debian_chroot:+($debian_chroot)}\d \T > \[$(tput sgr0)\]\[\033[01;32m\]\u@\h\[\033[00m\] : \[\033[01;34m\]\w\[\033[00m\]\n\$ ' Run source ~/.bash_profile and enjoy. 🙂 BTW, there’s also a website that you can use to…
Unpretty print a JSON file
I needed a one-liner JSON payload, but only had the pretty-printed version. And, removing the whitespaces manually was NOT an option. It was super easy on a Mac; just do the following: In a terminal, install “jq” with brew like so brew install jq With your pretty-printed JSON in a file: cat prettyprinted.json | jq…