Skip to content

Instantly share code, notes, and snippets.

View jwdeane's full-sized avatar

James Deane jwdeane

View GitHub Profile
@jwdeane
jwdeane / brew-perms.sh
Last active March 13, 2017 02:22 — forked from jaibeee/brew-perms.sh
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@jwdeane
jwdeane / get_latest_ami.sh
Created May 22, 2018 02:48
Get latest AWS EC2 Linux AMI
#!/bin/bash
# Assumes AWS CLI installed and configured with default region.
# To query an alternate region add the --region parameter, e.g.
# --region us-west-2
aws ec2 describe-images \
--owners amazon \
--filters "Name=name,Values=amzn-ami-hvm*ebs" \
--query 'sort_by(Images,&CreationDate)[-1].ImageId' \
@jwdeane
jwdeane / gist:568989fc93a95aa8eb48e6b1bd2b19c7
Created March 27, 2019 22:24
Import SQL dump into Docker container
# Grab and run MariaDB image
docker run --name mariadb -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=db -d mariadb:latest
# Restore a dump into the DB
docker exec -i mariadb mysql -uroot -psecret --database=db < dump.sql