Linux Man In A Mac World

My New MacBook Air 15

Yeah you read that right, my new MacBook Air 15. I decided to buy a thin and light laptop. I have wanted a new laptop for when I am sitting in the living room. My laptops see pretty light duty these days. Usually they are basically just thin clients. Needs to run a terminal that is usually for SSH sessions and web browser. Lately I have been using VSCodium for an editor to do my blog posts. Nothing heavy, I use to use them a lot more for electronics projects but not much anymore. Besides my Dell Precision 5510 is still great for that stuff.

I looked into some of the ARM options like a Pinebook or a Chromebook, they would have been cheap and probably worked but I didn't really want to mess with trying to get an OS installed etc. I wanted some convenience and "just works".

I have been curious about Mac's for a while now. I think it started almost 3 years ago when I pivoted into system administration. Some questions about working with Mac for the Canonical position I interviewed for. That was when I realized that I knew nothing at all about them. I would have no clue where to start with them. Then there have been threats of me getting a Mac from work since Levey got there. Again a little fear that if I got saddled with a Mac I would be at a real deficit. It took a year or more but I finally bit the bullet. I talked it out with Lisa and we agreed that it made sense. Fortunately Lisa did give me permission to not think of it as permanent everyday solution. It can be a professional development tool. The price for what you get is hard for me to get over but $1400ish isn't horrible for a new laptop if you ignore the specs.

The Specs

It's the 2024 MacBook Air 15 M3 - 256G Disk - 8G Memory

Pretty paltry specs but should be good enough for what I am doing with it. $200 to bump to 16G of memory is pretty ridiculous. I don't store much on the disk so that should be plenty of room. I have networked storage and fast USB storage is cheap these days.

Day 1

I was in town so I decided to go the Artist Formerly Known As Apple (the only sign out front is the apple logo).I went in at 10:00 AM when they opened, explained the product I was looking at. The very nice sales person asked a few questions about my use case and told me about some options. I asked if they had an "upgraded" version that had the 16G of RAM ($200 upgrade) without a larger storage drive. She checked on her iPod thing. Nope, they would have to order that if I wanted it. Neither did they have one with the 70W charger. Couldn't really think of any other questions so I was ready to pay. She checked me out on the iPod and tried to small talk for about 32 seconds while we waited for the laptop to come out of the back. I let Lisa know I was in the car and headed home with my new MacBook at 10:08. So I got it home opened the box and turned it on. I have to say that the experience was quite nice. I get why people use the Apple experience as the standard. It was smooth and without hiccups, no friction.

I was able to download and install Firefox and get logged into my Firefox sync account. I did have to search "maximize window Mac" to figure that out. It's a little humbling to be back at square one with some of that stuff.

I wanted to get going on being able to use it for my blogging since that has been what I have been spending most of my time on recently. I have been trying out and gotten really used to using VSCodium for doing the markdown entry's for my blogs.

I felt a little pressure or anxiety to "get everything" working and started searching how to get VSCodium installed etc. You need homebrew, OK, how do you install homebrew? First you have to enable some option for xcode. What's xcode?

I decided at this point that I didn't want to feel rushed through this and copy and paste commands from the internet etc. Decided, to slow down. Use it as much as I could, take my time learning all this new stuff and document it here.

How often does a 15 year Linux user with zero experience with Apple pickup up a MacBook and start using it?

So, I temporarily moved back to my old workflow of SSH into the jump mkdocs node and using vim. I found Mac's terminal, it works fine for this purpose since I use tmux on the jump node anyway. Generated an SSH key using ssh-keygen. I think autocomplete isn't working though. Which is weird cause it's a ZSH right? I don't know, I need to look. Got into my jump node.

Time to go to work and I had no more time for it today.

Day 2

Because of all the running around yesterday I spent most of the morning just doing my blog in the terminal. Didn't get back to any of the fun stuff. Still determined to learn about xcode and homebrew before moving on. Battery life is crazy good so far it does go to sleep fast and hard so I am constantly having to kill my SSH sessions etc. I may increase the timeout or something. Really I learned I like my new VSCodium setup and will be excited to get back to that.

