Skip to content

Instantly share code, notes, and snippets.

View randomcamel's full-sized avatar

Chris Doherty randomcamel

View GitHub Profile

Troubleshooting winrm usually involves running the automation (Packer build / Terraform apply) until winrm fails, then inspecting the system to see where the failure is occurring. To do so please try the following steps.

If you have destroyed the infrastructure, please spin it back up with the automation tool (Packer or Terraform) and let the provisioner or build fail.

Establish that you have connectivity to the network that the VM is hosted on. This can be done by checking the IP address(es) and using a tool like route.

Open a Powershell session on your Windows workstation. The winrm connectivity tools are not available on other operating systems. You can skip some steps or try to substitute for them, but it's best to use a Windows workstation. A Windows 10 VM can be spun up using Vagrant, for example.

Establish that a raw connection can be made to the winrm service from your workstation. Run the command Test-netConnection -Port 5985, providing the IP address that Packer or Terraform is

@lamont-granquist
lamont-granquist / resources.md
Last active August 17, 2023 22:29
Three Ways to Write Correct Chef Resources

This has been moved into the official Chef docs:

https://docs.chef.io/custom_resources_notes.html

12.5 style custom resources

This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:

  1. For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an action_class do ... end block.
@jsomers
jsomers / websters-kindle.mdown
Created May 19, 2014 01:42
How to make the Webster's 1913 your default Kindle dictionary

How to make the Webster's 1913 your default Kindle dictionary

  1. Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.

  2. Get the "Send to Kindle" program on your computer. Here's the link for the Mac.

  3. Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.

  4. Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.

@faried
faried / maildirtocouch.py
Created February 1, 2011 22:02
Store messages in a Maildir into a couchdb database.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from mailbox import Maildir
from optparse import OptionParser
import os
from pprint import pprint
import sys
from uuid import uuid4
# This all assumes you have the process running in
# a terminal screen and you're on Linux-like system.
# First off, suspend the process and background it
ctrl-z # suspend the process
bg # restart/continue the process in the background
# Now create files to log to. They can be called anything,
# Personally I would end the in .log. E.g. could be
# /var/logs/myprocess-stdout.log,