3 months ago

MacOs Dev Commands Awesome Collection

This is my collection of dev commands I'm using:

To get the API execution time:

curl -s "<api_endpoint_url>" -o /dev/null -w "\n%{time_total}\n"

10 months ago

Handy macOS terminal commands 🛠️

Stop iTunes from responding to the keyboard media keys

launchctl unload -w /System/Library/LaunchAgents/ 2> /dev/null

Disable the "Are you sure you want to open this application?" dialog

defaults write LSQuarantine -bool false

Tell macOS to always show all files in finder

defaults write AppleShowAllFiles YES
10 months ago

Easy to remember local static web server - httpster

I know there's tons of options out there, but this one is my go-to. Primarily because it's hard to forget, but also has just the right amount of features.



npm i -g httpster

Then from any folder you want served, simply:


Default port is 3333.

Advanced Usage:

With custom port: httpster -p 8080

Declare directory as root: httpster -d /dist

Even more advanced usage,

10 months ago

Check your battery status and date in your mac

While I create It happens a lot to travel and work from coffee shops. Two commands that I use as aliases are:

1) alias now='cal; date +"%T"; date +"%d-%m-%Y"' which prints the calendar, the date and the time

2) alias bat='pmset -g batt' which prints the battery status and the remaining time!


10 months ago

A command to give your terminal windows a title

Put this in your bash profile: function title() { echo -e "\033]0;${1:?please specify a title}\007" ; }

Then just type title "myTitle" in the terminal.

10 months ago

Hide desktop items on Mac

This terminal command will hide everything on your desktop, so it doesn't give you anxiety 😅

It doesn't actually delete the stuff on your desktop, it just hides it. You can still access the items by going to your Desktop folder in Finder.

defaults write CreateDesktop -bool false;killall Finder

And to show them again, you can do this: defaults write CreateDesktop -bool true;killall Finder

a year ago

Copy the ssh key directly from the terminal

You don't need to copy and paste the key to the machine you want to connect to another. All you have to do is generate your key and then type this command on the terminal:

ssh-copy-id <username>@<ipaddress/host>

You will be prompt to type in the username password and then the key will be copied, you can now log into the machine by using the command ssh <username>@<ipaddress/host>

a year ago

Get last typed command on terminal

You can run the last typed command in the terminal by using !!.

Let's say that your history looks like this:

cd Documents

if you type !! the last command (ls) will be auto-filled in the terminal for you.

But you can also get more specific, by using !<term> so you could use !cd to get the last cd command which was cd Documents

a year ago

Search previous typed command on terminal

If you press ctrl+r in the terminal you will activate the reverse-i-search. With it, you can search your whole history for a command. If you type very long commands you or if you don't remember the whole command that you typed you can just press ctrl+r and type the bit you remember, the command that matches will show up.

If you want to search it again all you need to do is press ctrl+r again.


Let's say you used the command git rebase -i Head~2 before, but you don't remember what does after git rebase or you just don't feel like typing the whole thing.

Press ctrl+r and then type git re if git rebase -i Head~2 was the last command that you used, it will be shown. Then just press enter to run the command.

a year ago

Vim: Search for a term

When editing a long file with vim, you might need to try and find a certain word or term, but scrolling down is not really practical.

Luckily, Vim has your back and you can just use these two commands to search for a term through the whole file.

  • :?<term>
    • searches for that term from the cursor down
  • :\<term>
    • searches for that term from the cursor up

If you want to cycle through different occurrences of the same term you can use: - n or / - go to the next searched term - N or ? - go to the previous searched term

Load More