Skip to content

Instantly share code, notes, and snippets.

View MadTinker's full-sized avatar
🧑‍🔬
Ferrum Corde. I am the machine.

TheMadTinker MadTinker

🧑‍🔬
Ferrum Corde. I am the machine.
  • United States
View GitHub Profile
@MadTinker
MadTinker / .bashrc
Created November 1, 2020 15:01
fix_wsl2_interop
fix_wsl2_interop() {
for i in $(pstree -np -s $$ | grep -o -E '[0-9]+'); do
if [[ -e "/run/WSL/${i}_interop" ]]; then
export WSL_INTEROP=/run/WSL/${i}_interop
fi
done
}
alias socketfix='fix_wsl2_interop'
export -f fix_wsl2_interop
@MadTinker
MadTinker / utils.py
Last active January 3, 2023 19:17 — forked from FulcronZ/main.py
Python MQTT Logging Handler
import errno
import logging
import os
import re
import subprocess
import time
from datetime import datetime
from pathlib import Path
from typing import List
@MadTinker
MadTinker / TaskerBootPremissionsOverride.sh
Last active April 6, 2025 20:03
List of permission grants for tasker after reboot
echo=off
if [ "$1" = "--s8" ]; then
mosquitto_pub -h $awsip -p $awsport -t vars/S8_boot_patch -r -m 1
device=9888d9303354564442
else
mosquitto_pub -h $awsip -p $awsport -t vars/S10_boot_patch -r -m 1
device=RF8N82MR1VA
fi
echo Overriding security protocols for $device
@MadTinker
MadTinker / bash setup for docker
Created December 17, 2020 00:25 — forked from auwsom/bash setup for docker
bash setup for docker
# wget https://gist.github.com/auwsom/fbeb8bfd36af91bb482529ee499f1058/raw -O bashsetup_docker ; bash !$
set +o history && sleep 1
sed -i /^'alias d'/d ~/.bashrc; sed -i /^'function d'/d ~/.bashrc ## remove old
source ~/.bashrc ; exec bash ## have to restart shell to enter the bindings without recursion
#echo "HISTIGNORE=''" >>~/.bashrc
# sudo cp /usr/share/zoneinfo/US/Pacific /etc/localtime # cant set, read only
echo "alias d='docker'">>~/.bashrc
echo "alias dcm='docker commit'">>~/.bashrc # CONTAINER IMAGE_REPO:TAG <- have to specify or creates new image
echo "alias del='docker exec -it \$(docker ps -q -l) bash'">>~/.bashrc
echo "alias di='docker images'">>~/.bashrc
@MadTinker
MadTinker / .zshrc
Created December 18, 2020 18:38 — forked from SlexAxton/.zshrc
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@MadTinker
MadTinker / .vimrc
Created December 20, 2020 23:53 — forked from millermedeiros/.vimrc
My VIM settings (.vimrc)
" =============================================================================
" Miller Medeiros .vimrc file
" -----------------------------------------------------------------------------
" heavily inspired by: @factorylabs, @scrooloose, @nvie, @gf3, @bit-theory, ...
" =============================================================================
" -----------------------------------------------------------------------------
" BEHAVIOR
@MadTinker
MadTinker / azure-pipeline-with-keyvault.yaml
Created December 23, 2020 13:37 — forked from cdennig/azure-pipeline-with-keyvault.yaml
Azure DevOps Terraform with KeyVault + Service Connection
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
- group: kvintegratedvargroup
steps:
import PyPDF2, os, re, win32clipboard
from gtts import gTTS
win32clipboard.OpenClipboard()
clip = win32clipboard.GetClipboardData()
# clip = os.environ.get('USERPROFILE') +"\\Desktop\\Sorting\\digitilt-datamate-2003.pdf"
win32clipboard.CloseClipboard()
file_path = clip
if(os.path.exists(file_path)):
@MadTinker
MadTinker / gitstore.bat
Last active January 14, 2021 16:18
Git storage relocator. Used on remote servers where I don't want to leave the dir
set gitstore=%userprofile%/SetupRepos/
echo Storage Directory set to: %gitstore%
echo Moving Git repository to storage and creating reroute file
attrib -H .git
attrib -r .git
for %%I in (.) do set x=%%~nxI
move .git "%gitstore%%x%"
copy /y NUL .git
@echo gitdir: %gitstore%%x%>.git
attrib +h .git
@MadTinker
MadTinker / githere.cmd
Created January 14, 2021 16:52
generate .git pointer for remote repo
@for %%I in (.) do @set x=%%~nxI
@echo gitdir: %gitstore%%x%>.git
@cat .git