Skip to content

Instantly share code, notes, and snippets.

@dadatuputi
dadatuputi / chanhop.sh
Created May 25, 2020 17:52
Wi-Fi Channel Hoping BASH Script
#!/bin/bash
# From http://www.willhackforsushi.com/books/377_eth_2e_06.pdf and referenced by https://wiki.wireshark.org/CaptureSetup/WLAN#Channel_Hopping (dead/spam link)
# Hop channels every second
IFACE=ath0
IEEE80211bg="1 2 3 4 5 6 7 8 9 10 11"
IEEE80211bg_intl="$IEEE80211b 12 13 14"
IEEE80211a="36 40 44 48 52 56 60 64 149 153 157 161"
IEEE80211bga="$IEEE80211bg $IEEE80211a"
@dadatuputi
dadatuputi / HalloweenSlugOLantern.ino
Created May 25, 2020 17:49
Halloween Arduino Slug: Arduino code for a motion-activated screaming pumpkin slug
#include <RBD_Timer.h>
#include <RBD_Light.h>
#include "SD.h"
#include "TMRpcm.h"
#include "SPI.h"
#define SD_ChipSelectPin 4
TMRpcm tmrpcm;
@dadatuputi
dadatuputi / edgeos_access.sh
Created May 16, 2020 22:36
EdgeOS script to enable or disable access to webui or ssh / useful with task-schedule
#!/bin/vbash
# From https://wiki.vyos.net/wiki/Configuration_scripting
# Check for correct group
if [ "$(id -g -n)" != 'vyattacfg' ] ; then
echo "switching to vyattacfg group"
exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
exit 0
fi
@dadatuputi
dadatuputi / proxmox_access.sh
Last active May 16, 2020 22:41
Proxmox access lockout script - lock out access to webui/SSH, best used with crontab schedule
#!/usr/bin/env bash
file=/etc/pve/firewall/cluster.fw
drop_rule="IN DROP -log nolog"
group_rule="IN ACCEPT -source 192.168.1.0\/24 -log nolog"
function comment {
replace "$1" "|$1" $2
}
@dadatuputi
dadatuputi / embupdate.py
Last active February 21, 2024 11:29
Script to automatically upgrade Emby on Debian or Ubuntu
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
import json
import subprocess
import sys
import certifi
def log_error(e):
@dadatuputi
dadatuputi / findpi.ps
Last active October 4, 2021 12:47
Powershell script to find Raspberry Pis on a local network
# https://learn-powershell.net/2016/04/22/speedy-ping-using-powershell/
# Scan the local network
$Hosts = 1..254 | foreach {"192.168.1.$_"}
$Tasks = $Hosts | foreach {(New-Object System.Net.NetworkInformation.Ping).SendPingAsync($_)}
[Threading.Tasks.Task]::WaitAll($Tasks)
#$Tasks.Result
# Scan the arp table for MAC addresses that are registered to the Pi Foundation
arp -a | select-string "b8-27-eb" |% { $_.ToString().Trim().Split(" ")[0] }
@dadatuputi
dadatuputi / Remove_Hash_from_context_menu.reg
Created October 31, 2018 13:36
Windows 10 Hash Context Menu Uninstall
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 5th 2017
; Tutorial: https://www.tenforums.com/tutorials/78681-file-hash-context-menu-add-windows-8-windows-10-a.html
[-HKEY_CLASSES_ROOT\*\shell\hash]
@dadatuputi
dadatuputi / Add_Hash_to_context_menu.reg
Created October 31, 2018 13:35
Windows 10 Hash Context Menu Install
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; Created on: March 5th 2017
; Tutorial: https://www.tenforums.com/tutorials/78681-file-hash-context-menu-add-windows-8-windows-10-a.html
[HKEY_CLASSES_ROOT\*\shell\hash]
"MUIVerb"="Hash"
"SubCommands"=""
@dadatuputi
dadatuputi / iPXE EdgeRouter Settings
Last active September 22, 2018 05:15 — forked from Fossil01/gist:b3ae40dfcb4405601489
Edgerouter / VyOS / Vyatta iPXE DHCP Options
set service dhcp-server global-parameters "if exists user-class and option user-class = &quot;iPXE&quot; {"
set service dhcp-server global-parameters "filename &quot;http://192.168.1.3:8080/boot.ipxe&quot;;"
set service dhcp-server global-parameters " } else { "
set service dhcp-server global-parameters "filename &quot;undionly.kpxe&quot;;"
set service dhcp-server global-parameters "}"
set service dhcp-server global-parameters "next-server 192.168.1.3;"
@dadatuputi
dadatuputi / unmount-vhd.ps1
Last active October 14, 2018 21:32
Powershell - Unmount VHD
# Escalate script if not run as administrator
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
# Relaunch as an elevated process:
Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
exit
}
# Unmount vhd file
# Use the following path if the vhd file is in the same directory as this script: