Skip to content

Instantly share code, notes, and snippets.

View ivorscott's full-sized avatar

Ivor Scott Cummings ivorscott

View GitHub Profile
@ivorscott
ivorscott / startup.sh
Created March 31, 2022 15:51
Ubuntu VM startup script
#!/bin/bash
sudo apt update
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
tpl="<html>
<head>
<title>Example</title>
<style>
@ivorscott
ivorscott / preview.go
Created June 14, 2020 18:18
Open file in default Mac browser
func preview(fname string) error {
const GOOS string = runtime.GOOS
switch {
case GOOS == "darwin":
if err := exec.Command("open", fname).Start(); err != nil {
return err
}
default:
docker-compose run migration create_products_table
docker-compose run migration add_tags_to_products
hey -c 10 -n 2000 https://localhost:4000/v1/products
go tool pprof http://localhost:6060/debug/pprof/profile\?seconds\=10
docker-compose exec debug-api dlv connect localhost:2345
touch ./api/internal/schema/seeds/products.sql
docker-compose exec db psql postgres postgres -f /seed/products.sql
volumes:
- postgres:/var/lib/postgresql/data
- ./api/scripts/:/docker-entrypoint-initdb.d/