Skip to content

Instantly share code, notes, and snippets.

View notsle's full-sized avatar

Mike Elston notsle

View GitHub Profile
@notsle
notsle / get_public_ip.sh
Last active January 3, 2024 06:24
Get Public IP address with curl and ipchicken.com
curl -s https://ipchicken.com | egrep -o '([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}'
#!/bin/bash
if [ -z "$1" ]; then
printf "Please provide an ipa file. Usage: listudids file_name.ipa [-all]\n"
exit
fi
if [ -n "$2" ] && [ "$2" == "-all" ]; then
all="all"
fi
SELECT db.[name] AS [DatabaseName]
,id.[object_id] AS [ObjectID]
,OBJECT_NAME(id.[object_id], db.[database_id]) AS [ObjectName]
,id.[statement] AS [FullyQualifiedObjectName]
,id.[equality_columns] AS [EqualityColumns]
,id.[inequality_columns] AS [InEqualityColumns]
,id.[included_columns] AS [IncludedColumns]
,gs.[unique_compiles] AS [UniqueCompiles]
,gs.[user_seeks] AS [UserSeeks]
,gs.[user_scans] AS [UserScans]
@notsle
notsle / install-docker-add-currentuser.sh
Created February 21, 2023 01:08
install-docker-add-currentuser.sh
curl -fsSL get.docker.com | sudo sh
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
@notsle
notsle / Get-DirHash.ps1
Created December 29, 2023 01:43
Get-DirHash.ps1
Function Get-DirHash {
[Cmdletbinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateScript({
if(Test-Path -Path $_ -ErrorAction SilentlyContinue)
{
return $true
}
else
@notsle
notsle / create-debian-proxmox-cloudinit.sh
Last active April 17, 2024 22:07
Proxmox 8 Debian 12 Cloudinit template script
#!/bin/bash
# Author: Mike Elston (github.com/notsle)
# License: GPL2
apt update -y && apt install nano wget curl libguestfs-tools -y
wget -O debian-12-generic-amd64.qcow2 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
virt-customize -a debian-12-generic-amd64.qcow2 --install qemu-guest-agent --install resolvconf --install systemd-resolved --update --run-command 'mkdir -p /etc/network/interfaces.d' --run-command 'echo "auto ens18" >> /etc/network/interfaces.d/ens18' --run-command 'echo "iface ens18 inet manual" >> /etc/network/interfaces.d/ens18'
qm create 100000 --name debian12-cloudinit-template --net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-pci --machine q35 --memory 8192 --cores 4