Skip to content

Instantly share code, notes, and snippets.

View Tirpitz93's full-sized avatar

Lönja Selter Tirpitz93

  • Kawasaki Precision Machinery
  • UK
View GitHub Profile
@sytsereitsma
sytsereitsma / sliding_dft.py
Created August 15, 2019 14:16
Sliding DFT analysis in python (transcribed simulink model)
import numpy
from matplotlib import pyplot
import math
import random
from collections import deque
class DelayLine:
def __init__(self, length):
self.buffer = deque()
@Blizzke
Blizzke / flash.sh
Last active January 31, 2021 14:38
OctoPrint CLI flasher for Prusa MK2, MK3 and MMU2
#!/usr/bin/env bash
#
# This script was created to flash firmwares for the MK2, MK3 and the MMU2,
# all from the command line of your OctoPrint installation.
#
# The script assumes that you have avrdude and jq installed on your raspbian and that you
# have filled the API key below.
#
# Usage: flash.sh mk2|mk3|mmu2 firmware.hex
@leVirve
leVirve / ddd_ftpuser.py
Last active November 23, 2021 09:34
A Python script to add/remove users for FileZilla Server.
import hashlib
import os
import subprocess
import xml.etree.ElementTree
import click
user_xml_fmt = '''
<User Name="ddd_{username}">
<Option Name="Pass">{md5_pwd}</Option>
@Tirpitz93
Tirpitz93 / Arma-3-Infantry.kbd.json
Last active January 21, 2021 20:56
Arma 3 Infantry
[
{
"backcolor": "#de2626",
"name": "Arma 3 Infantry",
"author": "Tirpitz",
"background": {
"name": "Carbon fibre 4",
"style": "background-image: url('/bg/carbonfibre/carbon_texture1873.png');"
},
"switchMount": "cherry",
@jorge-lavin
jorge-lavin / gist:238ccb229ac594a50b0a
Created November 25, 2014 13:03
SMTPHandler with support to attachments
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.Utils import formatdate
from logging.handlers import SMTPHandler
import logging
import os.path
import smtplib
@ril3y
ril3y / create_x.509_cert.py
Created August 23, 2011 12:58
Python script that will generate a x.509 certificate
#!/usr/bin/python
from OpenSSL import crypto, SSL
from socket import gethostname
from pprint import pprint
from time import gmtime, mktime
from os.path import exists, join
CERT_FILE = "myapp.crt"
KEY_FILE = "myapp.key"