Skip to content

Instantly share code, notes, and snippets.

@KalebHawkins
KalebHawkins / LangChainGo Example
Last active April 22, 2026 23:42
LangChainGo structured output example
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"strings"
@KalebHawkins
KalebHawkins / HackingTAOE.vmx
Created September 15, 2022 12:52
Hacking TAOE VMX File
#!/usr/bin/vmware
.encoding = "UTF-8"
config.version = "8"
virtualHW.version = "6"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
memsize = "2048"
ide1:0.present = "TRUE"
ide1:0.deviceType = "cdrom-image"
ide1:0.fileName = "/Users/kalebhawkins/Documents/ISO/hacking-live-1.0.iso"
@KalebHawkins
KalebHawkins / generateEncPasswd.sh
Created March 11, 2022 19:50
Generate SHA Encrypted Hash
python3 -c 'import crypt, getpass; print(crypt.crypt(getpass.getpass()))'
@KalebHawkins
KalebHawkins / Create Qemu Images
Last active March 23, 2022 17:56
Create Qemu Images
qemu-img create -f qcow2 -o preallocation=full <image-name> <size>G
qemu-img create -f raw <disk-name>.img <size>G
@KalebHawkins
KalebHawkins / Red Hat Template Seal Scripts
Last active April 28, 2022 16:58
Red Hat Template Seal Scripts
#!/bin/bash
# stop logging services
/usr/bin/systemctl stop rsyslog
/usr/bin/systemctl stop auditd
# remove old kernels
# /bin/package-cleanup -oldkernels -count=1
#clean dnf cache
/usr/bin/dnf clean all
#force logrotate to shrink logspace and remove old logs as well as truncate logs
<#
.Synopsis
.DESCRIPTION
.EXAMPLE
#>
[CmdletBinding()]
Param
#!/bin/bash
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
$regex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
$SomeString | Select-String -Pattern $regex -AllMatches