Skip to content

Instantly share code, notes, and snippets.

View ryanmaclean's full-sized avatar
Harnessing GenAI 💜

Ryan MacLean ryanmaclean

Harnessing GenAI 💜
View GitHub Profile
@ryanmaclean
ryanmaclean / triton_usb_download.sh
Last active October 21, 2016 00:09
Download Joyent Triton SDC USB Image
#!/bin/env bash
# A script to quickly download the latest image of Open Source Joyent Triton SDC for USB "DC on a stick" servers
# Check if aria2 is installed, otherwise, install it
command -v aria2c >/dev/null 2>&1 || { sudo apt install -y aria2; exit 1; }
# Download 5 streams of the file at once
# I found 5 to be the maximum, each topping out around 300kb/s
aria2c -x 5 https://us-east.manta.joyent.com/Joyent_Dev/public/SmartDataCenter/usb-latest.tgz --async-dns=false
@ryanmaclean
ryanmaclean / sierra_boot_usb.sh
Last active May 6, 2017 21:07
Create macOS Sierra USB Installation Disk
#!/bin/bash
## The drive will need to be named "USB"
## It should be over 8GB large
sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/USB --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@ryanmaclean
ryanmaclean / check_docker_tag.sh
Created September 29, 2016 18:05
Check if Docker Image with Tag Exists
#!/bin/bash
# This script will check to see if a Docker image exists for a specific tag.
# Taken from here, with love: https://www.reddit.com/r/docker/comments/4hwdma/check_if_an_image_tag_for_a_private_repo_exists/
TOKEN=$( curl -sSLd "username=${DOCKER_HUB_USERNAME}&password=${DOCKER_HUB_PASSWORD}" https://hub.docker.com/v2/users/login | jq -r ".token" )
curl -sH "Authorization: JWT $TOKEN" "https://hub.docker.com/v2/repositories/${DOCKER_REPO}/tags/${DOCKER_TAG}/" | jq .
#{
# "name": "latest",
# "id": 780668,
@ryanmaclean
ryanmaclean / openbsd_restart_sshd.sh
Last active September 10, 2016 17:30
OpenBSD Restart OpenSSHd
#!/bin/sh -
kill -HUP $(cat /var/run/sshd.pid)
#!/bin/bash
# Profile and Region are optional
aws efs describe-file-systems --profile dev --region us-east-1 | jq -r ".FileSystems[] | .FileSystemId"
@ryanmaclean
ryanmaclean / promiscous_enable.sh
Last active July 18, 2024 14:58
Allow VMWare Fusion Promiscuous Mode on macOS Sierra
#!/bin/bash
sudo touch "/Library/Preferences/VMware Fusion/promiscAuthorized"
@ryanmaclean
ryanmaclean / ub_dhcpd_lease_list.sh
Last active August 23, 2016 20:16
Ubiquity EdgeRouter Lite DHCPd Leases from Command Line
cat /config/dhcpd.leases | grep -E '(lease|client-hostname)' | tr -d {
@ryanmaclean
ryanmaclean / mesos_mac_slave.sh
Created August 9, 2016 00:30
Start Mesos Mac Slave
#!/bin/bash
/usr/local/sbin/mesos-slave --master=10.1.1.1:5050
@ryanmaclean
ryanmaclean / mac_hostname.sh
Created August 9, 2016 00:29
Mac Hostname Script
#!/bin/bash
newhostname=nmp
echo "$(ipconfig getifaddr en0) $newhostname" | sudo tee -a /etc/hosts
sudo scutil --set HostName $newhostname
@ryanmaclean
ryanmaclean / fix_mini.sh
Created August 9, 2016 00:28
Mac Mini 2014 Slow
#!/bin/bash
sudo rm ~/Library/Caches/CloudKit/CloudKitMetadata*;sudo killall cloudd