avatara place of mind

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

5092

Abstract

re of the app? Get its Info.</h1><p id="083e">Okay, just because a formula exists for an app doesn’t necessarily mean that it’s not a malware. When I install apps (esp. the Cask ones), I usually double-check the HomeBrew formula to make sure the file that is installed is exactly the app I’m looking for, not some shady virus. This is just some extra precaution—I’ve never seen anything suspicious in HomeBrew formulae.</p><p id="4bff">To make sure about the app safety, simply do:</p><div id="f198"><pre><span class="hljs-attribute">brew</span> <span class="hljs-literal">info</span> orion</pre></div><p id="57a3">You can either look at the URL (called <b>Origin</b>) or click on the formula link and see where the app is downloaded from. In this case, Orion is part of the Kagi organization and is downloaded from the right source.</p><ul><li>As AndrĆ©s points out in the comments, you can open a package’s URL directly by using <code>brew home orion</code> . This opens the Orion website. But my method shows you exactly where the binary files are downloaded from. A malicious attacker might use a different URL for binaries.</li></ul><figure id="11c3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Xwe7Zm2bkVfNSvpxp72nGQ.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><ul><li>If we just want to see the download URL:</li></ul><div id="f2fa"><pre><span class="hljs-attribute">brew</span> <span class="hljs-literal">info</span> orion | grep -E <span class="hljs-string">'^https?:'</span></pre></div><ul><li>If we want to open the download URL in a browser:</li></ul><div id="2d37"><pre><span class="hljs-built_in">open</span> -<span class="hljs-keyword">a</span> <span class="hljs-string">"brave browser.app"</span> <span class="hljs-string">"$(brew info orion | grep -E '^https?:')"</span></pre></div><p id="4796"><a href="https://apple.stackexchange.com/questions/391649/homebrew-command-line-to-display-a-formulas-homepage">Source</a></p><figure id="610a"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="7360">5. Install a Specific Version of Apps</h1><p id="ef0f">Say I want to install PostgreSQL. HomeBrew tells me that several versions of the package are available. I can choose to only install version 10 by specifying <code>@10</code> :</p><div id="20ec"><pre>,bi <span class="hljs-symbol">postgresql@</span><span class="hljs-number">10</span></pre></div><figure id="15ec"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*3axYKHgMmRWFdiPv-ZzFnw.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><p id="6851"><a href="https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula">Source</a></p><figure id="6e12"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="3ffc">6. Update All Apps at Once (or individually)</h1><p id="4ffd">Using HomeBrew, updating all your apps at once feels like a breeze! No more manual checking for the latest version of the apps; one HomeBrew command takes care of it all. This is as easy as:</p><div id="d409"><pre><span class="hljs-attribute">brew upgrade</span></pre></div><p id="f823">Before doing an upgrade, you might want to see what updates are available:</p><div id="2d26"><pre><span class="hljs-attribute">brew update</span></pre></div><p id="f3de">which then tells you which apps need an upgrade. You can even just get a list of such apps by doing:</p><div id="494d"><pre><span class="hljs-attribute">brew outdated</span></pre></div><p id="6412">and just upgrade apps individually.</p><figure id="680d"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ox-qICqTZJQ_EZ7ZFX-JRw.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><figure id="f923"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="52e6">7. List all Installed Apps</h1><p id="f022">It’s as easy as:</p><div id="cd51"><pre><span class="hljs-attribute">brew list</span></pre></div><p id="8944">Apps with a GUI are usually under <b>Casks.</b></p><figure id="7819"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*2K55iqIgiOkGEoW-pHp0jw.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><figure id="40f4"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="1bc7">8. Not sure if you installed an app through HomeBrew?</h1><p id="1196">HomeBrew can only uninstall/upgrade apps that were installed using HomeBrew itself; it cannot touch your other apps. But sometimes we get sloppy and use the old ways to install apps. In case you wonder whether or not an app was installed through HomeBrew, you can either list all installed apps and see if your app is in there, or simply type the following:</p><div id

Options

