Browsing Posts / Page 11 of 33

Automate The Installation of All Your Mac Apps Using Homebrew

On macOS it's pretty easy to automate the installation of all your apps, including Mac App Store apps, for those times when you get a new Mac or wipe your current one. As a software developer I find this capability indispensable, as would any professional or power user.

All you need to do is install Homebrew and then use it to install mas (which is an acronym for Mac App Store). Once they are installed, you can install all your software using a convenient Bash script. Homebrew will be used to install non-store apps, and mas will handle installing the Mac App Store apps.

Note: only Mac App Store apps you have already installed previously can be installed with mas. You cannot install new apps you have never installed from the store.

Why Do This?

The most obvious reason to script out your software installations is that it greatly reduces the time to set up a new Mac, as well as ensure that you don't forget to install one or more apps. It also provides a way to update all the apps at once via the brew upgrade command. And it also provides a way to update apps that don't have their own update feature.

Apps installed with mas will be updated normally by the Mac App Store.

How Does This Work?

In order to use this process you need to know the names of the Homebrew formulae/casks for each application, and you also need to know the IDs of the Mac App Store apps for mas. Fortunately this is super easy.

First, Homebrew has a tool for finding software available in their service at https://formulae.brew.sh/. Simply use this to find your apps and make sure you're installing the right ones. Those listed as “casks” are GUI Mac apps (normal apps you don't run from the Terminal). Ones listed as “formulae” are typically command line tools run from the Terminal or services without an interface.

Second, for Mac App Store apps you simply use mas to list what's currently on your computer from the Mac App Store.

mas list

This will give you a list of currently installed apps from the Mac App Store, with their IDs:

1569813296  1Password for Safari      (2.10.0)
975937182   Fantastical               (3.7.12)
409183694   Keynote                   (13.0)
etc.

You can also search for Mac App Store apps by name using the mas search command:

mas search Xcode

This will show a similar result for matches. You can even install all search results with a single “lucky” command. See the mas help for these and other options.

Script Example

Here's an example of a Bash script to get you started. I keep a similar script updated as I use new apps or stop using others. Then I'm ready to go when I have to set up a new or wiped Mac.

# Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# App Store Automation

brew install mas

# Install App Store Apps

mas install 409183694   # Keynote
mas install 409201541   # Pages
mas install 409203825   # Numbers

# Install Non-Store Apps

brew install --cask firefox
brew install --cask knockknock
# etc.

You can name the Bash script something like install-software.sh and execute it in a Terminal like this:

zsh install-software.sh

The first time you use the script will absolutely justify the time spent writing it. The second time you run it you will thank your past self for being so smart 😉

#apple #macos #mac #tech #code #recommendation #YOUREWELCOME

May 2, 2023

Install SQL Server 2022 with Full-Text Search on Apple Silicon Macs

It looks like a recent change to Docker has allowed Macs with Apple Silicon to run a full installation of Microsoft SQL Server 2022 with full-text search in a Docker container.

How is this possible? Docker has a new feature that can use Rosetta 2 for x64 emulation. That means it supports creating an x64-based Linux image/container and installing the free but full version of SQL Server with FTS.

Step 0: Enable Rosetta in Docker

Enable this feature in the Docker settings as seen in the image below. Look in Settings => Features in development.

Step 1: Create The Dockerfile

Take the content below and save it as a text file named Dockerfile. This configuration creates an Ubuntu 20.04 image, then installs the Microsoft package repositories, SQL Server 2022, FTS, and MS Tools.

# Docker image with msssql 2022 with full text search enabled;
# Based on work in: https://github.com/Microsoft/mssql-docker

# Base OS layer: Latest Ubuntu LTS
FROM --platform=linux/amd64 ubuntu:focal

# Install prerequistes since it is needed to get repo config for SQL server
RUN export DEBIAN_FRONTEND=noninteractive && \
    apt-get update && \
    apt-get install -yq curl apt-transport-https gnupg && \
    # Get official Microsoft repository configuration
    curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
    curl https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb --output packages-microsoft-prod.deb && dpkg -i packages-microsoft-prod.deb && \
    curl https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server.list && \
    apt-get update  && \
    # Install SQL Server from apt
    apt-get install -y mssql-server && \
    # Install optional packages
    apt-get install -y mssql-server-fts && \
    ACCEPT_EULA=Y apt-get install -y mssql-tools && \
    # Cleanup the Dockerfile
    apt-get clean && \
    rm -rf /var/lib/apt/lists

# Run SQL Server process
CMD /opt/mssql/bin/sqlservr

Step 2: Build The Dockerfile

This will build the Dockerfile and create a Docker image named sqlserver.

docker build -t "sqlserver:latest" .

Step 3: Run the Container

This will create a container from the new image and run it. The sa user will have a password of P@ssw0rdz!, the EULA will be accepted, and port 1433 will be opened.

docker run -d --platform linux/amd64 --name sqlserver -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=P@ssw0rdz!' -p 1433:1433 sqlserver:latest

At this point you should have SQL Server running! You can also have it start up with Docker by executing the command below:

docker update --restart=always sqlserver

#docker #code #mssql #AppleSilicon #YOUREWELCOME

Apr 27, 2023

Decades of financial gifts from Harlan Crow to Thomas, Gorsuch hiding $2M property sale to law firm with court business, and Roberts refusing to testify before the Senate regarding #scotus ethics… I think that we officially have the most corrupt Supreme Court in history.

#politics #opinion #gop

Apr 26, 2023

I just posted a new open source console application named SqlPkg. It's a wrapper for Microsoft's SqlPackage (a SQL Server backup and deployment tool) that adds missing features. Currently it provides a way to exclude data from specific tables, automatically wipes target databases, and automatically creates non-existent target databases.

#tech #code #csharp #sqlserver #backup

GitHub - argentini/Argentini.SqlPkg: Console application wrapper for Microsoft SqlPackage that adds features like excluding data from specific tables and database purging/creation. (Windows, macOS, Linux, .NET 7.0, x64, Arm64, Apple Silicon)
GitHub - argentini/Argentini.SqlPkg: Console application wrapper for Microsoft SqlPackage that adds features like excluding data from specific tables and database purging/creation. (Windows, macOS, Linux, .NET 7.0, x64, Arm64, Apple Silicon)

github.com

Apr 23, 2023

A lot of people are really disappointed that the Mac Pro with Apple Silicon has been delayed for so long, given the announced two-year transition. Apple may be struggling to find a good reason for the Mac Pro to exist given the existing lineup and new CPU architecture.

#Apple #AppleSilicon #MacPro #tech #opinion

Apr 22, 2023

I really wish Apple was on Mastodon so that I could plead with them to stop launching Apple Music in macOS every time I remove my AirPods. I despise Musk's Twitter so much that I'll just keep closing the app by hand and cross my fingers.

#apple #macos #elonmusk #twitter #mastodon

Apr 21, 2023

#Disney may have spent too much time exploring the #Mandalorian's home life at the end of the season finale.

#StarWars #humor

Apr 20, 2023

It seems incredibly risky to use a background check to give someone so young a top secret security clearance when they have very little adult background to check.

#Pentagon #security #leaks

Apr 16, 2023

Generative #AI platforms like #OpenAI #ChatGPT and DALL-E have both excited and terrified information workers. But #Amazon #Bedrock might be the one service that truly revolutionizes Internet platforms by offering a more broad AI solution that does it all, integrated with #AWS.

#tech #recommendation

Foundation Model API Service – Amazon Bedrock – AWS
Foundation Model API Service – Amazon Bedrock – AWS

aws.amazon.com

Apr 15, 2023

General Motors has announced that it will be removing #CarPlay and #AndroidAuto compatibility from their new EVs in favor of a paid subscription to its own in-dash services platform.

I see two outcomes:

  1. #GM will lose new EV sales as many potential buyers will choose vehicles that embrace the most important device they own.

  2. GM #EV owners will largely decide to mount their phones to the dash or windshield, circa 2013, as GM's subscription isn't free and provides a terrible experience.

This is a customer-hostile cash grab.

#tech #opinion

Like Apple CarPlay? You Won't Be Able to Get It on Future GM EVs
Like Apple CarPlay? You Won't Be Able to Get It on Future GM EVs

