Skip to content

Instantly share code, notes, and snippets.

View dieseltravis's full-sized avatar
🆗
I'm ok

Travis Hardiman dieseltravis

🆗
I'm ok
View GitHub Profile
@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
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
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
@dieseltravis
dieseltravis / makecert.ps1
Created December 6, 2019 19:52
generate and install a self-signed certificate for localhost in powershell
# NOTE: this has to be run as administrator
# generate self-signed cert for the local test.local domain name, set the expiration to 10 years from now
$domain = "test.local"
$cert = New-SelfSignedCertificate -DnsName "$domain", "localhost" -FriendlyName "$domain" -KeyExportPolicy Exportable -CertStoreLocation cert:\LocalMachine\My -NotAfter (Get-Date).AddYears(10)
# export the cert to a temp file
Export-Certificate –Cert $cert –FilePath "$env:temp\export.cer"
# import the cert to the trusted root
@dieseltravis
dieseltravis / LICENSE
Last active October 2, 2019 01:35
https://firstdonoharm.dev/ Hippocratic License v1.1
Copyright 2019 Travis Hardiman
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, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* The software may not be used by individuals, corporations, governments, or other groups for systems or activities that actively and knowingly endanger, harm, or otherwise threaten the physical, mental, economic, or general well-being of individuals or groups in violation of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/).