Skip to content

Instantly share code, notes, and snippets.

View matgou's full-sized avatar
🎯
Focusing

Mathieu Goulin matgou

🎯
Focusing
View GitHub Profile
@matgou
matgou / main.tf
Created July 25, 2021 08:34
terraform AWS ec2 evnets
################################################################################
# Terraform : install cloudwatch event
################################################################################
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
#
#
#
if [ -t 0 ]
then
noir='\e[0;30m'
gris='\e[1;30m'
rougefonce='\e[0;31m'
rose='\e[1;31m'
vertfonce='\e[0;32m'
@matgou
matgou / hotbackup.sh
Last active July 28, 2016 14:04
Backup of postgres
#!/bin/bash
#@****************************************************************************
#@ Author : Mathieu GOULIN (mathieu.goulin@gadz.org)
#@ Organization : Gadz.org (www.gadz.org)
#@ Licence : GNU/GPL
#@
#@ Description :
#@
#@ Prerequisites :
#@ Arguments :
@matgou
matgou / hotbackup.sh
Last active December 4, 2019 07:38
Hot-backup of mysql with btrfs
#!/bin/bash
#@****************************************************************************
#@ Author : Mathieu GOULIN (mathieu.goulin@gadz.org)
#@ Organization : Gadz.org (www.gadz.org)
#@ Licence : GNU/GPL
#@
#@ Description :
#@
#@ Prerequisites :
#@ Arguments :
require ["fileinto"];
##################################################################
# Perso
##################################################################
######### Rappel Anniversaire MSN
if header :contains "Subject" "Rappel : Anniversaire de" {
fileinto "perso.mail_notif";
stop;
}
#!/usr/bin/env python
import pika
import sys
credentials = pika.PlainCredentials('guest', 'guest')
parameters = pika.ConnectionParameters('localhost',
5672,
'/',
credentials)
connection = pika.BlockingConnection(parameters)
# v1.0 of a command line uploader for the koken gallery software.
# The only non-standard requirement is pyton-requests.
import json
import requests
import os
from urllib import quote as quote
api_url = "http://yourdomain/api.php?"
common_headers = {'X-Koken-Auth':'cookie'}
@matgou
matgou / firewall.sh
Created May 14, 2015 18:49
Firewall
#!/bin/bash
### BEGIN INIT INFO
# Provides: firewall
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: firewall init script
# Description: An init script for Graphite's carbon-cache daemon.
### END INIT INFO
@matgou
matgou / snapshot.sh
Last active August 29, 2015 14:13
Take the snapshot of btrfs filesystem
#!/bin/bash
#
# usage: snapshot.sh create|delete|list [snapshotname]
#
#
btrfs_root=/
DST_BACKUPDIR=/backup
# **************************************************************************