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 / keybase.md
Created April 24, 2014 05:01
keybase.md

Keybase proof

I hereby claim:

  • I am joshkerr on github.
  • I am joshkerr (https://keybase.io/joshkerr) on keybase.
  • I have a public key whose fingerprint is 616C 1AC3 856C D3DF 367E 4FDA D58F F8B7 9892 9570

To claim this, I am signing this object:

@joshkerr
joshkerr / keybase.md
Created April 24, 2014 05:01
keybase.md
Verifying myself: I am joshkerr on Keybase.io. L50ljgN90QqpIc4pds35g1vyfWtgNnCaJ5ro / https://keybase.io/joshkerr/sigs/L50ljgN90QqpIc4pds35g1vyfWtgNnCaJ5ro
@joshkerr
joshkerr / gist:8722121
Created January 30, 2014 23:11
Outbrain HTML code modified for the Ghost blog to identify an article
<div data-src="{{url absolute="true"}}" class="OUTBRAIN" ></div>
@joshkerr
joshkerr / gist:8722112
Created January 30, 2014 23:10
Javascript that you need to filter out of Outbrain code after claiming your site.
<script LANGUAGE="JavaScript" src="http://widgets.outbrain.com/claim.js"></script>
@joshkerr
joshkerr / gist:8722061
Created January 30, 2014 23:06
Outbrain header code for Ghost
<script type="text/javascript" src="/assets/js/index.js"></script>
<input type="hidden" name="OBKey" value="uQvij8Yrefads3ViJGeOkFrtF1w=="/>
<script LANGUAGE="JavaScript">var OBCTm='13911181123435002'; </script>
<script LANGUAGE="JavaScript" src="http://widgets.outbrain.com/claim.js"></script>
@joshkerr
joshkerr / gist:8722031
Created January 30, 2014 23:05
Outbrain Ghost snippet
<section class="outbrain-footer">
<!-- Outbrain -->
<div data-src="{{url absolute="true"}}" class="OUTBRAIN" ></div>
<script type="text/javascript">(function(){window.OB_platformType=8;window.OB_langJS="http://widgets.outbrain.com/lang_en.js";window.OBITm="1391118134997";window.OB_recMode="brn_box";var ob=document.createElement("script");ob.type="text/javascript";ob.async=true;ob.src="http"+("https:"===document.location.protocol?"s":"")+"://widgets.outbrain.com/outbrainLT.js";var h=document.getElementsByTagName("script")[0];h.parentNode.insertBefore(ob,h);})();</script>
</section>