www.caranddriver.com

Apr 8, 2023

Had to explain to a friend that coloring eggs on #Easter makes complete sense given that #Jesus was hard-boiled and painted pink before being nailed to the cross.

#atheism #history #humor

Apr 7, 2023

The injustice of the Tennessee House expulsions has proven #CriticalRaceTheory as fact, like the theory of gravity, which will drop the hammer on these racist politicians.

#crt #gop #politics

Apr 6, 2023

All it will take for #Mastodon to overtake #Twitter is for organizations like the White House, news organizations, and others, to spin up their own Mastodon instances for their own official communications and continue posting as usual. And the dedicated instance addresses will be a better method of validation than a blue check.

#tech #opinion

Apr 1, 2023

Paying $20 per month for #ChatGPT Plus gets you priority access to a dedicated “system unavailable” page. Not sure this is worth the cost.

#tech #opinion

Mar 31, 2023

Vladimir #Putin’s crotch wants to tell us something.

#politics #humor

Mar 23, 2023

With regard to popular culture, the word woke is the new gourmet. Semantic bleaching renders words meaningless.

#philosophy #politics #opinion

Mar 19, 2023

Evidence of Darwin's theory of #evolution by natural selection can be seen all around us. This three-toed skink is but one amazing example.

#science #atheism

Mar 17, 2023

"Truly, whoever can make you believe absurdities can make you commit atrocities." — Voltaire, Questions sur les Miracles, 1765

The current political climate in the United States is certainly stress testing this axiom.

#philosophy #politics #opinion

Mar 8, 2023

The iOS-ification of macOS

Apple's decision to make #macOS look and feel more like #iOS is aspirational, certainly. If users could seamlessly switch between operating systems and retain muscle memory it would be a big win. It's no wonder that #Apple decided to do this with macOS 13 #Ventura.

But in practice, Apple's zeal for consolidation has created some real problems for users. In many cases it feels like one step forward and two steps back. I can see how iOS power users may welcome most of the changes to macOS, but that position smacks of Stockholm Syndrome to me.

One of the best examples of this is the redesigned System Settings, which is a mess. I've given it months to “grow on me” and it has… like a fungal infection. The settings are (dis)organized into a single column of top-level categories in a seemingly random order. Devices running macOS have wide screens, so restricting the top-level categories to a single narrow column is an artificial limitation. And it can’t be remedied by resizing the System Settings window because only its height can be changed.

And the organization? macOS has a much deeper and more broad collection of settings than iOS. So as difficult as specific iOS settings can be to find on an iPhone, it’s near impossible on a Mac. And making it worse is the fact that some settings have been organized out of existence, spread out into disparate, counterintuitive categories. Want to tune all your power and sleep settings? You may have to explore a dozen settings categories to find them when they could have been put into an “Energy” category or something similar. Luckily there is a search feature. Without it I’m sure users would be surrounding the Apple Campus with pitchforks and torches.

Also part of this convergence initiative is the Apple decision to make physical keyboards work more like the iOS virtual keyboard, which changes contextually. The difference is that the iOS keyboard changes in appearance so you can infer what's expected. This means that, for example, sometimes you can use the delete key to remove characters to the right of your cursor, and sometimes you can't. It's like an infuriating game. And now when you press and hold an alphanumeric key it no longer repeats, in favor of a popup with extended characters (e.g. foreign characters with accents and ligatures). I suppose that’s handy for people who write in a foreign language. But you would assume that it would be an option, not a change to the original default key behavior. Your keyboard isn’t broken. Apple made it better #YOUREWELCOME.

#tech #opinion

Mar 7, 2023

How will narrow AI technologies like #ChatGPT, #StableDiffusion, and others, affect jobs in the next decade and beyond? Will it replace human workers? No. It's more likely that humans using narrow #AI tools will replace other humans who do not.

#tech #opinion

Feb 27, 2023

My teenager loves to tell me how she works around the parental controls I’ve set up on our home network and mobile devices. I should be pissed but I’m weirdly proud.

#family #tech #humor #chloe

Feb 26, 2023

Page 11 of 33
Pageof 33

Copyright © 2024 Michael Argentini. All rights reserved.