Skip to content

Instantly share code, notes, and snippets.

@FrancisTurner
FrancisTurner / getpigo.sh
Last active Dec 13, 2021
One liner to retrieve the latest released go version for raspberry pis
View getpigo.sh
curl -L https://golang.org/dl/$(curl -s https://api.github.com/repos/golang/go/git/matching-refs/tags/go | grep '/ref' | sed -e '/beta/ d' -e '/rc/ d' -e 's/.*\(go[0-9.]*\).*/\1/' | tail -1).linux-armv6l.tar.gz | sudo tar -xzC /usr/local
# change armv6l for arm64 to get the 64 bit version for pi 4s
#set up etc.
echo 'PATH=$PATH:/usr/local/go/bin' >> ~/.profile
source ~/.profile
which go
go version
#optionally
# echo 'GOPATH=/home/pi/golang' >> ~/.profile
# mkdir /home/pi/golang
@FrancisTurner
FrancisTurner / txt2json.sh
Created Dec 6, 2021
txt2json sed oneliner
View txt2json.sh
sed -e 's/^/"/' -e 's/$/",/' -e '1 s/^/[/' -e '$ s/,$/]/' file.txt > file.json
@FrancisTurner
FrancisTurner / checkv6cfd.sh
Created Jun 7, 2021
Script to autoupdate armv6 cloudflared
View checkv6cfd.sh
#!/bin/bash -e
# checkv6cfd.sh
# Copyright (c) 2021, Francis Turner
# All rights reserved.
#
# Script that automates checking and if required downloading and replacing of the
# latest armv6 cloudflared as built by Darren Hobin (https://github.com/hobindar)
# for use on pi zeros and other armv6 devices