Skip to content

Instantly share code, notes, and snippets.

@rynbrd
rynbrd / plan.log
Created August 2, 2017 18:07
Terraform Debug Output
2017/08/02 09:58:30 [DEBUG] plugin: terraform: terraform-provider (internal) 2017/08/02 09:58:30 [DEBUG] [aws-sdk-go] DEBUG: Response dynamodb/GetItem Details:
2017/08/02 09:58:30 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/08/02 09:58:30 [DEBUG] plugin: terraform: HTTP/1.1 200 OK
2017/08/02 09:58:30 [DEBUG] plugin: terraform: Connection: close
2017/08/02 09:58:30 [DEBUG] plugin: terraform: Content-Length: 117
2017/08/02 09:58:30 [DEBUG] plugin: terraform: Content-Type: application/x-amz-json-1.0
2017/08/02 09:58:30 [DEBUG] plugin: terraform: Date: Wed, 02 Aug 2017 16:59:14 GMT
2017/08/02 09:58:30 [DEBUG] plugin: terraform: Server: Server
2017/08/02 09:58:30 [DEBUG] plugin: terraform: X-Amz-Crc32: 802467901
2017/08/02 09:58:30 [DEBUG] plugin: terraform: X-Amzn-Requestid: 1OAGVPG7RGDILJOF9F5AJ2Q933VV4KQNSO5AEMVJF66Q9ASUAAJG
"""Handle generic DNS events."""
import boto3
import botocore.exceptions
import logging
logger = logging.getLogger()
class DNS(object):
"""Create or delete DNS records in Route53."""
import boto3
def get_ecs_task_instance(task_arn):
"""Return the EC2 instance associated with the task."""
ecs = boto3.client('ecs')
task = None
for cluster in ecs.list_clusters()['clusterArns']:
res = ecs.describe_tasks(cluster=cluster, tasks=[task_arn])
if res['tasks']:
config:{{range $key, $value := .config}}
{{$key}}: {{$value}}{{end}}
@rynbrd
rynbrd / text-zoom.py
Created August 10, 2012 18:18
Toggle interface scaling in Gnome3 and Google Chrome
#!/bin/env python3
import os
import sys
import json
import subprocess
from gi.repository import Gio
class ScaleError(Exception):
@rynbrd
rynbrd / mbpr-broken.txt
Created August 3, 2012 23:03
MacBook Pro Retina - Unsupported Hardware
Confirmed not working:
-Nouveau driver (no HW accel; works in noaccel with patches from https://bugs.freedesktop.org/show_bug.cgi?id=51971)
-i915 driver (screen corruption; mode is correct)
-GMUX (not recognized by GMUX driver)
-Microphone (speakers and headphone jack work; microphone and microphone jack emit white noise)
-Thunderbolt (coldplug only; often requires reboot)
-Backlight (not working on any NVIDIA driver; works for Intel card with i915)
-Wireless 802.11n (802.11b/g works)
Working for some and not others:
@rynbrd
rynbrd / distribute-error.txt
Created July 29, 2012 18:15
Python distribute Error
Running pyramid-1.3.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-g7whby/pyramid-1.3.2/egg-dist-tmp-7q06sp
Traceback (most recent call last):
File "bin/easy_install", line 9, in <module>
load_entry_point('distribute==0.6.28', 'console_scripts', 'easy_install')()
File "/home/sadpengu/Sandbox/pyramid/env/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/command/easy_install.py", line 1929, in main
with_ei_usage(lambda:
File "/home/sadpengu/Sandbox/pyramid/env/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/command/easy_install.py", line 1910, in with_ei_usage
return f()
File "/home/sadpengu/Sandbox/pyramid/env/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/command/easy_install.py", line 1933, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
@rynbrd
rynbrd / cover.py
Created July 25, 2012 20:29
Add Cover Sheet with PyPdf
#!/bin/env python2
from pyPdf import PdfFileWriter, PdfFileReader
if __name__ == '__main__':
output = PdfFileWriter()
cover = PdfFileReader(file("cover.pdf", "rb"))
body = PdfFileReader(file("body.pdf", "rb"))
output.addPage(cover.getPage(0))
@rynbrd
rynbrd / mbp-10,1-lcpci-vv
Created July 22, 2012 05:30
MacBook Pro Retina PCI
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
Subsystem: Apple Inc. Device 00f7
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
Latency: 0
Capabilities: [e0] Vendor Specific Information: Len=0c <?>
Kernel driver in use: agpgart-intel
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) (prog-if 00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
@rynbrd
rynbrd / foreman-fog-error
Created June 8, 2012 21:40
Foreman FOG Error
=> Booting WEBrick
=> Rails 3.0.10 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require': /usr/share/foreman/vendor/ruby/1.8/bundler/gems/fog-5d4df4d8aae4/lib/fog/ecloud/compute.rb:311: syntax error, unexpected ')', expecting '=' (SyntaxError)
/usr/share/foreman/vendor/ruby/1.8/bundler/gems/fog-5d4df4d8aae4/lib/fog/ecloud/compute.rb:319: class definition in method body
/usr/share/foreman/vendor/ruby/1.8/bundler/gems/fog-5d4df4d8aae4/lib/fog/ecloud/compute.rb:344: class definition in method body
/usr/share/foreman/vendor/ruby/1.8/bundler/gems/fog-5d4df4d8aae4/lib/fog/ecloud/compute.rb:513: syntax error, unexpected kEND, expecting $end
from /usr/share/foreman/vendor/ruby/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'