Skip to content

Instantly share code, notes, and snippets.

View oussemos's full-sized avatar

Oussema Ch oussemos

  • Paris, France
View GitHub Profile
---
- hosts: all
pre_tasks:
- name: Set correct sudoers entry for Vagrant
lineinfile: "dest=/etc/sudoers.d/vagrant state=present create=yes regexp='^%vagrant ' line='%vagrant ALL=(ALL) NOPASSWD: ALL' validate='visudo -cf %s'"
- name: Update apt cache
apt: update_cache=yes cache_valid_time=7200
- hosts: mysql
# This file is overwritten upon Agent upgrade.
# To make modifications to the check configuration, please copy this file
# to `disk.yaml` and make your changes on that file.
init_config: null
instances:
- excluded_filesystems:
- tmpfs
- none
- nsfs
- shm
@oussemos
oussemos / delete-versions.sh
Created March 13, 2018 09:34
Delete all objects in S3 bucket (including hiden versions)
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@oussemos
oussemos / delete-bucket.py
Created March 20, 2018 13:11
Delete bucket S3 all version with boto3
import boto3
wired_buckets = [
'bucket',
]
s3 = boto3.resource('s3')
for wired_bucket in wired_buckets:
{
"variables" : {
"region" : "eu-west-1"
},
"builders" : [
{
"type" : "amazon-ebs",
"access_key" : "xxxxxxxxxx",
"secret_key" : "xxxxxxxxxx",
"instance_type" : "t2.micro",
#/bin/sh
sudo yum update -y
sudo yum install nginx -y
sudo sh -c "echo '<h1>Hello Smile</h1>' > /usr/share/nginx/html/index.html"
sudo /etc/init.d/nginx restart
sudo chkconfig nginx on

Keybase proof

I hereby claim:

  • I am oussemos on github.
  • I am oussemos (https://keybase.io/oussemos) on keybase.
  • I have a public key ASCxCAEYXnNknY5hAD_x_6Eb2rIta_QRiDxgFTuED7-HsQo

To claim this, I am signing this object: