Skip to content

Instantly share code, notes, and snippets.

View talarczykco's full-sized avatar

Michael Talarczyk talarczykco

View GitHub Profile
#!/usr/bin/env ruby
require 'mysql2'
require 'stringex'
require 'preamble'
outdir = ARGV[0]
if outdir.nil? || !File.directory?(outdir)
puts 'Usage: wordpress-to-jekyll.rb <outdir>'
#!/usr/bin/env ruby
# See also:
# - https://github.com/timkay/aws/wiki/netrc-and-netrc.gpg-support-(store-your-passwords-in-a-file)
# - http://bryanwweber.com/writing/personal/2016/01/01/how-to-set-up-an-encrypted-.netrc-file-with-gpg-for-github-2fa-access/
# - http://www.issihosts.com/haveged/
begin
require 'netrc'
netrc = Netrc.read
entry = ARGV[0] || 'default'
#!/usr/bin/env ruby
# https://github.com/chef/mixlib-cli
# https://github.com/rest-client/rest-client
# https://github.com/sensu-plugins/sensu-plugin
require "json"
require "netrc"
require "rest-client"
require "sensu-plugin/check/cli"
@talarczykco
talarczykco / install-open-vm-tools-deploypkg-9.4.x
Last active August 16, 2016 21:10
install-open-vm-tools-deploypkg-9.4.x
curl -O https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
sudo apt-key add VMWARE-PACKAGING-GPG-DSA-KEY.pub
curl -O https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
sudo apt-key add VMWARE-PACKAGING-GPG-RSA-KEY.pub
echo 'deb https://packages.vmware.com/packages/ubuntu precise main' \
| sudo tee /etc/apt/sources.list.d/vmware-tools.list
sudo apt-get -y install apt-transport-https
#!/usr/bin/env ruby
# https://gist.github.com/mijit/72d31e53156fe82cecf8dc8c71421280
require 'thor'
module App
class Foo < Thor
desc "bar", "do some bar thing"
def bar
@talarczykco
talarczykco / Postfix on macOS.md
Last active October 3, 2017 15:53
How to get Postfix sending mail from my MacBook

Postfix on macOS

Sierra - 10.12.6

  1. Create a new app password in Gmail for Postfix (Optional - this is required only if you have 2-Step Verification enabled.)

  2. Edit /etc/postfix/sasl_passwd with your username and app password:

     smtp.gmail.com:587 yourname@gmail.com:CHANGEME
    
@talarczykco
talarczykco / keybase.md
Last active November 12, 2017 15:41
My Keybase proof

Keybase proof

I hereby claim:

  • I am talarczykco on github.
  • I am talarczykco (https://keybase.io/talarczykco) on keybase.
  • I have a public key whose fingerprint is 23E6 1B9C ABC8 6803 E6D6 9839 AF0F C079 23B4 BE7F

To claim this, I am signing this object:

@talarczykco
talarczykco / elasticsearch.exceptions.ElasticsearchException-fix.md
Last active November 17, 2017 20:12
elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically

If you use elasticsearch-curator on AWS (or possibly other hosted or self-hosted Elasticsearch installations that use SSL,) and you get this when curating:

elasticsearch.exceptions.ElasticsearchException: Unable to create client connection to Elasticsearch. Error: Root certificates are missing for certificate validation. Either pass them in using the ca_certs parameter or install certifi to use it automatically.

Then make sure the client.use_ssl key is present and True. This is a non-obvious error that led me down a rathole of Googling. Don't bother specifying root certificates, or installing certifi (it's probably already installed, if you installed elasticsearch-curator with pip.)

---
# https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html
client:
@talarczykco
talarczykco / create-eks-cluster.md
Last active August 23, 2018 18:14
Create an EKS cluster

Creating an EKS Cluster

Configure aws credentials:

brew install awscli
aws configure

Install eksctl and create cluster:

rsnapshot on macOS

Install

Run the following:

brew install rsnapshot
sudo perl -MCPAN -e'install Lchown'

Configure