Skip to content

Instantly share code, notes, and snippets.

@davespanton
davespanton / index.mjs
Created September 2, 2022 09:55
Shopify CLI partners cli auth token issue
import { api, session } from '@shopify/cli-kit'
import keytar from 'keytar'
if (!process.env.SHOPIFY_API_KEY) {
console.error("SHOPIFY_API_KEY not set")
process.exit(1)
}
if (process.env.SHOPIFY_CLI_PARTNERS_TOKEN) {
console.log("Using token from SHOPIFY_CLI_PARTNERS_TOKEN")
{
"itn": {
"owner": "ed25519_pk19y730k7dqqtm659dy9g6tx56aa3ymrqd59cema57qtk8qvdeq95ska9eq5",
"witness": "ed25519_sig1psl8n8f2hvyjag3dzmw8msa8sg7y4jvn8q3ukzw5lzc8ph542yyhrmu3lrdf4qx9xaycqn45chvf9zq8m6620p6m4ungv76aad2hjps3cc09r"
}
}
{
"name": "ADA.ZONE",
"description": "Reliable London Stake Pool 🇬🇧",
"ticker": "ZONE",
"homepage": "https://ada.zone",
"extended": "https://bit.ly/31a5HBb"
}

Keybase proof

I hereby claim:

  • I am davespanton on github.
  • I am davespanton (https://keybase.io/davespanton) on keybase.
  • I have a public key ASAZFLCA5-y2I3yfIrmTYQdNwfCrgS_RAbsN4tPiJGz6jQo

To claim this, I am signing this object:

@davespanton
davespanton / yubiclip.ps1
Last active May 20, 2017 20:47
Copy a yubioath mfa token to the clipboard.
(yubioath | select-string -pattern "XXXX").ToString() | select-string -pattern "[0-9]{6}$" | %{$_.Matc
hes} | %{$_.Value} | clip
#! /bin/bash
# Usage:
#
# Set $MFA_ARN to be your mfa device's arn from AWS. (Maybe hardcode this if running all the time).
# Run `source aws_temp_creds.sh` and enter a valid mfa code when prompted.
set -e
if [ -z ${MFA_ARN+x} ]; then echo "MFA_ARN is unset"; exit 1; fi
@davespanton
davespanton / aws_temp_creds.fish
Last active October 4, 2016 07:33
Temp AWS creds with MFA via Yubikey Oath.
#! /usr/bin/fish
function aws_temp_creds -a mfa_arn aws_acc_nos -d "Sets AWS temp credentials with MFA via a Yubikey."
for i in (env | grep AWS | cut -f 1 -d "=")
set -e $i
end
set -l MFA (yubioath show $aws_acc_nos | tail -c 7)
count $MFA > /dev/null; or return 1
@davespanton
davespanton / docker-storage.sh
Created January 4, 2016 22:09
Docker storage on external drive
# pseudo script...
mkfs.btrfs /dev/sdb
mkdir /var/lib/docker-btrfs
mount /dev/sdb /var/lib/docker-btrfs/
service docker stop
# the follow will test it, then stick the options in /etc/default/docker (or wherever)
docker -d -s btrfs --graph="/var/lib/docker-btrfs" -H unix:///var/run/docker.sock
@davespanton
davespanton / openvpn.sh
Created November 20, 2015 16:26
Start OpenVPN on CromeOS.
#! /bin/sh
# OpenVPN on ChromeOS (as root on chronos)
openvpn --mktun --dev tun0
openvpn --config client.ovpn --dev tun0 --auth-user-pass
@davespanton
davespanton / columnz.factor
Created May 7, 2013 14:01
Columnz challenge in Factor
USING: kernel locals sequences ;
IN: columnz
:: all-equal-first? ( col -- ? )
col [ col first = ] all? ;
: sum-or-first ( seq -- n )
dup all-equal-first? [ first ] [ sum ] if ;
: sum-or-first-seq ( seq -- seq )