Skip to content

Instantly share code, notes, and snippets.

View Underknowledge's full-sized avatar

Underknowledge

View GitHub Profile
@Underknowledge
Underknowledge / AdGuard-FireTV-update.txt
Created September 3, 2023 11:44
AdGuard-FireTV-update.txt
||d1s31zyz7dcc2d.cloudfront.net^
||amzdigital-a.akamaihd.net^
||amzdigitaldownloads.edgesuite.net^
||softwareupdates.amazon.com^
||updates.amazon.com^
@Underknowledge
Underknowledge / main.go
Created June 17, 2023 19:35
gitlab-upgrade-helper
package main
import (
"fmt"
"log"
"os"
"os/exec"
"strings"
)
#cloud-config
apt:
preserve_sources_list: true
sources:
msft.list:
source: "deb https://packages.microsoft.com/ubuntu/18.04/multiarch/prod bionic main"
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)
@Underknowledge
Underknowledge / expose.py
Created June 5, 2021 21:13 — forked from timbennett/expose.py
Create 'long exposure' images from a video file.
# This script takes a video's individual frames and overlays them to produce a composite "long exposure" image.
#
# Usage: python expose.py video.mp4 width height
#
# IMPORTANT: you'll need to edit this script to set the value of 'alpha' appropriate for your video's length and desired brightness.
from __future__ import division
import subprocess as sp
import numpy
from PIL import Image, ImageDraw
@Underknowledge
Underknowledge / cloudflare-ddns-update.sh
Last active April 8, 2021 14:42 — forked from foobarhl/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/usr/bin/env bash
# based on
# https://gist.github.com/foobarhl/2480f956d26d49b035bf03ea1b01b40f
# get tokens
# https://dash.cloudflare.com/profile/api-tokens
command -v host > /dev/null 2>&1 && _DNS_LOOKUP=host
command -v nslookup > /dev/null 2>&1 && _DNS_LOOKUP=nslookup
command -v jq > /dev/null 2>&1 && _JQ=1 || echo "no jq support, you have to set DNS reccord ID manualy"
_SCRIPT_DIR="$(realpath $(dirname "$0"))"
@Underknowledge
Underknowledge / fedora_v4l2loopback_and_signing.sh
Last active July 5, 2023 17:14
Install and sign v4l2loopback in fedora
#!/usr/bin/env bash
# set -x
Git_status=$(curl --silent -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/umlaeute/v4l2loopback/tags" )
TAR_dl=$( echo "${Git_status}" | jq -r ".[].tarball_url" | head -n1)
TAR_v=$( echo "${Git_status}" | jq -r ".[].name" | head -n1)
build_dir="${build_dir:-/usr/src/v4l2loopback-"${TAR_v}"}"
tmp_dir="${tmp_dir:-/tmp}"
mokutil_out_dir="${mokutil_out_dir:-/root/.ssh/mokutil-module-signing}"

Keybase proof

I hereby claim:

  • I am underknowledge on github.
  • I am underknowledge (https://keybase.io/underknowledge) on keybase.
  • I have a public key ASDDg8jYnCphbstip8t6pRMuorRUS-4KaMNyezaPi11Cpwo

To claim this, I am signing this object:

@Underknowledge
Underknowledge / debian_install_homeassistant _supervised.sh
Last active October 11, 2020 20:00
debian install home-assistant supervised on a fresh installed system
#!/usr/bin/env bash
function info { echo -e "\033[1;34m[Info]\033[0m $*"; }
function warn { echo -e "\e[33m[warn] $*\e[39m"; }
function error { echo -e "\033[0;31m[Error]\033[0m $*"; exit 1; }
if [ "$EUID" -ne 0 ]
then error "Please run as root eg: 'su -', 'sudo su' or 'sudo bash'"
fi
if [ -f /home/*/.ssh/authorized_keys ] && [ -s /home/*/.ssh/authorized_keys ]; then
info "found authorized_keys, disableing password login"
sed -i -e 's/^[#\t ]*PubkeyAuthentication[\t ]*.*$/PubkeyAuthentication yes/' /etc/ssh/sshd_config
configuration.yaml
```
homeassistant:
packages: !include_dir_named packages
whitelist_external_dirs:
- /config/ffmpeg/
```
cam.sh
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
(Destination As LongPtr, Source As LongPtr, ByVal Length As LongPtr)
Private Declare PtrSafe Function VirtualProtect Lib "kernel32" (lpAddress As LongPtr, _
ByVal dwSize As LongPtr, ByVal flNewProtect As LongPtr, lpflOldProtect As LongPtr) As LongPtr