Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

abdennour abdennour

🌴
On vacation
View GitHub Profile
@abdennour
abdennour / README.md
Last active Mar 20, 2018
Automate Snapshot creation of EBS attached to running instances in certain region
View README.md

Overview

According to the specified region, the script will search on all running instances, then it extracts the volumes ids attached to those EBS volumes, then it takes a snapshot for each volume with a consistent tagging approach.

Pre-requistes

How to use

@abdennour
abdennour / README.md
Created Jul 6, 2018
Notify GOOOAL with Google World Cup 2018
View README.md

Open Google

https://google.com

Search by name of teams

  • Example: Brazil vs Belgiun

Open JS console of browser

@abdennour
abdennour / ec2-aws-keys2-container.sh
Created Oct 11, 2018
pass ec2 role keys to container.sh
View ec2-aws-keys2-container.sh
# install dependencies
apt-get install jq -y
# Set Variables
DOCKER_IMAGE=python:alpine
ENDPOINT=http://169.254.169.254/latest/meta-data/iam/security-credentials/
KEYS=$(curl -s $ENDPOINT`curl -s $ENDPOINT`)
docker run -it --rm \
View ssh-docker-vm.sh
#!/bin/bash
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
@abdennour
abdennour / 01-install_prerequisites.sh
Last active Dec 15, 2018
Bitbucket Full Backup of GIT Repositories
View 01-install_prerequisites.sh
#!/bin/bash
pip install oauthlib
pip install https://github.com/samkuehn/bitbucket-backup/archive/master.zip
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
servers = [
{
:name => "k8s-head",
:type => "master",
:box => "ubuntu/xenial64",
:box_version => "20180831.0.0",
:eth1 => "192.168.205.10",
@abdennour
abdennour / export-ec2-to-ova.sh
Created Feb 26, 2019
Export AWS EC2 instance to a standard VM file format - ova, ovf, vmdk
View export-ec2-to-ova.sh
#!/bin/bash
# Export EC2 to OVA and save OVA in S3 bucket s3://export-vms/ubuntus/18-04/*.ova
aws ec2 create-instance-export-task \
--instance-id i-0c006d5b801050318 \
--target-environment vmware \
--export-to-s3-task DiskImageFormat=VMDK,ContainerFormat=ova,S3Bucket=export-vms,S3Prefix=ubuntus/18-04/
@abdennour
abdennour / install-certificate.sh
Created Apr 6, 2019
Install Certificate for Many clients
View install-certificate.sh
#!/bin/bash
# Usage: $0 java google.com 443
CLIENT=$1
HOST=$2
PORT=$3
# openssl s_client -servername $HOST -connect $HOST:$PORT </dev/null 2>/dev/null | openssl x509 -inform PEM -outform DER -out ${HOST}.cer
@abdennour
abdennour / users.yml
Created Apr 26, 2019
playbook example
View users.yml
View the file *http://files.example.com/user_list.yml* from *control1*. Create a playbook in */home/ansible/exam/users.yml* that follows the instructions provided in the file.
Create the file /home/ansible/exam/users.yml containing the following:
---
- hosts: localhost
tasks:
- name: download user_list.yml
get_url:
url: http://files.example.com/user_list.yml
View users.yml
---
- hosts: localhost
tasks:
- name: download user_list.yml
get_url:
url: http://files.example.com/user_list.yml
dest: /home/ansible/files/user_list.yml
- hosts: node1