Skip to content

Instantly share code, notes, and snippets.

View HarvsG's full-sized avatar

HarvsG

View GitHub Profile

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 July 14, 2025 06:47
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):
@HarvsG
HarvsG / popUSB.md
Last active February 25, 2022 12:23
Reminder on how to set up on POP! OS on an USB stick with 10gb spare for use

How to put pop os on a USB

  1. On a second USB create a POP OS live disk using pop os and balenaEtcher
  2. Boot that up - may have to disable secure-boot
  3. Boot up in UEFI mode, not legacy or USB mode
  4. Go through the install guide
  5. Select advanced set up NOT 'clean install'
  6. Set up partitions thusly
  • Partition table = GPT
  • 1st partition EFI, 512mb, fat 32
@HarvsG
HarvsG / PiScanner.md
Created December 8, 2019 15:18
Automated raspberry pi scanner

Plan to combine a raspberry pi and a Doxie scanner in an auto network uploader.

Steps:

  1. Find and install raspberry Pi Drivers for the Doxie Go
  2. Auto-mount the doxie and create a watch folder on the doxie
  3. Do JPG -> PDF conversion
  4. Do OCR
  5. Collate related documents somehow
  6. Rename with date in the format 20001225 and ideally extract some title data ?Largest font = title?
  7. Upload to google drive