Skip to content

Instantly share code, notes, and snippets.

oceansmart.com. 300 IN A 190.92.154.137
oceansmart.com. 300 IN NS ns-707.awsdns-24.net.
oceansmart.com. 300 IN NS ns-1936.awsdns-50.co.uk.
oceansmart.com. 300 IN NS ns-1061.awsdns-04.org.
oceansmart.com. 300 IN NS ns-213.awsdns-26.com.
oceansmart.com. 900 IN SOA ns-707.awsdns-24.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
oceansmart.com. 300 IN TXT "6sb8nplhnuab3gs709ud3ppilk"
oceansmart.com. 300 IN TXT "26aabjoesi8ab2bng0k2af0ese"
oceansmart.com. 300 IN TXT "99aed3b35812419bdc35ac3a046a762f.oceansmart.com"
oceansmart.com. 300 IN TXT "p7m855j7vwhydfz82738246zystmj6vk"
#!/usr/bin/env python3
import os
import re
import subprocess
import json
import yaml
from time import sleep
from gh.TerraformParams import TerraformParams
class Terraform:
@walkerk1980
walkerk1980 / iac_dev_box.sh
Last active October 25, 2023 20:37
IaC prerequisites script for remote vscode development on ubuntu server
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
export DEBIAN_PRIORITY=critical
sudo apt update -q && sudo apt dist-upgrade -yq && sudo apt autoremove -yq
sudo apt install -yq nano zip unzip python3-pip jq gnupg software-properties-common libsecret-1-0
# Terraform
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
New-Item -Path HKLM:\\SOFTWARE\Policies\Microsoft\AzureADAccount -Force;
Set-ItemProperty -Path HKLM:\\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters -Name CloudKerberosTicketRetrievalEnabled -Type DWORD -Value 1 -Force;
Set-ItemProperty -Path HKLM:\\SOFTWARE\Policies\Microsoft\AzureADAccount -Name LoadCredKeyFromProfile -Type DWORD -Value 1 -Force;
Set-ItemProperty -Path HKLM:\\SOFTWARE\FSLogix\Profiles -Name Enabled -Type DWORD -Value 1 -Force;
Set-ItemProperty -Path HKLM:\\SOFTWARE\FSLogix\Profiles -Name FlipFlopProfileDirectoryName -Type DWORD -Value 1 -Force;
Set-ItemProperty -Path HKLM:\\SOFTWARE\FSLogix\Profiles -Name DeleteLocalProfileWhenVHDShouldApply -Type DWORD -Value 1 -Force;
Set-ItemProperty -Path HKLM:\\SOFTWARE\FSLogix\Profiles -Name VHDLocations -Type MultiString -Value "\\$Env:sa_name.file.core.windows.net\$Env:share_name" -Force;
@walkerk1980
walkerk1980 / GitHubEnvironments.py
Created November 3, 2022 22:05
Script to create a github environment from bash shell with an allowed branch pattern - must be logged into gh cli
#!/usr/bin/env python3
import select
import sys
import subprocess
import json
class GitHubEnvironments:
def __init__(self) -> None:
pass
tail -25 /var/log/auth.log
#! /bin/bash
USER=$1
PASS=$2
usermod --password $(echo $PASS | openssl passwd -1 -stdin) $USER
@walkerk1980
walkerk1980 / ubuntu_macbook_pro_acpi_wake_fix.sh
Created April 25, 2020 18:04
Fix Ubuntu waking up immediately after suspend on MacBook Pro
#!/bin/bash
# Stop MacBook from waking by any device except for LID
# Uses acpitool to manage /proc/acpi/wakeup
# My 2013 Macbook pro wakes from sleep immediately after suspend even when the lid is closed
# This can be used in a cron-job to peroidically turn off wake by other devices causing issue
# There is a more proper way to do this with dbus, but this is easier
for i in $(acpitool -w|grep enabled|grep -v LID|awk '{print $1}');do acpitool -W $i; done
@walkerk1980
walkerk1980 / athena.query
Created March 10, 2020 14:03
Athena query to attempt to determine least privilege permissions based on previous activity.
SELECT count(eventname) AS APICallCount,eventname
FROM cloudtrail_logs
WHERE useridentity.username = 'TestUser1'
AND eventtime > '2019-02-01T01:00:00Z'
GROUP BY eventname
@walkerk1980
walkerk1980 / find_hosts_in_nessus_files.sh
Last active March 9, 2020 18:30
find list of hostnames from hostnames.txt in nessus files after unzipping scan exports
#!/bin/bash
# replace spaces with _
find -name "* *" -type f | rename 's/ /_/g'
# unzip first layer
for file in $(ls *.zip); do unzip -o -B $file; done
# delete all zip and csv
rm -fv *_*.zip *.csv
# replace spaces with _