Skip to content

Instantly share code, notes, and snippets.

View shortcord's full-sized avatar
🏳️‍⚧️

Tristan Smith shortcord

🏳️‍⚧️
View GitHub Profile
#!/usr/bin/env bash
#shellcheck disable=2155
# Cronic v3 Edited - cron job report wrapper
# Copyright 2007-2016 Chuck Houpt. No rights reserved, whatsoever.
# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/\
# Source: https://habilis.net/cronic/
function exitTrap {
## Short out if $TMP is root for some reason

Keybase proof

I hereby claim:

  • I am teh-random-name on github.
  • I am shortcord (https://keybase.io/shortcord) on keybase.
  • I have a public key whose fingerprint is E9AC 78F4 163A E6EF 3D50 BCD4 0E6F 6A4F 050B F91E

To claim this, I am signing this object:

@shortcord
shortcord / rdig.sh
Created September 7, 2020 06:41
Small script to ease rdns lookup queries using dig
#!/bin/sh
dig -x $(dig +short ${1});
@shortcord
shortcord / wipedisks.sh
Last active March 4, 2020 14:06
Utility script to wipe disks and report Wearout (Wearout for SSD Only)
#!/usr/bin/env bash
# Built for CloudSouth.com
# This script wipes disk partition tables via wipefs(8) and reports Wearout via smartctl(8).
# Mainly built for SSDs, hence the Wearout reporting.
# Currently Supports Intel, Kingston, and Micron
# If you wish to add support for a disk that isn't listed
# run smartctl -A /dev/disk/sdx, where sdx is the disk you want to add.
# Look for the attribute that is for reporting disk wear, this differs per manufacturer and not every disk reports wear.
# Add that attribute in the egrep command where the "wear" variable is being assiged.
@shortcord
shortcord / example.sh
Created January 27, 2020 14:33
Import a existing VM into Proxmox
# Mount the storage or CD to a USB disk
cd ./storage
# Create the VM to import to
# we are assuming id of 1100
VMID=1100
qm create "${VMID}" \
--name "Imported VM" \
--memory 1024 \
--cores 4
[influxdb]
name = InfluxDB Repository - RHEL \$releasever
baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdb.key
@shortcord
shortcord / getIDracPowerUsageAverage.sh
Last active September 30, 2019 06:22
Dirty script. Grabs the power consumption average from IPMI, shoves it through JQ and gives back an array of objects prefixed by the measurement label.
!#/bin/sh
ipmi-oem dell get-power-consumption-statistics average | awk -F":" '{gsub (" ", "", $0); print}' | jq --slurp --compact-output --raw-input 'split("\n") | map(select(. !="") | split(":") | { (.[0]): (.[1]) })'
@shortcord
shortcord / GetUEFIWindowsKey.ps1
Created September 25, 2019 08:11
Gets the OEM Windows 10 Key from UEFI.
$wmicOutput = ((wmic path softwarelicensingservice get OA3xOriginalProductKey) | Out-String).Replace("`n", "");
$regexMatch = [regex]::Match($wmicOutput, "(?<orgKey>[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+)");
if ($regexMatch.Success)
{
echo "Found Key from UEFI BIOS";
$key = $regexMatch.Groups["orgKey"];
Set-Clipboard $key;
echo "$key; Copied to Clipboard.";
{
"meta": {
"theme": "flat"
},
"basics": {
"name": "Tristan H Smith",
"label": "Linux & Windows System Administrator / C# Programmer",
"url": "https://shortcord.com",
"picture": "https://i.imgur.com/rcWj4JW.jpg",
"email": "tristan0smith@gmail.com",
@shortcord
shortcord / convert.sh
Created May 31, 2018 14:48
Convert QCOW2 to VDI for Virtualbox
# the -p flag shows progress of qmeu-img
# -O flag sets output of file
# for more view man qmeu-img or https://linux.die.net/man/1/qemu-img
qmeu-img convert -p -O vdi /path/to/qcow2.img /path/to/output.vdi