Skip to content

Instantly share code, notes, and snippets.

View m-wild's full-sized avatar
👻
Boo

Michael Wildman m-wild

👻
Boo
View GitHub Profile
@m-wild
m-wild / Program.cs
Created August 12, 2024 22:16
LINQPad 8 Antivirus Performance Test
// Antivirus Performance Test
//
// This query generates a tiny (2KB) DLL and times how long it takes to load.
//
// Normal results on a healthy computer:
// - 1 millisecond or less with antivirus software disabled
// - 30 milliseconds or less with antivirus software enabled
using System.Diagnostics;
@m-wild
m-wild / POCO.cs.groovy
Created October 4, 2023 10:16
Jetbrains Rider/DataGrip C# POCO extractor
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@m-wild
m-wild / darkice.Dockerfile
Last active May 8, 2024 17:57
Darkice + Icecast Docker on ARM64 Raspberry Pi
FROM debian:latest as builder
WORKDIR /app
RUN apt-get update \
&& apt-get --no-install-recommends --yes install \
ca-certificates curl wget build-essential tar pkg-config \
alsa-utils lame libmp3lame-dev libpulse-dev libjack-jackd2-dev \
libaudio-dev libasound2-dev libshout3-dev libmp3lame-dev
@m-wild
m-wild / exiftool-stuff.ps1
Created April 11, 2020 09:31
Using exiftool to fix dates
ls `
| select -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_).substring(34)}}, fullname `
| where {$_.DateTimeOriginal -like '2017*'} `
| %{& exiftool -datetimeoriginal="$_.DateTimeOriginal.Replace('2017','2018')" $_.fullname}
ls | select-object -property @{Name='DateTimeOriginal'; Expression={(exiftool -datetimeoriginal $_)}}, fullname | where {$_.DateTimeOriginal -like '*2017*'} | %{& exiftool -AllDates"+=1:0:0 0" $_.fullname}
@m-wild
m-wild / example-pod.yaml
Last active September 25, 2024 18:53
Filebeat kubernetes configuration for logging to Graylog (acting as Logstash)
apiVersion: v1
kind: Pod
metadata:
name: counter
spec:
containers:
- name: count
image: busybox
args: [/bin/sh, -c, 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done']
resources: {}
function New-SqlDatabase ($server, $database, $path) {
$sw = Start-Timer
Write-Host "Creating database '$($database)'"
Write-Host "SQL Instance: $($server)"
if (!(Test-Path $path)) { New-Item -ItemType Directory -Path $path | Out-Null }
$query = "CREATE DATABASE [$($database)]
ON PRIMARY ( NAME = '$($database)', FILENAME = '$($path)\$($database).mdf' )
LOG ON ( NAME = '$($database)_log', FILENAME = '$($path)\$($database)_log.ldf' );"
@m-wild
m-wild / sdl-gl-main-template.cpp
Created August 25, 2014 04:02
SDL2 + OpenGL2.1 Template
///
/// main.cpp
/// SDL 2 + OpenGL 2.1
/// Template
///
/// Created by Michael Wildman on 16/08/14.
/// Copyright (c) 2014 Michael Wildman. All rights reserved.
///
#include <iostream>
@m-wild
m-wild / asciiwin7.bat
Created May 18, 2014 07:50
self explaintory
@echo off
echo ___ __ ___ ________ ________ ________ ___ __ ________ ________
echo ^|^\ \ ^|^\ \^|^\ \^|^\ ___ \^|^\ ___ \^|^\ __ \^|^\ \ ^|^\ \^|^\ ____\ ^|^\_____ \
echo \ \ \ \ \ \ \ \ \ \\ \ \ \ \_^|^\ \ \ \^|^\ \ \ \ \ \ \ \ \___^|_ \^|___/ /^|
echo \ \ \ __\ \ \ \ \ \ \\ \ \ \ \ \\ \ \ \\\ \ \ \ __\ \ \ \_____ \ / / /
echo \ \ \^|^\__\_\ \ \ \ \ \\ \ \ \ \_\\ \ \ \\\ \ \ \^|^\__\_\ \^|____^|^\ \ / / /
echo \ \____________\ \__\ \__\\ \__\ \_______\ \_______\ \____________\____\_\ \/__/ /
echo \^|____________^|^\^|__^|^\^|__^| ^\^|__^|^\^|_______^|^\^|_______^|^\^|____________^|^\_________^|__^|/
echo \^|_________^|
echo ________ ___ _________ ________ ___ ___ _______ ________
@m-wild
m-wild / ffmpeg-webm.bat
Created May 18, 2014 07:47
ffmpeg video to webm converter with prompts (needs ffmpeg in PATH)
@echo off
echo ^>--- FFmpeg webm ---
echo.
set /P ffinput=">Input file: "
set /P ffbitrate=">Bitrate (e.g. 500k): "
set /P ffss=">Start time (hh:mm:ss): "
set /P ffduration=">Duration (ss): "
set /P fffps=">FPS: "
echo.
echo ^>ffmpeg -i %ffinput% -c:v libvpx -b:v %ffbitrate% -ss %ffss% -t %ffduration% -quality good -cpu-used 0 -r %fffps% -auto-alt-ref 1 -lag-in-frames 16 -vf scale=-1:720 -an -pass 1 -f webm null
@m-wild
m-wild / mwil.ahk
Last active August 29, 2015 14:01
; mwil.ahk
; Userful functions for AHK using an Apple keyboard
;
; @author Michael Wildman wildsimulation@gmail.com
; Launchy
;#Space::Send ^!{Space}
; (Win + Down) Minimize active window
#Down::WinMinimize, A