Skip to content

Instantly share code, notes, and snippets.

View ianscrivener's full-sized avatar

Ian Scrivener ianscrivener

View GitHub Profile
@ianscrivener
ianscrivener / Install whatever node.js version on raspberry pi, inclusing armv6l Usage of unofficial builds of node.js to install node.js on Raspberry pi (armv6l)
#Download from https://unofficial-builds.nodejs.org/download/release/ the appropriate build for armv6l, example https://unofficial-builds.nodejs.org/download/release/v18.9.1/node-v18.9.1-linux-armv6l.tar.gz
wget https://unofficial-builds.nodejs.org/download/release/v18.9.1/node-v18.9.1-linux-armv6l.tar.gz
tar -xzf node-v18.9.1-linux-armv6l.tar.gz
cd node-v18.9.1-linux-armv6l
sudo cp -R * /usr/local
node -v
@ianscrivener
ianscrivener / remove-systemctl-service.sh
Created December 29, 2023 11:08 — forked from binhqd/remove-systemctl-service.sh
Remove systemctl service
sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
#rm /etc/systemd/system/[servicename]
#rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
from time import sleep
import ssl
import json
import os
from paho.mqtt.client import Client
username = "your VRM email"
password = "your VRM pasword"
portal_id = "your VRM portal ID"
@ianscrivener
ianscrivener / provision_ubuntu2004_qemu_macosx.sh
Created May 7, 2023 21:46 — forked from relyt0925/provision_ubuntu2004_qemu_macosx.sh
Provisions a Ubuntu 20.04 VM in QEMU on Mac OSX using Cloud-Init
#!/usr/bin/env bash
#Install brew and qemu + cloud init metadata dependencies
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install qemu
brew install cdrtools
rm -rf /tmp/ubuntuqemuboot
#download Ubuntu 20.04 Cloud Image and resize to 30 Gigs
mkdir -p /tmp/ubuntuqemuboot/images
@ianscrivener
ianscrivener / microk8s.ps1
Created May 7, 2023 02:43 — forked from ferdinandosimonetti/microk8s.ps1
MicroK8s (+ some IaaC tools) preparation via Multipass for Windows 10 Pro (client Hyper-V enabled)
# Enable Hyper-V feature (reboot needed)
#### Install Multipass from https://github.com/CanonicalLtd/multipass/releases/
#### Create your Ubuntu LTS VM (on your Hyper-V / Virtualbox machine)
multipass launch --cpus 2 --mem 2G --name microk8s --disk 40G
# Update & upgrade
multipass exec microk8s -- sudo apt-get -y update
multipass exec microk8s -- sudo apt-get -y upgrade
multipass exec microk8s -- sudo apt -y autoremove
# getting rid of "nano" as default editor
multipass exec microk8s -- sudo update-alternatives --set editor /usr/bin/vim.basic
@ianscrivener
ianscrivener / user-data
Created January 22, 2021 12:48 — forked from hvanderlaan/user-data
Cloud init headless install rpi wifi
#cloud-config
# vim: syntax=yaml
#
# The current version of cloud-init in the Hypriot rpi-64 is 0.7.9
# When dealing with cloud-init, it is SUPER important to know the version
# I have wasted many hours creating servers to find out the module I was trying to use wasn't in the cloud-init version I had
# Documentation: http://cloudinit.readthedocs.io/en/0.7.9/index.html
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
@ianscrivener
ianscrivener / cloud-init.yml
Created January 22, 2021 12:48
Cloud Init Example
#cloud-config
package_upgrade: true
packages:
- zsh
- tmux
- nmap
- curl
- wget
- git
- htop
@ianscrivener
ianscrivener / cloud-init.yaml
Created January 22, 2021 12:47 — forked from syntaqx/cloud-init.yaml
cloud init to install docker on ubuntu
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
manage-resolv-conf: true
resolv_conf:
nameservers:
- '8.8.8.8'
@ianscrivener
ianscrivener / calc_ndvi_gdal.py
Created December 15, 2020 13:04 — forked from jgomezdans/calc_ndvi_gdal.py
Simple script to calculate NDVI using pure GDAL
from osgeo import gdal
import numpy
g = gdal.Open ("baikal_subset.tif")
if g is None:
raise IOError, "Couldn't open baikal_subset.tif"
b3 = g.GetRasterBand(3).ReadAsArray().astype(np.float32)
b4 = g.GetRasterBand(4).ReadAsArray().astype(np.float32)
@ianscrivener
ianscrivener / remove_gui_from_debian.sh
Created August 16, 2020 12:21 — forked from gismo141/remove_gui_from_debian.sh
Remove all GUI-related Packages from Existing Debian-Installation
apt-get remove -y --purge x11-common
apt-get autoremove -y --purge
apt-get install -y deborphan
deborphan | xargs dpkg -P # do this a bunch of times