Skip to content

Instantly share code, notes, and snippets.

@gsf
gsf / ubu-on-mac.md
Last active November 9, 2024 03:35
Ubuntu VM on macOS with QEMU

Ubuntu VM on macOS with QEMU

For work I have an Intel Core i5 MacBook. With the Docker Desktop license changes I looked into minikube and Multipass but both failed when I got on our VPN with Cisco AnyConnect due to bridged networking in hyperkit (see links at bottom).

I realized I would be happy SSHing into a local Linux VM but passed on VirtualBox to avoid depending on legacy system extensions. I landed on libvirt for the VM, then realized I could remove libvirt from the equation to finally end up at this quick, simple setup for an Ubuntu VM on macOS with QEMU.

First, install QEMU (see https://wiki.qemu.org/Hosts/Mac for other o

import csv
import googlemaps
import os
import re
import time
gmaps = googlemaps.Client(key=os.getenv('GOOGLE_API_KEY'))
origins = ['559 Carpenter Ln, Philadelphia, PA 19119, USA']
@gsf
gsf / cgitrc
Created July 30, 2017 02:50
cgit at subdirectory on nginx and uwsgi
css=/s/cgit.css
logo=/s/cgit.png
virtual-root=/s/
remove-suffix=1
scan-path=/srv/git/
var BASE00 = '#000000';
var BASE01 = '#303030';
var BASE02 = '#505050';
var BASE03 = '#b0b0b0';
var BASE04 = '#d0d0d0';
var BASE05 = '#e0e0e0';
var BASE06 = '#f5f5f5';
var BASE07 = '#ffffff';
var BASE08 = '#fb0120';
var BASE09 = '#fc6d24';
while read url; do
bn="`basename $url`"
echo Uploading $bn ...
curl "$url" > tmp.pdf
aws s3 cp tmp.pdf "s3://phila-business/$bn"
done < ec2-PDFs.txt
server {
#server_name business.phila.gov;
include https_redirect.conf;
location / {
proxy_set_header Host business.phila.gov;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://170.115.248.33/;
}

I looked into proxying to current site so we can switch DNS over for business.phila.gov.

Last night I decided to hold off on Docker. For now I'll build up machines the old-fashioned way, with multiple services and users on each machine. More complicated interactions to maintain but it can still be kept in code. I was scared off a bit by the init issues and maybe took my own kind of inspiration from the advice to get it done first.

french toast

Yesterday I made brunch for everyone. French toast! Courtney made fantastic carrot and quinoa burgers for dinner.

We went to the park to kick the ball around but Roan mostly wanted to slide, swing, and watch people play basketball.

I stayed up too late last night watching the last episodes of The Legend of Korra. Who knew the show would venture into realizations of sexual orientation in its final moments?

I met up with Ben and paid him for work done on the house. We walked and talked along a rainy Baltimore Avenue. He's good.

Before that I played footy with Kevin and others. Saw Mike for a second when he stopped by to watch. Kara said our house listing sparked momentary for around their recent purchase.

I'm spinning up a DigitalOcean droplet to test out Nginx and Lua. Could be great if it works.

Dilworth Park

I'm in the lab this morning. I was up at a quarter to 7 when Courtney brought Roan out of the bedroom to me on the futon in the living room. We threw the ball at the wall and read some books. I meditated while he did his own thing.

"This is What it Feels Like" by BANKS is in my head as it has been off and on for the past few months.

I watched this video on CloudFlare log handling that again confirmed the performance of Nginx and Lua.

Got out of work at 2pm and played some soccer, took a shower (and gave Ro a bath), and worked a bit more at fireworks.