Skip to content

Instantly share code, notes, and snippets.

View alexandrem's full-sized avatar

Alexandre Mclean alexandrem

  • Ubisoft
  • Quebec
View GitHub Profile
@alexandrem
alexandrem / Debug output from logstash
Created November 19, 2012 16:46
Logstash filter using grok and multiline
{"@source"=>"rendez-vous", "@tags"=>["multiline"], "@fields"=>{"thread_id"=>["2812"], "pid"=>["42122"], "loglevel"=>["DEBUG"]}, "@timestamp"=>"2012-11-19T16:39:22.302Z", "@source_host"=>"devsandbox", "@source_path"=>"/", "@message"=>"TrackingService::SendTag(), eventName = screenpagenavig, eventData = ", "@type"=>"rendezvous"}
@alexandrem
alexandrem / libvirtd_crash.log.cleansed.tar.gz
Last active December 31, 2015 16:29
libvirtd segfault analysis
libvirtd debug logs
@alexandrem
alexandrem / gist:60018eb0428da7e713da
Created May 5, 2014 19:44
graphite-ng test metrics error
writing to template {1399232203 1399318603 [{test.metric2 ReadMetric("test.metric2")} {derivative(test.metric1) functions.ProcessDerivative(
ReadMetric("test.metric1"))}]}
executing: go run executor-5577006791947779410.go data.go
stdout:
sterr: # command-line-arguments
./executor-5577006791947779410.go:21: cannot use config (type "_/root/go/src/github.com/graphite-ng/graphite-ng/config".Main) as type "github.com/graphite-ng/graphite-ng/config".Main in function argument
./executor-5577006791947779410.go:30: cannot use ReadMetric("test.metric2") (type "github.com/graphite-ng/graphite-ng/chains".ChainEl) as type "_/root/go/src/github.com/graphite-ng/graphite-ng/chains".ChainEl in assignment
./executor-5577006791947779410.go:34: cannot use dep_el (type "_/root/go/src/github.com/graphite-ng/graphite-ng/chains".ChainEl) as type "github.com/graphite-ng/graphite-ng/chains".ChainEl in function argument
./executor-5577006791947779410.go:40: cannot use functions.ProcessDerivative(ReadMetric("test.metric1")) (type "githu

#Why? Current version of Ansible (1.7.1) does not merge hashes in the include_vars task even if told so via hash_behaviour = merge in your ansible.cfg. ansible/ansible#9116

This action plugin will merge hashes no matter how you have configured your hash_behaviour.

#Compatibility Tested on Ansible 1.9.0.1

#Updates

  • Now works both for explicit inventory hosts and aliases (e.g ansible_ssh_host)
@alexandrem
alexandrem / init.coffee
Created May 8, 2015 02:22
Atom Editor - Default ansible syntax for .yml
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@alexandrem
alexandrem / ansible-galaxy
Created May 10, 2015 04:12
ansible-galaxy with development mode
#!/usr/bin/env python
########################################################################
#
# (C) 2013, James Cammarata <jcammarata@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@alexandrem
alexandrem / openconnect.sh
Created February 11, 2016 02:11
osx openconnect with iproute2mac
openconnect --user <user> --script /etc/vpnc/vpnc-script <vpn server>
@alexandrem
alexandrem / 1_README.md
Created November 13, 2018 16:08 — forked from superseb/1_README.md
Generate Rancher 2 cluster/node agent definitions

Generate Rancher 2 cluster/node agents definitions

This is not official documentation/tooling, use with caution

This generate the Kubernetes definitions of the cattle-cluster-agent Deployment and cattle-node-agent DaemonSet, in case it's accidentally removed/server-url was changed/certficates were changed. It is supposed to run on every cluster Rancher manages. If you have custom clusters created in Rancher, see Kubeconfig for Custom clusters created in Rancher how to obtain the kubeconfig to directly talk to the Kubernetes API (as usually it doesn't work via Rancher anymore). For other clusters, use the tools provided by the provider to get the kubeconfig.

IMPORTANT: You get the cluster/node agents definitions from Rancher, and you apply them to the cluster that is created/managed so you need to switch kubeconfig to point to that cluster before applying them.

Running it

@alexandrem
alexandrem / systemd-networkd-restart.log
Created December 19, 2019 18:32
systemd-networkd veth bug
Dec 18 23:26:25 worker1 systemd-networkd[9517]: Bus bus-api-network: changing state RUNNING → CLOSED
Dec 18 23:26:25 worker1 systemd[1]: Stopping Network Service...
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0xed9675aa): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0xc559887e): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0x72d08386): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0xf52f8076): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0xe4bd18bc): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0xf4e3b5f2): FREE
Dec 18 23:26:25 worker1 systemd-networkd[9517]: DHCP CLIENT (0x505a962b): FREE
Dec 18 23:26:26 worker1 systemd[1]: systemd-networkd.service: Succeeded.