Skip to content

Instantly share code, notes, and snippets.

Hack the 🌎!

Derek Ditch dcode

Hack the 🌎!
  • Elastic
  • Texas
  • Twitter @dcode
View GitHub Profile
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 Jun 29, 2022
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 Dec 23, 2021
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:
dcode /
Last active May 18, 2020 — forked from vivianspencer/gist:1bf32ef808e7a8863d8e6c461d885278
generate SHA512 hashed and verified passwords on OSX with either python2 or python3. Should work on other platforms as well.
pip install passlib
cat << EOF | python
from __future__ import print_function;
from passlib.hash import sha512_crypt;
import getpass;
import sys, os;
hash = sha512_crypt.hash(getpass.getpass())
if sha512_crypt.verify(getpass.getpass("Verify password:"), hash):
dcode / filter-flatten-nested.conf
Last active Oct 22, 2021
Logstash ruby filter to flatten nested fields to dotted names. I don't recommend this for many reaons (performance, json parsing pain, elasticsearch indexing problems, etc), but sometimes your data pipeline requires this sort of silliness.
View filter-flatten-nested.conf
filter {
ruby {
path => 'flatten_nested_field.rb'
script_params => {
"source" => "observer"
"delimiter" => "."
dcode /
Last active Aug 19, 2021
Analyze Elasticsearch on command line using HTTPie and jq


Especially when developing new query logic, it's helpful to query elasticsearch from the command line. If your Elasticsearch cluster uses SAML authentication or some other SSO, it's not simple or sometimes not even possible to query using curl directly. I wrote an auth plugin for HTTPie that should greatly simplify this process if you have rights to create API keys via the Kibana dev console (talk to your administrator and see the link below).

This process is also super handy for shell scripting because you can provide fine-grained limits of what your API key can do, making their use much safer and easier to manage than embedding native realm username/passwords.