Skip to content

Instantly share code, notes, and snippets.

@plattrap
plattrap / docker_me.sh
Last active July 23, 2021 02:09
Run as me inside docker
#!/bin/bash
# Create a temporary directory and store its name in a variable ...
TMPDIR=$(mktemp -d)
# Bail out if the temp directory wasn't created successfully.
if [[ ! -d "$TMPDIR" ]]; then
>&2 echo "Failed to create temp directory"
exit 1
fi
@plattrap
plattrap / scan_net.sh
Last active April 29, 2019 22:18
Lookup all the NETBIOS and AVAHI names on the local network. And scan for their ssh hostkeys.
#!/usr/bin/env bash
ADDRESSES=`sudo arp-scan --localnet --ignoredups --interface=enp0s25 | grep $'\t' | cut -f1`
#echo $ADDRESSES
get_ssh_info () {
local out err
{
out=( $(ssh-keyscan -t ed25519 $1 2>/dev/fd/3) )
@plattrap
plattrap / dist_info
Last active February 18, 2022 08:02
python script to help with debugging unattended-upgrade filtering issues.
#!/usr/bin/python3
# running with no arguments will dump all the origins known by apt
# running with a list of package names as arguments will dump the sources for those packages and the known versions for those packages.
import os
import re
import string
import subprocess
import sys