Skip to content

Instantly share code, notes, and snippets.

View i-e-b's full-sized avatar
🤔
Thinking

Iain Ballard i-e-b

🤔
Thinking
View GitHub Profile
@i-e-b
i-e-b / disconnect.sql
Created June 14, 2021 07:03
Postgresql: Disconnect other users
-- Disconnect any stray connections (like from background tasks)
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE -- don't kill my own connection!
pid <> pg_backend_pid();
@i-e-b
i-e-b / Download links for JDKs
Created June 10, 2021 06:56
Download links for JDKs
@i-e-b
i-e-b / Fiddler download link
Created May 13, 2021 08:31
Fiddler download link
@i-e-b
i-e-b / Test text.txt
Created May 7, 2021 10:05
Collection of 'quick brown fox' alikes
The quick brown fox jumps over the lazy dog;
Crazy Fredericka bought many very exquisite opal jewels!
A sphinx of black quartz judges my vow:
New farmhand proves strong but lazy, picking just six quince?
About sixty codfish eggs with make a quarter-pound of (very fizzy) jelly.
Grumpy wizards make toxic brew for the evil Queen and Jack.
@i-e-b
i-e-b / reset.txt
Created April 2, 2021 07:03
To reset "Dino World" Secret diary kid's toy
To reset dino world secret diary, hold 1, 3, and 0 together until it opens (about 3 seconds)
then enter new 4 digit code and press #
@i-e-b
i-e-b / StormNames.txt
Created November 24, 2020 10:56
Storm names
Hurricane
Tornado
Typhoon
Cyclone
Storm
Blizzard
Derecho
Thunder
Tempest
Squall
@i-e-b
i-e-b / callrest.ps1
Created November 17, 2020 12:28
Output error body from Powershell REST call
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer $($_MY_BEARER_TOKEN_)")
$headers.Add("Content-Type", "application/json")
try {
$reponse = Invoke-RestMethod $_MY_URL_ -Method Post -Body $_MY_PAYLOAD_STRING_ -UseBasicParsing -Headers $($headers)
# ... success, do stuff with response here ...
@i-e-b
i-e-b / haiku.txt
Created July 29, 2020 08:31
Haiku error messages. A mirror of https://8325.org/haiku/
NetPositive is a web browser for the BeOS operating system. It's famous for its haiku error messages. This page lists those messages.
The web site you seek
Lies beyond our perception
But others await.
Sites you are seeking
From your path they are fleeing
Their winter has come.
@i-e-b
i-e-b / EC2 dotnet core setup.md
Created March 11, 2020 11:39
Setup dotnet core 3.1 website on AWS EC2 instance, using S3 bucket for storage

Put your software in an S3 bucket

Publish your web app, check it works locally. Zip the files into a single archive.

Go to AWS console, and S3 buckets. Create a bucket for your compiled app artefacts.

Upload your zip file.

@i-e-b
i-e-b / xoshiro256mul.cs
Created January 14, 2020 12:27
xoshiro256** implementation in C#, based on the Wikipedia code at https://en.wikipedia.org/wiki/Xorshift#xoshiro256**
static void Main(string[] args)
{
var seed = 123456UL;
var state = xorshift256_init(seed);
for (var i = 0; i < 20; i++) {
Console.WriteLine(xoshiro256p(state).ToString("x"));
}
Console.ReadLine();