I did get to test the thunderbolt or whatever to my monitor and it worked flawlessly.

Tomorrow is my day off so I should have a lot more time to really dive into getting this thing setup.

So far I am pleasantly surprised.

Getting a little time in after work. Keyboard is nice.

Found the ps command and the init system is launchd. I'm pathetic, I'm actually excited to read the man page for launchd.

Before bed I went ahead and ran the xcode-switch --install and allowed the system to update. Went pretty smooth, took 10 or 15 minutes and most of that was download time.

Day 3

Up early, fully charged and ready to go. I want my normal workflow back. Going to see if git was installed as part of the xcode tools. Going to get homebrew going so I can have VSCodium. Guess I could try the xcode IDE since it uses git as well?

git
stow
tmux
vim

Package Management

Found some of the native package management tools in pkgutil and installer.

Interesting, "Do you want to move 'Homebrew installer' to the trash". Thats nice, ofer to keep things clean and remove install packages from the system.

Brew was not in my $PATH had to execute directly

“VSCodium” can’t be opened because Apple cannot check it for malicious software.

Got brew and codium installed. Did have to figure out how to allow untrusted sources in order to launch VSCodium.

The Shell

In order to use my bash functions that create my blog entries I had to figure out the Mac shell. I decided for the time being I am just going to use bash as the default shell. I do want to learn more about zsh but I need my functions working. Had to get the default terminal into a useable state. Oh and it doesn't look like brew is in the default PATH.

Hurray! With brew installed I got VSCodium installed. I was able to clone my repos (git completion is not very good) for the blogs and am able to get my blog workflow up and running.

Looks like all my normal cli packages are available via brew so that should be easy enough.

App Store

I needed an xmpp chat client for our family chat server. I just wanted something basic from the App Store. Finally had to create an Apple ID. Created it, verified everything and I couldn't log in. I had to contact chat support. It took them 25 minutes to fix it. They must have deleted the account because they just had me re-create it. After that I was able to get logged in and install the app.

BeagleIM, I was able to get logged into my xmpp account imidiately and looks like it's working great.

Listening to Pandora on the speakers and they sound pretty nice for a laptop. Totally serviceable, I'm pretty impressed with the build quality and hardware in general.

Day 4

