Skip to content

Instantly share code, notes, and snippets.

@FrancisTurner
FrancisTurner / checkv6cfd.sh
Created June 7, 2021 10:21
Script to autoupdate armv6 cloudflared
#!/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
@FrancisTurner
FrancisTurner / txt2json.sh
Created December 6, 2021 07:29
txt2json sed oneliner
sed -e 's/^/"/' -e 's/$/",/' -e '1 s/^/[/' -e '$ s/,$/]/' file.txt > file.json
@FrancisTurner
FrancisTurner / getpigo.sh
Last active December 13, 2021 06:28
One liner to retrieve the latest released go version for raspberry pis
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