Skip to content

Instantly share code, notes, and snippets.

# If you intend to use kubernetes, you need a better kernel than the stupid ubuntu kvm one. Use this:
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# image prep
wget https://cloud-images.ubuntu.com/minimal/releases/jammy/release/ubuntu-22.04-minimal-cloudimg-amd64.img
virt-customize -a ubuntu-22.04-minimal-cloudimg-amd64.img --install qemu-guest-agent
virt-customize -a ubuntu-22.04-minimal-cloudimg-amd64.img --run-command "truncate -s 0 /etc/machine-id"
qemu-img resize ubuntu-22.04-minimal-cloudimg-amd64.img 32G
@crookedstorm
crookedstorm / keybase.md
Created March 1, 2018 22:53
Required keybase thing

Keybase proof

I hereby claim:

  • I am crookedstorm on github.
  • I am brookestorm (https://keybase.io/brookestorm) on keybase.
  • I have a public key ASCacxi0cO7EYoWgMNc4yKtxEptQ19T0DX3i-KTD-7B-BAo

To claim this, I am signing this object:

@crookedstorm
crookedstorm / postgres_queries_and_commands.sql
Created April 30, 2016 23:15 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@crookedstorm
crookedstorm / logparse.rb
Created February 18, 2015 22:00
Parse a test log file.
# A quick log parse
if File.readable?("test-sample.log")
logfile = File.open("test-sample.log", "r")
else
abort "File not found!"
end
logfile.each do |line|
if /^.*id=([\w\-@.]+).*T=(".*")/ =~ line
puts "ID: #{$1}\t\tSUBJECT: #{$2}"
end
@crookedstorm
crookedstorm / list_vcenter_alarms.ps1
Created February 18, 2015 16:28
A quick script to dump the currently-configured alarms of a number of vCenters.
Add-PSSnapin VMware.VimAutomation.Core
#A list of vCenter servers, one per line
$vcenterservers = Get-Content "vCenter_Servers.txt"
foreach ($vcenterserver in $vcenterservers)
{
Connect-VIServer -Server $vcenterserver -WarningAction SilentlyContinue | Out-Null
$output = foreach ($alarm in (Get-AlarmDefinition | Sort Name | Get-AlarmAction))
{