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 / salt_on_mac.md
Last active March 10, 2024 10:38
Install and Run Salt Stack on macOS Servers and Desktops

Install Salt on macOS

Install Homebrew

Install Dependencies

brew install python swig zmq
@ryanmaclean
ryanmaclean / ebs.sh
Created December 18, 2016 19:10
GitLab Runner EBS
sudo mkfs -t ext4 /dev/xvdf
sudo mkdir /ebscache
sudo mount /dev/xvdf /ebscache
sudo cp /etc/fstab /etc/fstab.orig
echo "/dev/xvdf /ebscache ext4 defaults,nofail 0 2" | sudo tee -a /etc/fstab
sudo mkdir /ebscache/cache
sudo mkdir /ebscache/build-cache
sudo chown gitlab-runner:gitlab-runner /ebscache/cache
sudo chown gitlab-runner:gitlab-runner /ebscache/build-cache
@ryanmaclean
ryanmaclean / efs.sh
Last active December 9, 2021 19:03
Gitlab Runner EFS (NFS)
sudo mkdir /ebscache/cache
sudo mkdir /ebscache/build-cache
sudo chown gitlab-runner:gitlab-runner /ebscache/cache
sudo chown gitlab-runner:gitlab-runner /ebscache/build-cache
sudo chmod -R 755 /ebscache/cache
sudo chmod -R 755 /ebscache/build-cache
sudo rm -rf /cache
sudo ln -s /ebscache/cache /cache
sudo rm -rf /build-cache
sudo ln -s /ebscache/build-cache /build-cache
@ryanmaclean
ryanmaclean / gist:e8e6096b652c3e23e4855e34dad0fa71
Created November 19, 2016 16:44 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@ryanmaclean
ryanmaclean / ubuntu_mount_efs.md
Last active October 25, 2024 10:25
Mount EFS on Ubuntu Linux

EFS Mounting on Ubuntu

Get EFS ID

aws configure set preview.efs true
aws efs describe-file-systems --profile TEST --region us-east-2
{
@ryanmaclean
ryanmaclean / gzip_10_biggest.sh
Created October 26, 2016 23:07
Gzip 10 Largest Files
#!/usr/bin/env bash
# Find the 10 largest files in a directory and transparently zip them
for i in $(du -hsx * | sort -rh | head -10 | awk '{print $2}'); do gzip $i; done
@ryanmaclean
ryanmaclean / rename_to_old.sh
Last active October 25, 2016 23:35
Rename file to .old
#!/usr/bin/env bash
mv $1{,.old}
@ryanmaclean
ryanmaclean / iso_mount_copy.sh
Last active October 12, 2016 18:15
Traverse directories, mount ISOs and copy files out of them
#!/bin/bash
printf '\e[31m *** This command will traverse subfolders ***\e[0m\n'
printf '\e[31m *** and mount each ISO found and copy the contents ***\e[0m\n'
printf '\e[31m *** to the directory of the ISO, then unmount the ISO ***\e[0m\n'
printf '\e[31m *** and delete it permanently. ***\e[0m\n'
read -r -p "Are you sure you would like to proceed? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
@ryanmaclean
ryanmaclean / playlist-dl.sh
Created October 9, 2016 22:05
Download Youtube Playlist From Conference Before a Flight on Windows 10 Using Ubuntu on Windows
sudo curl -L https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl`
sudo chmod a+rx /usr/local/bin/youtube-dl
/usr/local/bin/youtube-dl -f mp4 -o "%(autonumber)s - %(title)s - %(id)s.%(ext)s" --autonumber-size 2 https://www.youtube.com/playlist?list=PLD409ujd87ZsfNMffX9h1rGNVqnC
@ryanmaclean
ryanmaclean / add_erl_dns_host.sh
Created October 4, 2016 18:28
Add a DNS entry on Edge Router Lite Via Command Line
#!/bin/bash
set system static-host-mapping host-name headnode.localdomain.local alias headnode
set system static-host-mapping host-name headnode.localdomain.local inet 10.10.1.50