This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <RBD_Timer.h> | |
#include <RBD_Light.h> | |
#include "SD.h" | |
#include "TMRpcm.h" | |
#include "SPI.h" | |
#define SD_ChipSelectPin 4 | |
TMRpcm tmrpcm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from bs4 import BeautifulSoup | |
import requests | |
import json | |
import subprocess | |
import sys | |
import certifi | |
def log_error(e): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set service dhcp-server global-parameters "if exists user-class and option user-class = "iPXE" {" | |
set service dhcp-server global-parameters "filename "http://192.168.1.3:8080/boot.ipxe";" | |
set service dhcp-server global-parameters " } else { " | |
set service dhcp-server global-parameters "filename "undionly.kpxe";" | |
set service dhcp-server global-parameters "}" | |
set service dhcp-server global-parameters "next-server 192.168.1.3;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |