Skip to content

Instantly share code, notes, and snippets.

View CharlesGodwin's full-sized avatar

Charles Godwin CharlesGodwin

  • Canada
View GitHub Profile
@CharlesGodwin
CharlesGodwin / cleancsv.py
Created May 10, 2022 14:13
A python program to sanitize CSV files for loading into MySQL
#!/usr/bin/env python
#
# MUST be at least python 3.7
#
import argparse
import csv
import os
import re
import sys
from collections import OrderedDict
@CharlesGodwin
CharlesGodwin / setup-poe-hat.sh
Last active December 1, 2023 13:37
How to set up the WaveShare Raspberry Pi PoE HAT Type (B) with display
#!/bin/bash
# 2022-01-01 Charles Godwin
# Derived from https://www.waveshare.com/wiki/PoE_HAT_(B)
# enable i2c interface if necessary
# Read the following for details
# https://gist.github.com/CharlesGodwin/adda3532c070f6f6c735927a5d6e8555#file-waveshare-poe-hat-md
#
IS_I2C=`sudo raspi-config nonint get_i2c`
[ $IS_I2C -ne 0 ]&&sudo raspi-config nonint do_i2c 0
# install required packages
@CharlesGodwin
CharlesGodwin / cloudflare.md
Last active January 13, 2024 19:49
I Don't Need Port Forwarding and Don't Care About CGNAT

I Don't Need Port Forwarding and Don't Care About CGNAT

This was rewritten 2022-11-30

This article is for users that want all these features:

  • To connect to home network from anywhere
  • Can connect without any port forwarding; either by choice or internet provider can't or won't provide access
  • No setup or configuration or installation on client machine
  • No enrolment / registration required
@CharlesGodwin
CharlesGodwin / How to use ssh-copy-id.md
Last active April 19, 2024 20:54
Windows 10/11 scripts to support ssh-copy-id which is missing in Windows OpenSSH

The Windows version of OpenSSH client doesn't include a ssh-copy-id command. I don't know why. If it does one day, then this can be ignored.

NOTE If you have Windows Subsystem for Linux (WSL) installed, you can use the linux version of ssh-copy-id instead. Go to the description at the end of this document.

  • Download the file ssh-copy-id.cmd to your Windows PC, or copy and paste its contents.
  • Run the script passing your linux ssh information (for example ssh-copy-id.cmd pi@raspberrypi.local). This should work with any Linux platform. Alternatively, if you have experience, you can use the powershell version. ssh-copy-id.ps1. Run the script as powershell .\ssh-copy-id.ps1 pi@raspberrypi.local.
  • Run the command for each linux account you connect with. You will be prompted for your Linux host password. If you have more than 1 account on any machine, you must do this for each account.

The file name and location of the script is not important but the filename extension must be .cmd