There. I hope that title was SEO friendly enough. Not that we would know, because we do not track any traffic, do not issue cookies, do not statisticate, and choose to be entirely ignorant about our world fame.
➡️Click here to skip Fr Kormos rambling and head to the Good Stuff.
SO I ENDED UP up being able to get a new M1 Macbook from a friend who decided to sell it to me for a shockingly friendly price, 1 which meant that I can retire my old 2015 Retina Macbook Pro. Or, rather, to give it a new purpose at home to host stuff in the near future, because, well, I had this dock for it, and so it didn’t take up too much space, and I wouldn’t know what else to do with it, and…
So because I am not very fond of Ubuntu and Debian is best to only use when absolutely necessary, I went distro hunting, and decided upon Fedora Server for its ease of use, and its very attractive headless management webUI, cockpit
.
But then, laptops aren’t built to be servers. It is only us humans who were created for service. (Once-) Swanky laptops were created for … whatever they were created for, but they were not created to be servers.
So in the spirit of Making Things Do Things, I installed Fedora from an SD card, and there was great rejoicing, for the Wi-Fi worked out of the box without having to install the extra Broadcom wireless drivers that Pop!_OS needed on Reverend Madam’s old Macbook Air that I inherited and now use as a procrastination development machine. But I realised that server distros have different ideas about how they should behave, so, I needed to find ways to teach the Macbook not to turn off when I close the lid, but not keep the backlight on either.
I also wanted to use it through a wired connection, but of course (once-) swanky laptops do not have Ethernet ports, for that was deemed ever so passé at Infinite Loop, especially when they can sell you another entirely reasonably priced Thunderbolt to Ethernet adapter cable. Which I bought second hand off eBay, but Linux doesn’t always like Thunderbolt very much, so I had to install the Turns out the adapter Just Worked. (TM). And while I was in the swing of it, I also added some silly features, like saying bolt
package.please
for sudo
.
And because I tend to mess things up, and, as I am as confident as uneducated in matters of server management in Linux, a full server reinstall isn’t unheard of when I am tinkering away at such things. So I needed to make it easier for myself to set these things up again and again, so rather than just manually tweaking the config files, I put them all in a script, and then put the scripts on GitHub.
Anyway, this is a long-winded way of pointing you to our first ever official HackTheParish GitHub release! Please click here to have a look at my [^2] terrible code, and please peruse as you see it best:
This is a collection of provisioning scripts I cobbled together for my Early 2015 13” Retina Macbook Pro, which, after having faithfully served me for more than I expected as my daily driver, has now taken on a new assignment as a home server.
The scripts deal with little annoying things, like not being able to keep the machine awake with the lid closed by default, or they install things like Thunderbolt drivers so one can use the Gigabit Ethernet adapter properly.
The scripts were written on, and were only tested for the model mentioned above, the MacbookPro 12,1 / A1502 model. I don’t expect there should be any difficulty in getting it to work on any other models; as long as devices names like LID0
and intel_backlight
remained the same. If not, these should be really easy to adjust.
Run these in the following order for sanity’s sake. Scripts marked with 🥪 should be run with root
privileges (like, sudo
).
disable_lid_sleep.sh
to disable lid sleep functioncreate_aliases.sh
to create some fun aliasessetup_brightness.sh
to create the scripts that will turn the monitor on and off and enable turnscreen
aliassetup_lid_monitor.sh
to create the service to turn off screen brightness when the lid is closedThat’s it.
Some scripts should be generated in ~/.mbp-scripts
that enable the following.
/etc/systemd/logind.conf
turnscreen on
or turnscreen off
commands through an alias
created in .bashrc
for ~/.mbp-scripts/turnscreen.sh
please
for sudo
through adding an alias
to your .bashrc
file"~/.mbp-scripts/lid_monitor.sh"
as lid_monitor.service
For which I am eternally grateful to S.↩︎