Skip to content

Instantly share code, notes, and snippets.

@dieseltravis
dieseltravis / alpaca.js
Last active September 11, 2021 04:04
find 10-digit primes in verious hash values
// this doesn't work:
/*
h = this.GetHash();
x = {last 10-digit prime found in consecutive digits of h in base-10};
requests.post('https://api.alpaca.markets/v2/puzzle/202108/solve', json={'answer': account.id.int * x, 'email': your_waitlist_email})
*/
// get basic hashes with Powershell
//@('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5') | % { Get-FileHash -Path ~\Downloads\110-days-after-lehman-collapsed.jpg -Algorithm "$_" }
@dieseltravis
dieseltravis / bookmarklet.html
Last active April 14, 2021 05:34
rotate all the post images on mltshp clockwise
<!doctype html>
<html><body>
<a href='javascript:[...document.querySelectorAll(".the-image img")].forEach(img=>img.setAttribute("style",(img.getAttribute("style")||"").replace(/transform:rotate\((\d+\.?\d*)turn\)/,(m,p1)=>"transform:rotate("+(+p1+0.25)+"turn)")||"transform:rotate(0.25turn)"));'>🔃</a>
</body></html>
@dieseltravis
dieseltravis / inline.js
Last active January 31, 2021 20:48
get t.co destination URL
document.addEventListener("mouseover", function tCo(ev) {
const l = ev.target.closest("a[href^='https://t.co/']");
// only run when target is a link with a t.co href
if (l) {
fetch(l.href, { method: "GET" })
.then(function fetchResponse(res) { return res.text(); }) // get response html
.then(function fetchHtml(html) {
//console.log("html:", html);
if (html) {
const u = new DOMParser() // convert response to node
@dieseltravis
dieseltravis / mltshp-420.svg
Last active October 24, 2020 02:20
for @/ba on mltshp by request
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dieseltravis
dieseltravis / mltshp-canada.svg
Last active October 23, 2020 03:36
a Mltshp version of the Canadian flag, CC0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dieseltravis
dieseltravis / functions.sql
Last active March 6, 2020 18:35
Parse aspnet_Profile PropertyNames and PropertyValuesString data with TSQL original source is https://www.karpach.com/Get-asp-net-profile-value-MS-SQL-database-using-T-SQL.htm
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: parse aspnet_profile, see also [dbo].[GetProfileElement] via https://www.karpach.com/Get-asp-net-profile-value-MS-SQL-database-using-T-SQL.htm
-- =============================================
CREATE FUNCTION [dbo].[GetElement]
@dieseltravis
dieseltravis / tab.txt
Created February 29, 2020 06:14
tab test
x
c c
t t t
@dieseltravis
dieseltravis / out.log.txt
Created February 24, 2020 00:13
sudo apt-get update
Get:1 http://security.debian.org buster/updates InRelease [65.4 kB]
Get:2 http://ftp.us.debian.org/debian buster InRelease [122 kB]
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:5 http://ftp.us.debian.org/debian buster-updates InRelease [49.3 kB]
Get:6 http://ftp.debian.org/debian buster-backports InRelease [46.7 kB]
Err:7 http://raspberrypi.collabora.com buster InRelease
Could not resolve 'raspberrypi.collabora.com'
Ign:8 http://mirror.ox.ac.uk/sites/raspbian.raspberrypi.org/archive/raspbian buster InRelease
Err:9 http://mirror.ox.ac.uk/sites/raspbian.raspberrypi.org/archive/
@dieseltravis
dieseltravis / docker_run.ps1
Created February 8, 2020 07:36
powershell version of docker_run.sh for pi-hole
# powershell version of:
# https://github.com/pi-hole/docker-pi-hole/blob/master/docker_run.sh
$ServerIP = (Get-NetIPConfiguration | Where-Object { $_.IPv4DefaultGateway -ne $null -and $_.NetAdapter.Status -ne "Disconnected" -and $_.InterfaceDescription -NotLike "*virtual*" } | Sort-Object InterfaceAlias | Select-Object -First 1).IPv4Address.IpAddress
docker run -d `
--name pihole `
-p 53:53/tcp -p 53:53/udp `
-p 80:80 `
-p 443:443 `
-e TZ="America/New York" `
-e WEBPASSWORD="password" `
@dieseltravis
dieseltravis / stars.md
Created January 16, 2020 17:54
Awesome Stars