Skip to content

Instantly share code, notes, and snippets.

@johnnymatthews
johnnymatthews / cmus-osx.sh
Created October 10, 2019 15:41
Update your CMUS cache with a keypress.
# 1. Create a file called update-library.sh and add the following lines.
#!/bin/bash
cmus-remote -C clear
cmus-remote -C "add ~/Music"
cmus-remote -C "update-cache -f"
cp ~/Music/Playlists/* ~/.config/cmus/
# 2. Change permissions to make the script executable:
@johnnymatthews
johnnymatthews / Recover Public from Private SSH Key
Last active January 17, 2019 16:11
This line allows you to recover your public ssh key from your private key. Assuming your private key is called `id_rsa` and you want your public key to be called `id_rsa.pub`.
# This line allows you to recover your public ssh key from your private key.
# Assuming your private key is called `id_rsa` and you want your public key
# to be called `id_rsa.pub`.
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
# Your id_rsa file needs to have the correct permissions assigned to it. Run
# this line to set them.
sudo chmod 600 ~/.ssh.id_rsa
@johnnymatthews
johnnymatthews / Symlink default folders to Google Drive on OSX.sh
Last active April 5, 2018 18:42
Deletes the default folders in OSX and replaces them with Symlinks to folders in a Google Drive installation.