Skip to content

Instantly share code, notes, and snippets.

View mdippery's full-sized avatar
💭
Have you seen an older me go by in a time machine?

Michael Dippery mdippery

💭
Have you seen an older me go by in a time machine?
View GitHub Profile
@sbailliez
sbailliez / vagrant-vmware-tech-preview-apple-m1-pro.md
Last active April 10, 2024 07:51
Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

UPDATE November 20, 2022: VMWare Fusion 13

VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.

Summary

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated

@pbrisbin
pbrisbin / semver-pvp.md
Created February 16, 2018 00:31
Versioning Haskell: Semver <> PVP

I personally prefer [Semver][]. I think it's reasonable, simple, and makes sense. But as a good Haskell citizen, I'd like to be [PVP][]-compliant as well. Here is a bit of a graphic showing how the two systems are almost the same:

PVP:            A . B     . C     . ...
Semver:             Major . Minor . Patch
                    ^       ^       ^
                    |       |       |
                    |       |       ` increment for other changes
                    |       |
                    |       ` increment on non-breaking change
@alexcasalboni
alexcasalboni / aws-lambda-static-type-checker.md
Last active May 22, 2023 07:31
AWS Lambda Static Type Checker Example (Python3)

How to use Python3 Type Hints in AWS Lambda

TL;DR

Static Type Checkers help you find simple (but subtle) bugs in your Python code. Check out lambda_types.py and incrementally improve your code base and development/debugging experience with type hints.

Your Lambda Function code will go from this:

@danvaida
danvaida / cloudwatch_events.yml
Last active September 7, 2022 20:35
Ansible Playbook for Creating CloudWatch Events Rules with Lambda Targets
# For creating the lambda functions, see instructions here: https://github.com/pjodouin/ansible-lambda
# Run this playbook with:
# ansible-playbook cloudwatch_events.yml --extra-vars debug=True
# Ansible CloudWatch Event module PR: https://github.com/ansible/ansible-modules-extras/pull/2101
# Ansible Lambda modules PR: https://github.com/ansible/ansible-modules-extras/pull/1890
---
- name: CloudWatch Events
hosts: localhost
connection: local
gather_facts: False
@pythonhacker
pythonhacker / state.py
Last active June 22, 2022 07:01
Example of State Pattern in Python implementing showing a minimal State Machine
"""
The State design pattern.
In Python this is done dynamically by changing the __class__ attribute.
Author : Anand B Pillai <anandpillai@letterboxes.org>
License: Public Domain
Ref: http://harkablog.com/dynamic-state-machines.html
@Spindel
Spindel / watchdog.md
Last active May 24, 2023 09:48
Showing off the systemd watchdog in Python

Watchdogged

Place the service file (or a link to it) in /etc/systemd/system/ Place the watchdogged.py file somewhere ( and change the ExecStart portion in the .service to point at the file )

then do systemctl daemon-reload followed by systemctl start watchdogged.service

After this you can watch the progress using journalctl --follow -u watchdogged.service change the PROBABILITY variable to something else to watch it faster/later or succeed.

@sorbits
sorbits / every
Last active February 22, 2024 03:58
Run «command» only every «number» time invoked
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@hensing
hensing / python_logging.c
Last active September 16, 2021 15:43
Python: Use 'logging' module from C extension
#include <Python.h>
/***********************************************************/
/* define logging function and logtypes for python.logging */
/* by H.Dickten 2014 */
/***********************************************************/
enum logtypes {info, warning, error, debug};
static void log_msg(int type, char *msg)
{
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Mirror from http://s3.jspenguin.org/ssltest.py
import sys
import struct
import socket
import time
@DemmyDemon
DemmyDemon / mark.pl
Created May 17, 2013 21:06
Just a little irssi script to add a marker line to the chat.
#!/usr/bin/perl
use strict;
use warnings;
use Irssi;
our $VERSION = 0.1;
our %IRSSI = (
authors => 'Fredrik "Demonen" Vold',
contact => 'fredrik@webkonsept.com',
name => 'mark',