That cat bed is not a donut. It’s a biconcave disc. #yourewelcome
- YouTube
m.youtube.com
Non Sequiturs is the personal blog of Michael Argentini.
I'm a software developer and Managing Partner for Fynydd and Blue Sequoyah Technologies, the project lead for Coursabi, and Āthepedia founder. I also have several nerdy open source projects on Github.
I'd describe myself as an Oxford comma advocate, autodidact, aspiring polymath, and boffin, with a mechanical keyboard addiction. You can also find me on Mastodon.
That cat bed is not a donut. It’s a biconcave disc. #yourewelcome
By default the ollama API runs on the localhost IP address of 127.0.0.1. If you want to host it on all of your Mac's IP addresses it requires that you set a system-wide environment variable. The problem with doing this is that Login Items (in System Settings) can launch before Launch Agents. This means that Ollama (in the menu bar) may not see the host settings. To solve this you need to launch Ollama at startup after a delay.
Here's how to add the host binding for all IP addresses on the Mac and then have Ollama launch 10 seconds after you sign in. This works in macOS 14.5 Sonoma and should work in later versions.
Step 1: Create a launch daemon plist file below. Save it as com.nonsequiturs.ollama.plist.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.nonsequiturs.ollama</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>OLLAMA_HOST</string>
<string>0.0.0.0</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
Step 2: Copy the file to two locations:
/Library/LaunchDaemons/
~/Library/LaunchAgents/
This will set the host bindings at the system level, and also at the user level. So you should be covered no matter how you launch Ollama in the future.
Step 3: Set file permissions on the system-level file.
sudo chown root:wheel /Library/LaunchDaemons/com.nonsequiturs.ollama.plist
sudo chmod 644 /Library/LaunchDaemons/com.nonsequiturs.ollama.plist
Step 4: Install the launch agents:
sudo launchctl bootstrap system /Library/LaunchDaemons/com.nonsequiturs.ollama.plist
launchctl load ~/Library/LaunchAgents/com.nonsequiturs.ollama.plist
Now your system will start up and bind the Ollama host address to all IP addresses on the Mac.
Step 5: To launch Ollama after a 10 second delay, Open Script Editor and create the simple AppleScript file below.
delay 10
tell application "Ollama" to run
In the File menu choose Export, and then export it as type “Application” and name it “LaunchOllamaDelay”. Save it to your user Applications folder.
In System Settings go to Login Items and add the LaunchOllamaDelay application to the startup items. Also remove any existing Ollama startup item.
Now when you restart and sign in, Ollama will launch after 10 seconds which should be enough time for the Launch Agent to have executed. And if Ollama updates itself in the future it should also just work when it restarts.
Microsoft has patched the Windows 11 ‘product server’ trick for TPM check bypass, but the bypass still works with setupprep.exe. This bypass will upgrade Windows 10 clients to Windows 11 without requiring a TPM.
setupprep.exe /product server
The acronym GUID is not pronounced “gooey ID”. It's pronounced “goo-id”. #YoureWelcome
Mac Pro Tip: When copying a git repository directory to your network file server using rsync, try this:
rsync -brtlvP --chmod=Fu+w --delete-before Code/MyProject/ /Volumes/MyServer/Code/MyProject/
This will copy the files with timestamps but no other attributes, and will also give the file owner (you) full access rights. This ensures that you (or even Windows users with access rights) can overwrite the directory contents later because local read-only files (e.g. in the .git directory) won't be read-only on the server. You can also change the chmod option to customize the rights, like ensuring everyone has full control.
Web developers rejoice! There's an easy way to animate the height of an HTML element even if the height is dynamic, determined by its content, with only CSS. This is typically used for navigation menus and the like, and now it's much easier to code and maintain.
The strategy is to actually animate the grid-template-rows not the height. For example, take the following HTML markup:
<div class="menu">
<div class="inner-wrapper">
<p>Here is some content.</p>
<p>Here is some content.</p>
<p>Here is some content.</p>
</div>
</div>
The CSS for this markup would be:
.menu {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 100ms;
}
.menu.active {
grid-template-rows: 1fr;
}
.menu .inner-wrapper {
overflow: hidden;
}
Initially the outer div will be hidden since it has no overflow and the grid template rows are zero. When you add active to the outer div element's class list, the browser will animate the transition from zero row height to 1fr, which essentially means the height it needs for its content to render.
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.
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.
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.
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
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.
Enable this feature in the Docker settings as seen in the image below. Look in Settings => Features in development.
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
This will build the Dockerfile and create a Docker image named sqlserver.
docker build -t "sqlserver:latest" .
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
Wouldn't it be cool if Apple Music for iOS allowed you to sort the tracks in a smart playlist like 10 years ago?
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.
PARENTING PRO TIP: Those things we use to store old plastic grocery store bags are also great for teaching kids how a human colon works.
I’m going to ruin two things for you: #StarWars and #Christmas.
youtu.be
Recommendation for Discovery Network: change “Shark Week” to “Shart Week” and watch the ratings go through the roof.
Callipygian: pertaining to or having finely developed buttocks. #YOUREWELCOME.
“Taco cat” spelled backwards is “Taco cat”. #YOUREWELCOME.
Non Sequiturs is the personal blog of Michael Argentini.
I'm a software developer and Managing Partner for Fynydd and Blue Sequoyah Technologies, the project lead for Coursabi, and Āthepedia founder. I also have several nerdy open source projects on Github.
I'd describe myself as an Oxford comma advocate, autodidact, aspiring polymath, and boffin, with a mechanical keyboard addiction. You can also find me on Mastodon.
By using this website you accept our privacy policy. Choose the browser data you consent to allow: