Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile
@HarvsG
HarvsG / aHowTo80211ronQSKD.md
Last active February 3, 2023 01:59
A hacked Qualcomm SDK OpenWRT 150.05 /lib/wifi/hostapd.sh to get 802.11r working. A copy of my /etc/config/wireless as well

How to get 802.11r (Fast Transition) working on Qualcomms fork of OpenWRT 15.05. In this case on a Gl-inet router

Unfortunately just setting the 4 lines as detailed in this reddit post almost works, however hostapd fails to start due to the auto generated r0kh strings having incorrect formatting. The sypmtom was that the network would appear as open and devices would fail to connect.

image

As far as I can tell at the time of writing, this r0khs are unecessary with WPA2-PSK forms of authentication if ft_psk_generate_local=1 is enabled in hostapd. So I commented out lines 688 - 690 of /lib/wifi/hostapd.sh

@HarvsG
HarvsG / HA-GLinet-Intergration.md
Last active June 24, 2021 13:54
My plan to build a GL inet integration for HomeAssistant

How to create a new env for a jupyter workspce

  1. Ensure that the requirement for working with envs are installed sudo apt install python3-venv

  2. Work out the python version you want to work with python --version or python3 --version or which python

  3. Once you have chosen the python version cd to the directory you want the env to be stored in

  4. run /path/to/my/python3 -m venv nameOfEnv of course this may just be python not python3

  • in my case /usr/bin/python3
.markup.jupyter {
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
@HarvsG
HarvsG / installNewPython.md
Last active November 14, 2020 22:55
How to install a new version of python on the raspberry pi

Install the packages for compiling $ sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev wget

Set the python version you want $ version=3.8.5

Download $ wget https://www.python.org/ftp/python/$version/Python-$version.tgz ~/

Extract the file

@HarvsG
HarvsG / aOracleAlwaysOnWGVPN.md
Last active October 22, 2023 12:29
How I set up and always on wigaurd PiHole VPN and DNS
@HarvsG
HarvsG / gitea-blog.md
Last active July 15, 2021 02:52
draft for gitea blog post
date author title tags draft
2020-07-22T20:00:00+00:00
HarvsG
How to render Jupyter Notebooks on Gitea
rendering
jupyter
ui
true

How to render Jupyter Notebooks on Gitea


.markup.jupyter { /*!
*
* Twitter Bootstrap
*
*/
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
@HarvsG
HarvsG / mpmp3.py
Last active April 21, 2020 18:53
My solution to Matt Parker's SCRABBLE PUZZLE (MPMP PUZZLE 3) https://www.youtube.com/watch?v=JaXo_i3ktwM&t
import sys
if sys.version_info[0] < 3:
raise Exception("Python 3 or a more recent version is required.")
# this will serve as a dictionary of what each tile face is worth
scores = {"A": 1 , "B": 3 , "C": 3 , "D": 2 ,
"E": 1 , "F": 4 , "G": 2 , "H": 4 ,
"I": 1 , "J": 8 , "K": 5 , "L": 1 ,
"M": 3 , "N": 1 , "O": 1 , "P": 3 ,
@HarvsG
HarvsG / MPMP4generalSolution.py
Last active April 21, 2020 17:50
My solution to Matt Parker's 4 CARD PUZZLE (MPMP PUZZLE 4) https://www.youtube.com/watch?v=oCMVUROty0g
import itertools
import sys
if sys.version_info[0] < 3:
raise Exception("Python 3 or a more recent version is required.")
class Deck:
# a class that takes an array of True/False of any length. True equals face down
def __init__(self,cards):