Skip to content

Instantly share code, notes, and snippets.

#PROD
Get-DnsServerResourceRecord -ComputerName oscn.net -ZoneName oscn.net -RRType A | Export-Clixml out.xml
#AWS
$current = Import-Clixml .\out.xml
$current | Add-DnsServerResourceRecord -ZoneName oscn.net -ComputerName 172.31.84.105 -ErrorA
ction SilentlyContinue
@oldsj
oldsj / ok-sc-cs01.xml
Created March 16, 2018 13:24
ok-sc-cs01.xml
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>ok-sc-cs01</name>
<memory unit='KiB'>8388608</memory>
<currentMemory unit='KiB'>8388608</currentMemory>
<vcpu placement='static'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
<loader type='rom'>/home/ubuntu/OVMF.fd</loader>
</os>
<features>
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=none
/usr/bin/qemu-system-x86_64 -name ok-sc-cs01 -S -machine pc-i440fx-xenial,accel=kvm,usb=off
-bios /home/ubuntu/OVMF.fd -m 8192 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1
-uuid 3d87eda6-dbf7-4045-a783-31a1ef72b8ba -nographic -no-user-config -nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-ok-sc-cs01/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot strict=on
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
-drive file=/srv/salt-images/ok-sc-cs01/system.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,cache=none,aio=native
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
-netdev tap,fd=26,id=hostnet0,vhost=on,vhostfd=28

Keybase proof

I hereby claim:

  • I am oldsj on github.
  • I am oldsj (https://keybase.io/oldsj) on keybase.
  • I have a public key ASBjqHGaFAE-1ez_5fr58dTq0e8VnCiynq55PZlJ4iYBHAo

To claim this, I am signing this object:

#!/usr/bin/env python3
import json
import logging
import os
import requests
import sys
import time
base_url = "https://api.digitalocean.com/v2"
{
"cities": [{
"Hartford": {
"url": "http://hartford.gov/",
"cal_url": "http://hartford.gov/events",
"events": [{
"date": "05/24/2020",
"description": "Our First Event!1!!"
}]
}
#!/usr/bin/env bash
set -euo pipefail
LATEST_RELEASE=$(hub release -L 1)
LATEST_BASE_VER=$(echo ${LATEST_RELEASE} | cut --delimiter . --fields 1)
LATEST_REVISION=$(echo ${LATEST_RELEASE} | cut --delimiter . --fields 2)
PROPOSED_BASE_VER=$(date +%Y%m%d)
PROPOSED_REVISION=1
if [[ ${PROPOSED_BASE_VER} == ${LATEST_BASE_VER} ]] && \
@oldsj
oldsj / Dockerfile.rust
Created December 3, 2020 18:17
An Ideal Dockerfile for Rust
FROM rust:slim as builder
WORKDIR /app
RUN rustup default nightly
RUN rustup target add x86_64-unknown-linux-musl --toolchain=nightly
WORKDIR /app/gcpizza
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo build --target x86_64-unknown-linux-musl --release
#!/bin/sh
### BEGIN INIT INFO
# Provides: expand_rootfs
# Required-Start:
# Required-Stop:
# Default-Start: 3
# Default-Stop:
# Short-Description: Expand the root filesystem to fill partition
# Description:
### END INIT INFO
@oldsj
oldsj / labels.json
Last active January 7, 2021 21:09
github labels for git-labels
[
{
"name": "blocked :no_entry:",
"color": "000000",
"description": "Blocked on other issues or external dependencies"
},
{
"name": "bug :beetle:",
"color": "f47648",
"description": "Something isn't working"