Skip to content

Instantly share code, notes, and snippets.

View Underknowledge's full-sized avatar

Underknowledge

View GitHub Profile
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As LongPtr, Source As LongPtr, ByVal Length As LongPtr)
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (lpAddress As LongPtr, _
ByVal dwSize As LongPtr, ByVal flNewProtect As LongPtr, lpflOldProtect As LongPtr) As LongPtr
@Underknowledge
Underknowledge / cloudflare-ddns-update.sh
Last active April 8, 2021 14:42 — forked from foobarhl/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/usr/bin/env bash
# based on
# https://gist.github.com/foobarhl/2480f956d26d49b035bf03ea1b01b40f
# get tokens
# https://dash.cloudflare.com/profile/api-tokens
command -v host > /dev/null 2>&1 && _DNS_LOOKUP=host
command -v nslookup > /dev/null 2>&1 && _DNS_LOOKUP=nslookup
command -v jq > /dev/null 2>&1 && _JQ=1 || echo "no jq support, you have to set DNS reccord ID manualy"
_SCRIPT_DIR="$(realpath $(dirname "$0"))"
@Underknowledge
Underknowledge / expose.py
Created June 5, 2021 21:13 — forked from timbennett/expose.py
Create 'long exposure' images from a video file.
# This script takes a video's individual frames and overlays them to produce a composite "long exposure" image.
#
# Usage: python expose.py video.mp4 width height
#
# IMPORTANT: you'll need to edit this script to set the value of 'alpha' appropriate for your video's length and desired brightness.
from __future__ import division
import subprocess as sp
import numpy
from PIL import Image, ImageDraw
#cloud-config
apt:
preserve_sources_list: true
sources:
msft.list:
source: "deb https://packages.microsoft.com/ubuntu/18.04/multiarch/prod bionic main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)