Skip to content

Instantly share code, notes, and snippets.

View jamesiarmes's full-sized avatar

James Armes (they/them) jamesiarmes

View GitHub Profile
@gsf
gsf / ubu-on-mac.md
Last active April 15, 2024 12:47
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

@hopsoft
hopsoft / db.rake
Last active May 6, 2024 14:00
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd