Skip to content

Instantly share code, notes, and snippets.

Trond Hindenes trondhindenes

Block or report user

Report or block trondhindenes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
trondhindenes /
Last active Mar 29, 2019
testing out the aws-cdk for Python
#Install pips:
import json
from aws_cdk import cdk
from aws_cdk import aws_ec2
app = cdk.App()
stack = cdk.Stack(app, 'MyStack')
trondhindenes / .gitlab-ci.yml
Last active Feb 17, 2019
Run KinD (Kubernetes in Docker) as part of Gitlab CI job
View .gitlab-ci.yml
#Spin up Kubernetes control plane as part of before_script, and destroys it using after_script
#Some custom logic to get to the right ip address
#Requres the gitlab docker runner, with "pass-thru" to the host docker socket.
- test
image: python:3.6.6 #the docker image you run in needs Docker installed, and access to the host docker socket.
trondhindenes /
Created Dec 28, 2018
Flask-Injector example
import boto3
from bloop import BaseModel, Column, String, Engine
from flask import Flask
from flask_injector import FlaskInjector, singleton
from flask_restful import Api, Resource
from injector import inject, provider
import random
import string
from bloop_local import patched_local_bloop_engine
View TraefikReplayRRuleExample.yml
- name: Replay GETs against staging #arbitrary name
methods: #only replay these requests
- get
paths: #replay these paths (use wildcard-notation because I suck at regex)
- "/api/1/*"
host_names: #The hostnames to match on
strip_headers: #remove these headers before replaying the request (list of strings). You can use wildcards such as
- "X-*" #strip away all X-type headers
- "User-Agent" #Strip away this and add a new one down below
View ingress_example.yml
apiVersion: extensions/v1beta1
kind: Ingress
name: config-ansiblejobservicefrontend-v{{ major_version }}-{{ environment }}-{{ environmentid }}-httpsecure
namespace: sre
traefik.frontend.passHostHeader: "true"
expose: internal-httpsecure
trondhindenes / traefik_daemonset.yml
Created Apr 29, 2018
View traefik_daemonset.yml
apiVersion: extensions/v1beta1
kind: DaemonSet
name: traefik-ingress-controller-internal-httpsecure-{{ environment }}
namespace: networking
app: traefik-ingress-lb-internal-httpsecure
environment: "{{ environment }}"
environmentid: "{{ environmentid }}"
View pycharm2018stacktrace.txt
Traceback (most recent call last):
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/", line 1664, in <module>
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/", line 1658, in main
globals =['file'], None, None, is_module)
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/trond/apps/pycharm-community-2018.1.1/helpers/pydev/_pydev_imps/", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/trond/Documents/projects-rikstv/SRE/RiksTV.Utils.ServiceOwnership/", line 1, in <module>
View filebeat_stats_output.json
"beat": {
"cpu": {
"system": {
"ticks": 62,
"time": 62
"total": {
"ticks": 155,
"time": 155,
trondhindenes / site.yml
Created Mar 25, 2018
example of using the mssql role to provision RDS databases
View site.yml
- name: do sql things
hosts: sqlserver_jumphost
- name: doit
name: rikstv_windows_mssqlconfig
admin_login: "superduperadmin"
admin_password: "superduperpassword"
sql_server_name: ""
trondhindenes / main.yml
Created Mar 25, 2018
MSSQL config ansible role
View main.yml
- name: Create MSSQL Logins
resource_name: SqlServerLogin
Ensure: "{{ item['state'] | default('present')}}"
LoginType: "SqlLogin"
ServerName: "{{ sql_server_name }}"
Name: "{{ item['username'] }}"
LoginCredential_username: "{{ item['username'] }}"
LoginCredential_password: "{{ item['password'] }}"
You can’t perform that action at this time.