Skip to content

Instantly share code, notes, and snippets.

View Lawouach's full-sized avatar
🏠
Reliably

Sylvain Hellegouarch Lawouach

🏠
Reliably
View GitHub Profile
{
"version": "1.0.0",
"title": "do stuff",
"description": "n/a",
"secrets": {
"myticketing": {
"token": "12345"
}
},
"controls": [
@Lawouach
Lawouach / monitor-and-interrupt.py
Created August 31, 2020 13:58
Control to interrupt a chaostoolkit experiment as soon as possible
"""
Control that starts a thread in a background to perform some sort of bespoke
monitoring that interrupts the execution of the experiment as soon as possible
during the method.
To use in your experiment add the following to your experiment:
```json
"controls": [
{

Keybase proof

I hereby claim:

  • I am lawouach on github.
  • I am lawouach (https://keybase.io/lawouach) on keybase.
  • I have a public key ASD72Eko0MJWr1ocZK15NISlO1NzreYQjiFxCMa8yCy_EAo

To claim this, I am signing this object:

@Lawouach
Lawouach / instructions.md
Last active October 4, 2018 19:10
Connect to a AWS EKS cluster from the Chaos Toolkit using port-exec

Connect to a AWS EKS cluster from the Chaos Toolkit

Until version 8.0.0a1 of the Python client for Kubernetes, we had to rely on creating a service account to allow connection via that client (basically any non-Go client) to a EKS cluster.

With this new release, this is now possible as it implements port-exec authentication.

Here are the instructions to roll:

  1. Create a virtual environment (not mandatory but at least you start from a clean slate):
import { Microgrammar } from "@atomist/microgrammar/Microgrammar";
import { Opt } from "@atomist/microgrammar/Ops";
const csv = `FirstName,LastName,Gender
Patrick, Henry, Male
Grace, 'O''Malley', Female
Fred, "Flintstone, esq.", Male
`;
interface Individual {
@Lawouach
Lawouach / DoSomethingElse.py
Created January 27, 2017 17:29
Import Python code into your Rugs
# -*- coding: utf-8 -*-
from typing import Dict, Any
from .rugpy.stuff import echo
__all__ = ["editor"]
def edit(project: Any, params: Dict[str, str]) -> Dict[str, str]:
"""
Add a new method to a Python module.
@Lawouach
Lawouach / SuffixClassName.py
Last active January 30, 2017 16:28
Suffixes Python class name with Rug
# -*- coding: utf-8 -*-
from typing import Dict, Any
__all__ = ["editor"]
def edit(project: Any, params: Dict[str, str]) -> Dict[str, str]:
"""
Update each class name of a project with a new suffix.
"""
@Lawouach
Lawouach / LogProjectName.py
Created January 27, 2017 14:10
Most basic Python Rug editor
# -*- coding: utf-8 -*-
from typing import Dict, Any
__all__ = ["editor"]
def edit(project: Any, params: Dict[str, str]) -> Dict[str, str]:
"""
Log the project's name
"""
@Lawouach
Lawouach / ws4py simple chat example
Created November 28, 2013 21:00
A more elaborated chat example using ws4py. It broadcasts to all clients when a message is sent. It also sends to a single client if the message is prefixed by "@Username: ..."
# -*- coding: utf-8 -*-
import argparse
import random
import os
import cherrypy
from ws4py.server.cherrypyserver import WebSocketPlugin, WebSocketTool
from ws4py.websocket import WebSocket
from ws4py.messaging import TextMessage