Skip to content

Instantly share code, notes, and snippets.

- name: install mysql
apt:
name: ['mariadb-server', 'python-pymysql', 'python-mysqldb', 'mycli']
state: latest
update_cache: yes
@arnaudmorin
arnaudmorin / boot.py
Last active February 12, 2021 16:33
boot an instance on openstack
#!/usr/bin/env python
import openstack
import os
import base64
def create_connection():
return openstack.connect(
auth_url=os.environ.get('OS_AUTH_URL'),
@arnaudmorin
arnaudmorin / plan.tf
Created September 15, 2020 11:24
terraform multiple regions at once
# Configure the OpenStack Provider
# It will read info from env OS_xxx
provider "openstack" {
}
#
# BACKENDS
#
# Create one server per region
resource "openstack_compute_instance_v2" "servers" {
@arnaudmorin
arnaudmorin / debian-10-packer.json
Last active April 8, 2020 09:59
Install new cloud-init on Debian 10 using packer
{
"builders": [
{
"type": "openstack",
"username": "xxx",
"password": "yyy",
"identity_endpoint": "https://auth.cloud.ovh.net/v3/",
"region": "DE1",
"tenant_id": "zzz",
"image_name": "debian10-arnaud",
@arnaudmorin
arnaudmorin / archive-mails
Created August 30, 2017 09:28 — forked from pkern/archive-mails
A script for cleaning up mails in Maildir folders, with proper threading support
#!/bin/sh
BASE=$HOME/Maildir
ARCHIVEBASE=$HOME/Maildir/archive.
for folder in `find $BASE -maxdepth 1 -type d \! -regex '.*/archive\..*' \! -name cur \! -name tmp \! -name new`
do
folder=$(basename $folder)
if [ "${folder}" = "Maildir" ]; then folder=INBOX; fi
./cleanup-maildir.py --archive-folder=${ARCHIVEBASE}${folder} --maildir-root=$BASE --folder-prefix= --age=365 -d 1 -k -u -v archive ${folder}
#!/usr/bin/python
import unirest
from pprint import pprint as pp
import xml.etree.ElementTree as xml
from datetime import datetime
from time import sleep
base_url = "https://www.waze.com/row-RoutingManager/routingRequest?"
from_y = "48.32957"