Skip to content

Instantly share code, notes, and snippets.

@eumel8
eumel8 / main.yml
Created November 16, 2016 19:35
ansible-otc create internal ELB
- include_vars: _elb_secrets.yml
- name: Send request to API
uri:
url: "{{ AUTH_URL_ELB }}"
method: POST
body_format: raw
follow_redirects: all
return_content: yes
validate_certs: yes
@eumel8
eumel8 / lxd.py
Created February 22, 2017 16:01 — forked from haarcuba/lxd.py
ansible inventory module that lists lxd containers
#!/usr/bin/env python3
import sys
import subprocess
import re
def containers():
lxcOutput = subprocess.check_output( ['lxc', 'list' ] )
ips = re.compile( '\d+\.\d+\.\d+\.\d+' ).findall( str( lxcOutput ) )
nodes = dict( hosts = ips, vars = { "ansible_user": "root" } )
inventory = dict( nodes = nodes )
@eumel8
eumel8 / gist:94bf107edca947d2ad2f9c326e0c5447
Created August 11, 2017 09:41
[otc] search ecs instances by tags
- name: Request ecs list by tags from ECS API
uri:
url: "{{ AUTH_URL_ECS }}/servers?tags={{ mykey }}.{{ myvalue }}"
method: GET
return_content: yes
validate_certs: yes
HEADER_Content-Type: "application/json"
HEADER_X-Auth-Token: "{{ token['x_subject_token'] }}"
register: ecslist
---
- hosts: "localhost"
gather_facts: no
tasks:
- name: Search for projects
uri:
url: "https://translate.openstack.org/rest/projects"
method: GET
return_content: yes
@eumel8
eumel8 / 1-usage.txt
Created September 3, 2017 16:27 — forked from xen/1-usage.txt
i18njson translate using Google Translate
$ python i18njson-translate.py --help
Usage: i18njson-translate.py [OPTIONS] INPUTFILE OUTPUT
Process and translate .po or JSON files and generate translated .po file
in result. Can work with exist .po files and if in initial file msgid
dissapear then mark translaed string as obsolete. Try to play nice with
version control systems and follow initial file order format, you will get
predicteable diffs.
Options:
@eumel8
eumel8 / SimpleHTTPServerWithUpload.py
Created December 15, 2017 18:51 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
Content-Type: multipart/mixed; boundary="===============8494485615320709508=="
MIME-Version: 1.0
--===============8494485615320709508==
Content-Type: text/cloud-boothook; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="boothook.sh"
#cloud-boothook
@eumel8
eumel8 / 12-factor-app-de.html
Last active April 8, 2018 11:28
12_factor_app_scroller
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- CSS Code -->
<style type="text/css" scoped>
.GeneratedMarquee {
font-family:Arial, sans-serif;
font-size:2em;
@eumel8
eumel8 / 01-youtube.md
Last active December 2, 2018 23:09
Create Youtube Playlist montly Top 50 Music
```plantuml
title Train QA
actor "Traveller" as traveller
participant "DB station realtime API" as db
participant "Data collector" as trains2
participant "Google Spreadsheet" as google
participant "Tableau data viz" as tableau