Ok, let's get this shell situation sorted out. It wants to use ZSH by default. I can use Bash but it's an old version. Looks like Brew has a newer version of Bash. Should I use this or just get ZSH sorted. I went ahead and ran brew install bash bash-completion and they installed fine. Brew prompted to stick this in the .bash_profile [[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"

I did but it looks like the version is still using the system Bash. Need to figure out how we switch to Brew installed versions of software once installed.

I did a reboot just to make sure all the changes to the shell I have been making etc stick. Hostname change didn't stick. Homebrew still ins't in the $PATH. I suspect I should have used the Homebrew install script over the pkg? The script says I can run it without affecting the existing install. This whole Homebrew thing seem ridiculous frankly. What a hack to get a reasonably functioning system. I suppose it can be likened to the AUR, PPA's, or EPEL. But I don't think the experience of adding those is quite as jenky and I think they are officially supported.

/opt/homebrew/bin/brew dr
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: /usr/bin occurs before /opt/homebrew/bin in your PATH.
This means that system-provided programs will be used instead of those
provided by Homebrew. Consider setting your PATH so that
/opt/homebrew/bin occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.profile

The following tools exist at both paths:
  bashbug
  openssl

Warning: Homebrew's "bin" was not found in your PATH.
Consider setting your PATH for example like so:
  echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.profile

Jenky indeed, I guess I shouldn't be so cynical but I just don't think this level of modification should be required to get decent git completion or a modern Bash install. Maybe I should actually be looking into VM's and containers that just run Linux. I see why those exist now, but I got the "low end" hardware and I'm guessing those solutions are resource hogs.

I'm also hesitant to start with the heavy modifications to my profiles because they are shared across my systems and I don't really want to have to manage a Mac branch or something like that. I suppose I could do hostname checking or something...

Ugh, that took way to long. I got the brew in the PATH, but Bash was still using the system version. I forgot that I manually set the shell in the terminal app to /bin/bash to use bash so it wasn't respecting my chsh settings. I guess that is technically on me but it feels like a lot of shenanigans to use a modern version of Bash. I guess this is why I bought the thing.

I just found the full screen app and three finger gestures to switch between them, I think I like that feature. It makes it easy to have a full screen app to give real estate, size, and focus to an app. Especially on this machine where I want my focus to be on what I am currently working on.

I still seem to be fighting fully working shell completion. What a hassle to get a decent shell and reasonable completion. With all the bell's and whistles it seems like there would be a better solution from Apple regarding this. Some sort of dev mode or something.

Day 5

Woke up annoyed with this bash completion issue. I want it working, I don't like when things are suppose to work that don't. So I did get completion working for tmux and git as would be expected so I guess the completion just isn't that great for Homebrew? It won't complete on the initial command, like search, install, I guess that's fine. Whatevz, git was the most annoying one and that is working as expected.

I suppose I would run into this type of thing in a lot of scenarios, Debian isn't Ubuntu, and I know that when I have tried RHEL derivatives I have run into these kinds of things. All the distro's do things a little different. I shouldn't be that upset but I think the fact that Homebrew is basically a requirement for any advanced/development user is telling that Apple is neglecting something, and it's been that way long enough they know they are and don't want to do anything about it. I'm glad homebrew is a thing, but it's clearly a lot of scripting hacks that are put together to address issues that Apple want's to ignore. I don't suspect they will get away with it forever. Look at what Microsoft has had to do with Linux in recent year's to ensure that they didn't loose market share in there refusal to admit that Linux/BSD had beat them in the infrastructure arena.

Day 6

I am starting to treat it more like a daily driver. Treating it the same way I do my Dell. Going to just live with it as much as I can and get back to my normal stuff. Think I want to keep working on the family landing page and stuff. I also got a book on web development from the library that I kinda want to crack open.

Battery life is awesome! That will be nice to just use it and charge it. Battery life in Linux for laptops has always been such a problem.

Day 7

I got Alacritty terminal installed the other day. It was complaining each time I would start because I didn't have Source Code Pro font's installed and thats what specified in my shared config.

I got the Adobe Source Code Pro font installed. It was super easy, cloned the repo and opened the Font Book app, Add Fonts to Current User. Selected the repo and it installed them and had them ready to go.

I have to admit this process was really easy. I'm not sure how hard it would be on Windows these day's. A lot of things are pretty easy with this OS. Sometimes stuff like that is more difficult then you would think on various Linux distro's. Some of that is because I choose to use Arch which is an OS that is very 'manual', you have to administer the system. It's probably easier on distro's that ship with desktop environments configured etc. I think that the difference is the fact that you can just search 'install font mac' and find the Apple answer and other posts that will help. Searching for 'install font ubuntu' results in a 13 year old askubuntu post which looks like it might help but it's much more technical then Apple providing 4 options to easily add a font to the system.

Installing PHP

I am working on web development technologies right now and VSCodium wants a php install configured for it's PHP features. PHP website say's to use Homebrew.

Lot's of caveats, most seems to make sense. I do need to go learn about keg and see if there is a better way to have php in my path. I might just point VSCodium to it for now or add a symlink from somewhere in my path.

==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /opt/homebrew/opt/php@8.2/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.2/

php@8.2 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have php@8.2 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> /Users/pat/.bash_profile
  echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> /Users/pat/.bash_profile

For compilers to find php@8.2 you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/[email protected]/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/[email protected]/include"

To start php@8.2 now and restart at login:
  brew services start php@8.2
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php@8.2/sbin/php-fpm --nodaemonize

Just noticed that `brew info provides the caveats, like it.

keg-only a formula is keg-only if it is not symlinked into Homebrew’s prefix

Guess I'm just gonna point VSCodium to the executable for now. I don't need FPM or anything yet. I can figure out a better solution if I need to.

Well, it was an interesting first week. All things considered it went surprisingly well. There was some pain with the shell and getting more comfortable with Homebrew. For the most part though it's all gone very well and in general the OS is very intuitive.