="35dc"><pre><span class="hljs-attribute">brew list -l joplin</span></pre></div><p id="9379">In this case, I want to check if the note-taking app Joplin was installed through HomeBrew, and the answer is yes. By the way, I use an alias for this command:</p><div id="f87d"><pre>,<span class="hljs-keyword">bl</span> joplin</pre></div><figure id="2925"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4OgOFFwolPWfyVYl1Qq7Jg.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><figure id="9190"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="83c1">Side Notes</h1><h2 id="2c0a">1. How to Erase Shell History</h2><p id="b58f">To record these gifs and avoid making you confused, I had to erase my shell history. I did that by:</p><div id="00b3"><pre><span class="hljs-built_in">history</span> -c</pre></div><p id="359a">This one also works:</p><div id="0831"><pre><span class="hljs-built_in">history</span> -p</pre></div><p id="6bc7"><a href="https://unix.stackexchange.com/questions/544373/how-to-clear-history-in-zsh">Source</a></p><h2 id="6a33">2. How to Erase HomeBrew’s Download Cache</h2><p id="ec91">Since I had already installed Orion, the installer file was downloaded and cached by HomeBrew. If I wanted to install it again, it would simply run the installer from cache. But to show you how HomeBrew downloads and installs apps, I had to clear the cache using this:</p><div id="5804"><pre>brew cleanup <span class="hljs-attribute">--prune</span>=0</pre></div><p id="ccb5">where <code>--prune=0</code> means any file older than 0 days must be deleted.</p><p id="7ec7"><a href="https://github.com/Homebrew/brew/issues/3784">Source</a></p><h2 id="7bbd">3. How to install HomeBrew?!</h2><p id="758d">Just google it.</p><h2 id="5795">4. How to set aliases for commands?</h2><p id="6f12">In zsh, I simply open <code>/.zshrc</code> and add a line like this to the file:</p><div id="1022"><pre><span class="hljs-built_in">alias</span> ,bic=<span class="hljs-string">"brew install --cask"</span></pre></div><p id="2516">Don’t forget to <code>source</code> your shell after saving changes to <code>/.zshrc</code> .</p><figure id="bb58"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><h1 id="b227">Takeaway</h1><p id="0ef4">HomeBrew is the first app I install on a new Mac. It has almost all the apps you’ll ever need and manages them using simple commands. If you don’t like the terminal commands, there’s an app called <a href="https://www.cakebrew.com/"><b>CakeBrew</b></a><b> </b>with a graphics user interface that you might want to check out (install it through HomeBrew!!)</p><figure id="5c05"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*P3J4PJbVWjDJrGNerYORDA.gif"><figcaption>Gif by <a href="undefined">a place of mind</a></figcaption></figure><figure id="88e2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*Uw56mr8wjrGfwZnN4ehNqA.png"><figcaption></figcaption></figure><div id="788a" class="link-block"> <a href="https://medium.com/@aplaceofmind/membership"> <div> <div> <h2>Join Medium with my referral link - a place of mind</h2> <div><h3>As a Medium member, a portion of your membership fee goes to writers you read, and you get full access to every story…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*CV3UVxCWdySmRJMM)"></div> </div> </div> </a> </div><div id="1b7b" class="link-block"> <a href="https://readmedium.com/8-ways-that-raycast-has-revolutionized-my-mac-workflow-in-2022-part-1-6e9c91cc1991"> <div> <div> <h2>šŸ”„ How I Increased my Productivity with Raycast on macOS</h2> <div><h3>Raycast helped me consolidate many apps into one.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*W_kISLlelNCx9pKH.png)"></div> </div> </div> </a> </div><div id="581f" class="link-block"> <a href="https://readmedium.com/5-surprising-mac-features-that-i-discovered-recently-e0f288b6e20c"> <div> <div> <h2>šŸ”„ 5 Surprising Mac Features that I Recently Discovered and Can’t Go Back Now!</h2> <div><h3>I had no idea these features existed!</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*8VtA7_Y0UA88GGJP)"></div> </div> </div> </a> </div></article></body>

šŸ”„ 8 Ways I Use HomeBrew on macOS to Increase Productivity

The following is how I use HomeBrew on macOS to install, update, uninstall apps, and much more.

Photo

1. Install Every App through HomeBrew

Say I want to try a new app like the Orion web browser. In the old days of shire, I would go to their website, find the download page, choose my operating system (macOS Monterey) and click Download. Then I would receive a file that I’d need to install manually.

  • If the file is *.pkg I’d double-click it and click ā€œNextā€ until it’s installed on my system. In most cases, the installer asks for my password/touchID.
  • If the file is *.dmg it’s not going to damage my system (bad naming by Apple)—it simply means that it’s a disk image, that is, when I open it, a new drive will be added to my system (and on desktop) and the app/installer is inside that. After I’m done installing the app, I’d have to manually Eject this drive. If I have opened many *.dmg files, then I’d have to manually right-click on each drive and eject it…
  • If the downloaded file is neither *.pkg nor *.dmg , then it’s an *.app file that I need to drag to the Applications folder.

HomeBrew takes care of all these things and installs apps with just one command. In the case of the Orion browser, I simply type this in my terminal and I’m done:

brew install --cask orion

--cask simply indicates that the app has a GUI. In fact, I actually type less than the line above. If you know your way around zsh or bash, you can simply assign an alias to the commands you use frequently. In this case I just type:

,bic orion
  • It’s good practice to start all your own custom commands and aliases with a special character like , so you can search for them easily. Also it helps avoiding overlap with future renaming of commands.
  • In most cases, this method doesn’t even ask for your password. I only encountered a few apps like Zoom that needed my password to install.
  • Note that HomeBrew automatically installs the version of Orion that suits my version of macOS (Monterey). Normally, you’d have to do it on your own.
Gif by a place of mind

2. Uninstalling Apps is just One Command Away

Similar to the previous command, we also have the uninstall command as follows:

brew uninstall orion

Once again, I’ve set a neat alias for this command, so I just type this:

,bu orion

and Orion is gone!

Gif by a place of mind

3. Not sure if HomeBrew has an app? Just Search.

Every time I see an app that I want to install, I quickly search HomeBrew to see if they have it there. More often than not, an internet legend has created a ā€œformulaā€ for the app, which means the app can be installed using the previous commands. To do search, just type:

brew search orion

I actually type the following because I search HomeBrew a lot:

,bs orion

As you can see in the gif, Orion is available in HomeBrew Casks:

Gif by a place of mind

4. Want to make sure of the app? Get its Info.

Okay, just because a formula exists for an app doesn’t necessarily mean that it’s not a malware. When I install apps (esp. the Cask ones), I usually double-check the HomeBrew formula to make sure the file that is installed is exactly the app I’m looking for, not some shady virus. This is just some extra precaution—I’ve never seen anything suspicious in HomeBrew formulae.

To make sure about the app safety, simply do:

brew info orion

You can either look at the URL (called Origin) or click on the formula link and see where the app is downloaded from. In this case, Orion is part of the Kagi organization and is downloaded from the right source.

  • As AndrĆ©s points out in the comments, you can open a package’s URL directly by using brew home orion . This opens the Orion website. But my method shows you exactly where the binary files are downloaded from. A malicious attacker might use a different URL for binaries.
Gif by a place of mind
  • If we just want to see the download URL:
brew info orion | grep -E '^https?:'
  • If we want to open the download URL in a browser:
open -a "brave browser.app" "$(brew info orion | grep -E '^https?:')"

Source

5. Install a Specific Version of Apps

Say I want to install PostgreSQL. HomeBrew tells me that several versions of the package are available. I can choose to only install version 10 by specifying @10 :

,bi postgresql@10
Gif by a place of mind

Source

6. Update All Apps at Once (or individually)

Using HomeBrew, updating all your apps at once feels like a breeze! No more manual checking for the latest version of the apps; one HomeBrew command takes care of it all. This is as easy as:

brew upgrade

Before doing an upgrade, you might want to see what updates are available:

brew update

which then tells you which apps need an upgrade. You can even just get a list of such apps by doing:

brew outdated

and just upgrade apps individually.

Gif by a place of mind

7. List all Installed Apps

It’s as easy as:

brew list

Apps with a GUI are usually under Casks.

Gif by a place of mind

8. Not sure if you installed an app through HomeBrew?

HomeBrew can only uninstall/upgrade apps that were installed using HomeBrew itself; it cannot touch your other apps. But sometimes we get sloppy and use the old ways to install apps. In case you wonder whether or not an app was installed through HomeBrew, you can either list all installed apps and see if your app is in there, or simply type the following:

brew list -l joplin

In this case, I want to check if the note-taking app Joplin was installed through HomeBrew, and the answer is yes. By the way, I use an alias for this command:

,bl joplin
Gif by a place of mind

Side Notes

1. How to Erase Shell History

To record these gifs and avoid making you confused, I had to erase my shell history. I did that by:

history -c

This one also works:

history -p

Source

2. How to Erase HomeBrew’s Download Cache

Since I had already installed Orion, the installer file was downloaded and cached by HomeBrew. If I wanted to install it again, it would simply run the installer from cache. But to show you how HomeBrew downloads and installs apps, I had to clear the cache using this:

brew cleanup --prune=0

where --prune=0 means any file older than 0 days must be deleted.

Source

3. How to install HomeBrew?!

Just google it.

4. How to set aliases for commands?

In zsh, I simply open ~/.zshrc and add a line like this to the file:

alias ,bic="brew install --cask"

Don’t forget to source your shell after saving changes to ~/.zshrc .

Takeaway

HomeBrew is the first app I install on a new Mac. It has almost all the apps you’ll ever need and manages them using simple commands. If you don’t like the terminal commands, there’s an app called CakeBrew with a graphics user interface that you might want to check out (install it through HomeBrew!!)

Gif by a place of mind
Productivity
Mac
Apps
Apple
Programming
Recommended from ReadMedium