Skip to content

Instantly share code, notes, and snippets.

View christian-korneck's full-sized avatar
💭
I may be slow to respond.

Christian Korneck christian-korneck

💭
I may be slow to respond.
View GitHub Profile
@dtaivpp
dtaivpp / logging_demo.py
Last active December 3, 2023 14:42
An introduction to logging in Python!
# Download this file with:
# curl -L https://gist.githubusercontent.com/dtaivpp/a9b00957aa7d9cfe33e92aff8d50c835/raw/logging_demo.py -o logging_demo.py
import logging
#
# Named loggers
#
logger = logging.getLogger(__name__)
print(logger.name)
@mcoliver
mcoliver / migratecinesync.py
Created January 18, 2023 01:33
migrate cinesync v4 to v5
import uuid
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# Download cinesync v4 list by saving the html at https://www.cinesync.com/dashboard
# cat cineSync.html | grep c-callout__heading | grep -o -P '(?<=\>).*(?=\<)' | sort | uniq | grep '@' > useraccounts.txt
# Run this script once and sign in to set your cinesync login credentials
# send an email to the list to have them reset their password @ https://5.cinesync.com/auth/password_reset/
@jdarcy
jdarcy / activitypub.md
Created November 9, 2022 16:10
Some thoughts about ActivityPub

I've commented a few times about some issues I see with the scalability of ActivityPub - the protocol behind the Fediverse and its best-known implementation Mastodon. A couple of folks have asked for more elaboration, so ... here it is.

First, let me add some disclaimers and warnings. I haven't devoted a lot of time to looking at ActivityPub, so there might be some things I've misunderstood about it. On the other hand, I've brought bigger systems - similar node counts and orders of magnitude more activity per node - from broken to working well based on less study of the protocols involved. So if you want to correct particular misconceptions, that's great. Thank you in advance. If you want to turn this into an appeal to authority and say that I'm wrong only because I haven't developed a full ActivityPub implementation or worked on it for X years ... GTFO.

What

What is ActivityPub? It's an HTTP- and JSON-based protocol for exchanging information about "activities". An activity could be many things.

@jonaskello
jonaskello / prep-windows-node-step1.ps1
Last active May 27, 2024 01:34
Install k8s windows nodes
# Make sure you have enabled "Expose hardware assisted virtualization to the guest OS" for the VMWare CPU
Write-Host "##############################`nInstalling features: Containers, Hyper-V, Hyper-V-PowerShell`n##############################`n"
Install-WindowsFeature Containers
Install-WindowsFeature Hyper-V
Install-WindowsFeature Hyper-V-PowerShell
Write-Host "##############################`nDisabling firewall`n##############################`n"
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
@DanB91
DanB91 / README.txt
Last active November 28, 2022 04:57
Playdate Zig starting point
THIS GIST IS OUT OF DATE! Please use my new project template here to get started with Zig on Playdate:
https://github.com/DanB91/Zig-Playdate-Template
The rest of this is preservied for historical reasons:
This is a small snippet of some code to get you started for developing for the Playdate on Zig. This code should be used as a starting point and may not compile without some massaging. This code has only been tested out on macOS and you'll need to modify the addSharedLibrary() portion of build.zig to output a .dll or .so instead of a .dylib, depending on you platform.
This code will help you produce both an executable for the Playdate simulator and also an executable that actually run on the Playdate hardware.
@awakecoding
awakecoding / test-ca.ps1
Created May 2, 2022 19:29
PowerShell Test Certificate Authority
# Common variables
$CAFullName = "IT Help Ninja"
$CAFilePrefix = "it-help"
$CADnsSuffix = "ad.it-help.ninja"
$CertsPath = "~\Documents\certs"
New-Item -Path $CertsPath -ItemType Directory -ErrorAction SilentlyContinue | Out-Null
# Offline Root CA

Introduction

  • This guide is for developers or rez enthusiasts wondering how to get started creating a development environment for working on or debugging rez.
  • While the steps are applicable to Linux, this guide was written while walking through the steps on a Windows virtual machine, so it focuses on Windows. It uses bash so that it more closesly resembles what would be seen on Linux.
- Throughout this process I use a virtual machine that has been configured using a [setup script](https://gist.github.com/Jawabiscuit/6298e2c4bebe5ddde694df9d18d9451b) but it is not necessary. It might be worthwhile looking at since it provides some information about the testing environment.
  • This guide highlights a workaround for creating an editable install using pip. Pip is normally used this way to install a Python package that is either stored locally instead of on Pypi and is robust enough that it and can easily clone and install remote repo. There are various reasons why a developer would
@darkvertex
darkvertex / Earthfile
Created March 9, 2022 15:35
Example of using Earthly for compiling Python for CentOS via pyenv
# Super easy Python compiler using Earthly.
# (See https://earthly.dev to learn more about the syntax. Docker & Earthly required.)
#
# Arguments:
# --pyver=<version> (Python version to compile. *REQUIRED*)
# --centos_ver=<version> (CentOS version to compile under. Defaults to "7".)
# --pyenv_root=<path> (Path to the Python environment. Optional. Recommendation is to match your current compilation root path.)
#
# For example, run me like this:
# > earthly +pythonwithpip --pyver=2.7.18
@benkehoe
benkehoe / get_boto3_session_with_config.py
Last active January 27, 2022 22:03
A drop-in replacement for relying on well-known profiles in ~/.aws/config
# Copyright 2020 Ben Kehoe
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A

DTrace for Windows

https://github.com/microsoft/DTrace-on-Windows

Overview

DTrace for Windows is a port of the opensource release of DTrace originally developed by Sun for Solaris in 2005. DTrace allows for high performance function tracing with access to typed arguments and statistical event collection. DTrace utilizes several types of instrumentation or trace frameworks provided by Windows including ETW, a system call tracer, a kernel function tracer, and a userland function tracer.

Installation / Build Notes