Skip to content

Instantly share code, notes, and snippets.

View joshkerr's full-sized avatar

Josh Kerr joshkerr

View GitHub Profile
@joshkerr
joshkerr / getfile.sh
Created April 15, 2024 19:39
This shell script will allow you to specify a directory on a remote system and then present you a list of files/folders allowing you to choose 1 and then copy it to the current directory using rclone. You must have rclone setup already to use this script.
#!/usr/bin/env bash
# Function to list files and let user choose one to download
download_from_remote() {
# Select a remote folder
remote="remote:/path/to/folder/"
# List files on the specified remote and path
files_json=$(rclone lsjson "$remote")
@joshkerr
joshkerr / getrecipe.sh
Created June 26, 2020 18:51
This shell script will convert any recipe website link into just the ingredients and directions. Great for when you just want the recipe and not all of the other stuff.
curl -sG "https://plainoldrecipe.com/recipe" -d "url=${1}" | pandoc -f html -t markdown
@joshkerr
joshkerr / rclone-copy.sh
Created January 24, 2020 20:23
rclone to Google Drive using Team drives and switching between them to prevent API limitations.
#!/bin/sh
lastsync=$(tail -1 lastsync.txt | head -1)
if [ $lastsync = "Team" ]; then
teamnumber=""
echo "Team1" > lastsync.txt
elif [ $lastsync = "Team1" ]; then
teamnumber="1"
echo "Team2" > lastsync.txt
@joshkerr
joshkerr / index.html
Created August 15, 2012 13:41
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@joshkerr
joshkerr / index.html
Created August 15, 2012 13:41
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@joshkerr
joshkerr / test-gist-io.markdown
Created July 19, 2012 01:25
Testing Gist.io

So I'm trying out Gist.io which lets you write a gist and then publish it as a nicely formatted markdown blog entry. This is useful because:

  • It isn't really useful
  • I'm just a whore for markdown, so publish something that uses it and I'll try it
  • I have free time

And thats all she wrote.

@joshkerr
joshkerr / osx_hacks.txt
Created September 20, 2011 18:54
Some great OSX hacks
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Make Dock icons of hidden applications translucent
defaults write com.apple.dock showhidden -bool true
# Disable menu bar transparency
@joshkerr
joshkerr / websitebackup.sh
Created April 26, 2011 17:40
Downloading a website for backup
# Change the /website to be the folder you want to download to
# Change the example.com to be the website you want to pull down
# This will pull down public pages
wget -m -p -P ~/website example.com
# This will sync using SSH
rsync -avz --delete ~/website/ me@example.com:path/to/website
@joshkerr
joshkerr / My bash prompt
Created April 6, 2011 16:27
Really nice bash prompt settings
#Custom bash prompt
export CLICOLOR=1;
PS1='\[\033[01;32m\]\u\[\033[01;34m\]::\[\033[01;31m\]\h \[\033[00;34m\]{ \[\033[01;34m\]\w \[\033[00;34m\]}\[\033[01;3$\[\033[00m\]'
@joshkerr
joshkerr / create_post
Created April 6, 2011 16:13
This is a quick script to create a new post in Jekyll
# create a new post and fill the template
alias create="sh ~/.postname"
# the contents of ~/.postname:
#!/bin/zsh
################
# Get our info #
################
yearmonth=`date "+%Y/%m"`