Skip to content

Instantly share code, notes, and snippets.

Hack the 🌎!

Derek Ditch dcode

Hack the 🌎!
View GitHub Profile
dcode / local-mirrors.repo
Created Jan 29, 2021
Quick dirty script to maintain local repo mirrors. Serve up with httpd, nginx, or whatever
View local-mirrors.repo
# Add this file to /etc/yum.repos.d/local-mirrors.repo
# Change the IP below accordingly
name=Base mirror
dcode / es_stack_cleanup.bash
Created Nov 17, 2020
Kibana and Elasticsearch cleanup
View es_stack_cleanup.bash
# Uses `httpie` since it's more convenient than `curl`
# Uses `jq` to filter JSON response
function clear_kibana() {
OBJECTS=$( http GET "${KIBANA_API}/api/saved_objects/_find" \
kbn-xsrf:true \
dcode / delete_kibana_saved_objects.bash
Last active Nov 16, 2020
Delete all Kibana saved objects. This is useful if you're developing beats modules or just want to clear out some cruft. Works with 7.x API.
View delete_kibana_saved_objects.bash
# From the docs:
# Types can be: visualization, dashboard, search, index-pattern, config, timelion-sheet
# You can also have a map type, which isn't in the docs linked above
export KIBANA_API_URL='http://elastic:password@'
export OBJECTS=$(curl "${KIBANA_API_URL}/api/saved_objects/_find?fields=id&type=index-pattern&type=visualization&type=dashboard&type=search&type=index-pattern&type=timelion-sheet&type=map&per_page=1000" | jq -rc '.saved_objects[] | {"type": .type, "id": .id } | @base64')
# Loops through the base64-encoded JSON objects
dcode / docker-compose.yml
Created Oct 7, 2020
Docker compose to standup a local minimal Kafka cluster, useful for development purposes. Can connect from host on port 9093/tcp.
View docker-compose.yml
version: '2'
image: ''
- '2181:2181'
- 'data-tier'
dcode / install-driver.ps1
Created Aug 14, 2020
This is the Google Compute Engine install-driver file used for windows driver installation. I couldn't find it anywhere else online.
View install-driver.ps1
#Copyright 2018 Google, Inc. All Rights Reserved.
Script to install specific driver.
Script will add certs from the driver to TrustedPublisher store and
install driver with pnputil.
NOTE: The script needs to be run with admin priviledge.
View install_googet.ps1
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Invoke-WebRequest -OutFile $env:temp\googet.exe;
& "$env:temp\googet.exe" -root C:\ProgramData\GooGet -noconfirm install -sources ` googet;
Remove-Item "$env:temp\googet.exe"
dcode / Guest OS Descriptors by VMware
Last active Jul 23, 2020
When using Packer (or other vmx editing needs), I needed to know what the `guest_os_type` should be according to what platform it was running on. Here you go. If it isn't listed in a column, it didn't exist at that time.
View Guest OS Descriptors by VMware
ESXi 6.5 ESXi 6.7 VMware Fusion 11 Guest Description
CRXPod1-64 VMware CRX Pod 1
CRXSys1-64 VMware CRX Sys 1
amazonlinux2-64 Amazon Linux 2 or higher, 64-Bit
asianux3Guest asianux3Guest asianux3 Asianux Server 3
asianux3_64Guest asianux3_64Guest asianux3-64 Asianux Server 3, 64-Bit
asianux4Guest asianux4Guest asianux4 Asia Linux 4
asianux4_64Guest asianux4_64Guest as
dcode / fanimation_notes.txt
Last active Jul 16, 2020
Notes about Fanimation BTLE interface
View fanimation_notes.txt
# Fan List
Sitting Area b0:7e:11:fe:5f:73
Patio 78:04:73:18:bf:8b
Living Room 78:04:73:18:ea:20
# primary
attr handle 0x0001, end grp handle 0x0009 uuid 539c6813-0ad0-2137-4f79-bf1a11984790
attr handle 0x000a, end grp handle 0x0014 uuid 00001800-0000-1000-8000-00805f9b34fb
attr handle 0x0015, end grp handle 0xffff uuid 0000e000-0000-1000-8000-00805f9b34fb
dcode / Dockerfile
Created Jun 2, 2020
Fedora CoreOS CT snippet and dockerfile to run open-vm-tools in a container for VMware guests
View Dockerfile
FROM fedora:31
LABEL summary="The open-vm-tools guest agent" \
io.k8s.description="The open-vm-tools agent is providing information about the virtual machine and allows to restart / shutdown the machine via VMware products. This image is intended to be used with virtual machines running Centos Atomic Host." \
io.k8s.display-name="open-vm-tools guest agent" \
architecture="x86_64" \
BZComponent="open-vm-tools" \
maintainer="davis phillips <>"
dcode / mirror-images.yml
Created May 22, 2020
Ansible playbook to pull docker images, write them to disk as tarballs, then optionally restore them to local container storage
View mirror-images.yml
- hosts: localhost
become: True
archive_path: /home/vagrant/containers
- name:
tag: latest
id: 8b8321cf9c81
- name: