Skip to content

Instantly share code, notes, and snippets.

View bobey's full-sized avatar

Olivier Balais bobey

View GitHub Profile
@bobey
bobey / dist_backup_script.sh
Last active August 29, 2015 14:05
Backup script
#!/bin/bash
# ----
#
# Script de backup serveur perso vers serveur distant
# Fonctionnemenent :
# 1. Targz de /var/www
# 2. Targz de /etc/apache2/sites-available
# 3. Dump de toutes les bases de données MySql
# 4. Zip du backup courant avec protection par mot de passe
#!/bin/bash
while [ l=l ]
do
#eject cdrom
eject
#pull cdrom track back in
eject -t
done
@bobey
bobey / clone-projets.sh
Last active January 12, 2016 15:05
Git clone ALL the Gitlab Projets of given namespace in one command
curl -sS https://gist.githubusercontent.com/bobey/2b09d2cc72fbcc8cf551/raw/get-gitlab-projets.php | \
php -- http://gitlab.com YOUR-PRIVATE-TOKEN your-namespace | \
xargs -n 1 git clone
@bobey
bobey / generate_ssh_config.js
Created October 12, 2015 14:02
Generate a .ssh/config file from your EC2 instances
var AWS = require('aws-sdk');
AWS.config.update({region: 'eu-west-1'});
var ec2 = new AWS.EC2();
ec2.describeInstances({}, function(err, data) {
data.Reservations.forEach(function(reservation) {
reservation.Instances.forEach(function(instance) {