Skip to content

Instantly share code, notes, and snippets.

View ximon18's full-sized avatar

Ximon Eighteen ximon18

  • NLnet Labs
  • Amsterdam, Netherlands
View GitHub Profile
@ximon18
ximon18 / packer.log
Created February 16, 2017 15:28
Packer DEBUG_LOG=1 output
2017/02/16 16:13:41 [INFO] Packer version: 0.12.2
2017/02/16 16:13:41 Packer Target OS/Arch: windows amd64
2017/02/16 16:13:41 Built with Go Version: go1.7.4
2017/02/16 16:13:41 Using internal plugin for parallels-iso
2017/02/16 16:13:41 Using internal plugin for parallels-pvm
2017/02/16 16:13:41 Using internal plugin for profitbricks
2017/02/16 16:13:41 Using internal plugin for amazon-ebs
2017/02/16 16:13:41 Using internal plugin for azure-arm
2017/02/16 16:13:41 Using internal plugin for hyperv-iso
2017/02/16 16:13:41 Using internal plugin for null
@ximon18
ximon18 / template.json
Created February 16, 2017 15:29
Packer input template
{
"variables": {
"client_id": null,
"client_secret": null,
"subscription_id": null
},
"builders": [
{
"type": "azure-arm",
"subscription_id": "{{user `subscription_id`}}",
@ximon18
ximon18 / commands-used.txt
Created February 22, 2019 10:55
Supporting packer templates for bug report concerning 'only' not working for post-provisioner, while 'except' works as expected.
PACKER_LOG=1 PACKER_LOG_PATH=./packer-build-using-except-works.log packer build -only=docker packer-with-except.json
PACKER_LOG=1 PACKER_LOG_PATH=./packer-build-using-only-skips-the-post-provisioner.log packer build -only=docker packer-with-only.json
msg = DNSMessage(qdn, qstate.qinfo.qtype, qstate.qinfo.qclass, PKT_QR | PKT_AA)
msg.answer.append("{} 300 IN A {}".format(qdn, ipv4))
msg = DNSMessage(qdn, qstate.qinfo.qtype, qstate.qinfo.qclass, PKT_QR)
msg.authority.append("{}.<somedomain>. 60 IN NS {}.<somedomain>".format(b32, decoded))
msg.additional.append("{}.<somedomain>. 60 IN A {}".format(b32, decoded))
@ximon18
ximon18 / module.py
Last active March 8, 2019 13:48
An incomplete Python3 module for Unbound 1.9.0 showing a proof-of-concept partial implementation of http://xip.io/ like functionality in Unbound, and an extension of the idea to support dynamic delegation (which I'm not sure is even a sensible thing to do).
import base64
# Based on: https://jpmens.net/2011/08/09/extending-unbound-with-python-module/
def init_standard(id, env):
return True
def deinit(id):
return True
@ximon18
ximon18 / autorandrtray.py
Created April 28, 2019 19:42
Linux tray applet for autorandr
#!/usr/bin/python
# For: https://github.com/phillipberndt/autorandr
# Based on: https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux
import os
from gi import require_version
require_version('Gtk', '3.0')
require_version('AppIndicator3', '0.1')
from gi.repository import Gtk as gtk, AppIndicator3 as appindicator
from subprocess import Popen, PIPE