Skip to content

Instantly share code, notes, and snippets.

@LouDnl
LouDnl / ups_lite_v13.py
Created August 30, 2023 11:55
Pwnagotchi UPS Lite v1.3 plugin
# Based on UPS Lite v1.1 from https://github.com/xenDE
#
# functions for get UPS status - needs enable "i2c" in raspi-config
#
# https://github.com/linshuqin329/UPS-Lite
#
# For Raspberry Pi Zero Ups Power Expansion Board with Integrated Serial Port S3U4
# https://www.ebay.de/itm/For-Raspberry-Pi-Zero-Ups-Power-Expansion-Board-with-Integrated-Serial-Port-S3U4/323873804310
# https://www.aliexpress.com/item/32888533624.html
#
@NakedPowerShell
NakedPowerShell / gist:9711e57e18fa4c4cd0fed148497f900e
Last active July 13, 2019 02:18
Script to generate all the exploration I normally do when I want to install a new PowerShell module
Function Show-ModExplore {
<#
.SYNOPSIS
Generate all the exploration I normally do when I want to install a new PowerShell module
.DESCRIPTION
Script to generate all the exploration I normally do when I want to install a new PowerShell module
@richardjortega
richardjortega / curl_rest_api.md
Last active March 2, 2021 14:14
cURL REST API for Azure Resource Manager (ARM)

Using cURL and Azure REST API to access Azure Resource Manager (non-interactive)

Note: This guide assumes Azure CLI 2.0 is installed and familiarity with Azure concepts.

Register Client App and Obtain Service Principal (via CLI)

The APP_ID_URI needs to match what is expected in client request calls.

$ az ad sp create-for-rbac --name [APP_ID_URI] --password [PASSWORD]
@stefhen
stefhen / rsc-examples.md
Last active September 27, 2017 15:47
RSC Examples

RSC Examples

  • List all accounts you have access to:
rsc cm15 accounts /api/sessions | \
jq '.[] | .name, [.links[] | select(.rel == "self").href][0]' | \
paste -sd"\t\n" - | sort
@mefellows
mefellows / BundleConfig.ps1
Last active December 25, 2023 23:33
Sysprepped Windows AMI using Packer
$EC2SettingsFile="C:\\Program Files\\Amazon\\Ec2ConfigService\\Settings\\BundleConfig.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
foreach ($element in $xmlElement.Property)
{
if ($element.Name -eq "AutoSysprep")
{
$element.Value="Yes"
}
@pavank
pavank / Manage Windows Firewall
Last active September 24, 2020 15:58 — forked from ig0774/gist:1068598
Manage Windows Advanced Firewall with PowerShell
Set-StrictMode -Version Latest
# Constants
if (!(Test-Path variable:\NET_FW_DISABLED)) { Set-Variable NET_FW_DISABLED -Option Constant $False }
if (!(Test-Path variable:\NET_FW_ENABLED)) { Set-Variable NET_FW_ENABLED -Option Constant $True }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_TCP)) { Set-Variable NET_FW_IP_PROTOCOL_TCP -Option Constant 6 }
if (!(Test-Path variable:\NET_FW_IP_PROTOCOL_UDP)) { Set-Variable NET_FW_IP_PROTOCOL_UDP -Option Constant 17 }
if (!(Test-Path variable:\NET_FW_PROFILE_DOMAIN)) { Set-Variable NET_FW_PROFILE_DOMAIN -Option Constant 0x1 }
if (!(Test-Path variable:\NET_FW_PROFILE_PRIVATE)) { Set-Variable NET_FW_PROFILE_PRIVATE -Option Constant 0x2 }
if (!(Test-Path variable:\NET_FW_PROFILE_PUBLIC)) { Set-Variable NET_FW_PROFILE_PUBLIC -Option Constant 0x2 }