Skip to content

Instantly share code, notes, and snippets.

View marksharrison's full-sized avatar

Mark Harrison marksharrison

View GitHub Profile
@marksharrison
marksharrison / sshRegenerateModuli.sh
Last active May 31, 2022 18:50
Regenerate & replace 8192 bit OpenSSH moduli file (for the paranoid)
#!/bin/sh
# regenerate list of prime numbers to replace pre-generated list
# marginally increases security of key exchange protocols
# this will take hours or possibly days
ssh-keygen -M generate -O bits=8192 moduli-8192-regenerated.candidates
# verify regenerated list of primes are valid and not inherently weak
ssh-keygen -M screen -f moduli-8192-regenerated.candidates moduli-8192
# replace the original /etc/ssh/moduli file
cp moduli-8192 /etc/ssh/moduli
rm moduli-8192
@marksharrison
marksharrison / git-delete-commit-history.md
Last active September 8, 2019 22:56
Delete commit history from repository, except latest.
$ rm -rf .git
$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin <github-uri>
$ git push -u --force origin master
@marksharrison
marksharrison / .stglobalignore
Created September 3, 2019 10:00
Syncthing global ignore file
// .stglobalignore
// Syncthing Ignore Patterns - https://docs.syncthing.net/users/ignoring.html#patterns:
// Useful .stignore Patterns - https://goo.gl/DVHI1h
// Usage: Add the line below to all .stignore files for each Syncthing node
// #include .stglobalignore
// Incomplete Downloads
// Firefox downloads
*.part
@marksharrison
marksharrison / ubuntu-mate-for-raspberrypi-macos.md
Created March 19, 2019 20:52
Create Ubuntu Mate for Raspberry Pi in macOS

Install xz with homebrew:

brew install xz

Insert the SD and get the device name for the SD with df:

Filesystem    512-blocks      Used Available Capacity iused      ifree %iused  Mounted on
/dev/disk1     487867392 157859992 329495400    33% 2352643 4292614636    0%   /
devfs                373       373         0   100%     647          0  100%   /dev
map -hosts             0         0         0   100%       0          0  100%   /net
ack
atk
autoconf
automake
bash
berkeley-db
boost
cairo
cmake
cppunit
1password
android-file-transfer
appcleaner
applepi-baker
arduino
atom
bankid
beaconscanner
blender
brave
@marksharrison
marksharrison / function_template.py
Last active March 14, 2017 20:05
function_template with Google Style Docstrings Python Snippet
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
def function_template(first_argument, second_argument=None, *args, **kwargs):
"""Summary description of function.
Extended description of function.
Args:
@marksharrison
marksharrison / question_yes_no.py
Created March 14, 2017 19:39
question_yes_no Function Python Snippet
import sys
def question_yes_no(question, default="yes"):
"""Asks yes/no question using input() function and returns the answer
Args:
str: "question" text presented to user
str: "default" the presumed answer if the user just hits <Enter>
Returns:

Keybase proof

I hereby claim:

  • I am MarkSHarrison on github.
  • I am markharrison (https://keybase.io/markharrison) on keybase.
  • I have a public key whose fingerprint is 5CB3 4B51 8E24 C87E FD35 DBD1 EA2D 3C3A 07A5 DC93

To claim this, I am signing this object: