Recently I wanted to be able to backup my Mac via TimeMachine, but unfortunately I did not have a large enough HDD to back up, so I’ve decided to backup to one of my servers. Not until recently that was not an option until I ran into a blog post that produced an step by step configuration to run successfully, but what I did find out was that my server was getting full and TimeMachine did not do a good enough job deleting old backups. So, I found a single command to limit the backups, but what I found was that if the plist has been already copied (meaning a backup was already ran), the new limits won’t be recognized. So you will need to run a new backup with carrying the limits on the new plist to the server.
Below are the steps to successfully be able to config a TimeMachine backup server with limits on your backups so you don’t run out of storage 😉 .
Ensure that you have a ubuntu 20.04 LTS image running with enough storage to perform the backups
Run sudo apt install -y netatalk avahi-daemon
Run sudo vi /etc/netatalk/afp.conf
Add a section for your Time Machine: [Time Machine] path = /media/path/to/backups time machine = yes
Create a directory to act as the Time Machine: sudo mkdir -p /media/path/to/backups
Run sudo chown nobody:nogroup /media/path/to/backups
Run sudo chmod 777 /media/path/to/backups
Restart netatalk: sudo service netatalk restart
Now, on your Mac, before doing anything else, might be smart to put a limit on your backup. The command below will put a 100GB limit. sudo defaults write ~/Library/Preferences/com.apple.TimeMachine MaxSize 102400
At this point… you should be able to open the Time Machine settings in System Preferences and use Select Disk… to pick your new Time Machine backup drive. Where /media/path/to/backups should show up on the path.
I’ve been exploring dockerizaton lately more and more and I think I like the idea of having my apps in containers. I am not going to lie, it does take some time to get used to, but it is pretty cool the things that you can do.
One thing that I think I wanted to accomplish was able to run X11 apps through docker. I found Docker Headless VNC container and that was slick. Where I was able to run a whole Xfce environment within a Docker container!!! kudos to those folks. Now, my challenge was that in my case, I didn’t want a fat image and/or configure each app to download of configuring. So, this wasn’t my solution at this time. So, I decided to explore further and found a way to run X11 from a Docker container in macOS. Below are the steps on how to accomplish this.
Install socat which is a “multipurpose relay.” This will allow us to call the display.
brew install socat
Create you local Dockerfile. In this particular case, I am using Ubuntu latest (which at the time of this post is 16.04.1 LTS). On your terminal, you can do “vi Dockerfile” and paste the info from below in that file.
RUN apt-get update && apt-get install -y firefox
RUN useradd -ms /bin/bash developer && \
echo "\ndeveloper ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
ENV HOME /home/developer
Then, let’s build the Docker image by doing the following…
docker build -t firefox .
Now, on a different terminal, run the following command…