Skip to content

Instantly share code, notes, and snippets.

View dmsimard's full-sized avatar

David Moreau Simard dmsimard

View GitHub Profile
  Fedora CentOS OpenSUSE Debian Ubuntu
Ansible 2.3.4.0    
  • py3
  • mysql
  • py2
  • sqlite
 
Ansible 2.4.4.0
  • py3
  • sqlite
  • py2
  • mariadb
     
| - sqlite | - mariadb | | | |
- name: Play
hosts: all
gather_facts: yes
tasks:
- debug:
msg: something
- name: Play
hosts: all
gather_facts: no
@dmsimard
dmsimard / get_promotions.sh
Created March 5, 2018 21:38
dlrn promotions
#!/bin/bash
releases="api-centos-pike api-centos-queens api-centos-master"
names="current-tripleo current-tripleo-rdo current-tripleo-rdo-internal tripleo-ci-testing"
for release in $releases
do
for name in $names
do
dlrnapi --url https://trunk.rdoproject.org/${release} promotion-get --promote-name ${name} --limit 1 |jq '.[1] | "\(.commit_hash)_\(.distro_hash[0:8])"'
done
@dmsimard
dmsimard / mitigate-meltdown.yml
Created January 9, 2018 16:19 — forked from mnaser/mitigate-meltdown.yml
Ansible playbook for Meltdown mitigation (KPI for CentOS/RHEL 7)
---
- hosts: all
gather_facts: false
pre_tasks:
- name: ensure ipmi tools are installed
yum:
name: ipmitool
- name: retrieve ipmitool address
shell: >
ipmitool lan print | grep '^IP Addr' | grep -v Source | cut -d':' -f2 | xargs
@dmsimard
dmsimard / clone-everything.py
Created November 12, 2017 01:02
clone-everything
import requests
from requests.auth import HTTPBasicAuth
from urlparse import parse_qsl, urlsplit
import git
import json
import os
import shutil
# GitHub has increased rate-limiting for non-authenticated requests
# See tokens here: https://github.com/settings/tokens
@dmsimard
dmsimard / k8s_imagestream_pruner.py
Created November 4, 2017 17:29
Returns a list of imagestreams older than MAX_AGE
#!/usr/bin/env python
# Copyright Red Hat, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@dmsimard
dmsimard / SmartThings_DeviceHandler.groovy
Created November 4, 2017 01:35
TH1123ZB-TH1124ZB Zigbee Sinope Thermostat
/**
Copyright Sinopé Technologies
SVN-311
**/
preferences {
// input("zipcode", "text", title: "ZipCode for setting outdoor Temp", description: "by default,use current hub location")
input("trace", "bool", title: "trace", description:
"Set it to true to enable tracing or leave it empty (no tracing)")
input("logFilter", "number",title: "(1=ERROR only,2=<1+WARNING>,3=<2+INFO>,4=<3+DEBUG>,5=<4+TRACE>)", range: "1..5",
- name: getting playbook id
hosts: localhost
gather_facts: no
tasks:
- name: Record something
ara_record:
key: key
value: something
register: recorded
@dmsimard
dmsimard / bookmarklet.js
Created October 30, 2017 16:56
github.com to git.openstack.org
javascript:(function()%7Bwindow.location.href%20%3D%20%22https%3A%2F%2Fgit.openstack.org%2Fcgit%22%20%2B%20window.location.pathname.replace(%2F%5C%2Fblob%5C%2F%5Cw%2B%5C%2F%2F%2C%20%22%2Ftree%2F%22)%7D)()
@dmsimard
dmsimard / interfaces.log
Last active October 25, 2017 03:17
journalctl -u NetworkManager-dispatcher
bash-4.2# ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 0.0.0.0
ether 02:42:c0:f5:b0:7b txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450