Skip to content

Instantly share code, notes, and snippets.

View mvisonneau's full-sized avatar

Maxime VISONNEAU mvisonneau

View GitHub Profile
@mvisonneau
mvisonneau / addPackage.sh
Created March 5, 2015 11:12
Add and sign package into a repo debian
#!/bin/sh
#########
cd /data/seres
rm -f InRelease Release.gpg
dpkg-sig --sign builder $1
apt-ftparchive packages . > Packages
gzip -c Packages > Packages.gz
apt-ftparchive release . > Release
gpg --clearsign -o InRelease Release
@mvisonneau
mvisonneau / Vagrantfile
Created March 23, 2015 12:49
Multiple Machines Vagrant
Vagrant.configure("2") do |config|
config.vm.define :centos do |centos|
centos.vm.box = "centos64"
end
config.vm.define :ubuntu do |ubuntu|
ubuntu.vm.box = "ubuntu/trusty64"
end
end
@mvisonneau
mvisonneau / Vagrantfile
Last active August 29, 2015 14:17
Salt Vagrant File
# Configuration for minion
minion_count = 3
vb_gui = false
minion_memory = 512
minion_cpus = 1
Vagrant.configure(2) do |config|
# Define box settings
config.vm.box = "ubuntu/trusty64"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQGiBEsm3aERBACyB1E9ixebIMRGtmD45c6c/wi2IVIa6O3G1f6cyHH4ump6ejOi
AX63hhEs4MUCGO7KnON1hpjuNN7MQZtGTJC0iX97X2Mk+IwB1KmBYN9sS/OqhA5C
itj2RAkug4PFHR9dy21v0flj66KjBS3GpuOadpcrZ/k0g7Zi6t7kDWV0hwCgxCa2
f/ESC2MN3q3j9hfMTBhhDCsD/3+iOxtDAUlPMIH50MdK5yqagdj8V/sxaHJ5u/zw
YQunRlhB9f9QUFfhfnjRn8wjeYasMARDctCde5nbx3Pc+nRIXoB4D1Z1ZxRzR/lb
7S4i8KRr9xhommFnDv/egkx+7X1aFp1f2wN2DQ4ecGF4EAAVHwFz8H4eQgsbLsa6
7DV3BACj1cBwCf8tckWsvFtQfCP4CiBB50Ku49MU2Nfwq7durfIiePF4IIYRDZgg
@mvisonneau
mvisonneau / pfcheck.sh
Created June 24, 2015 14:20
Puppetfile version checker
#!/bin/bash
###########
OK='\033[0;32m'
NOK='\033[0;31m'
NC='\033[0m'
vercomp () {
if [[ $1 == $2 ]]
then
ebug: Executing '/etc/init.d/iptables-persistent status'
Debug: Prefetching iptables resources for firewall
Debug: Puppet::Type::Firewall::ProviderIptables: [prefetch(resources)]
Debug: Puppet::Type::Firewall::ProviderIptables: [instances]
Debug: Executing '/sbin/iptables-save'
Error: Could not prefetch firewall provider 'iptables': can't dup NilClass
Debug: Puppet::Type::Firewall::ProviderIptables: [instances]
Debug: Executing '/sbin/iptables-save'
Error: /Firewall[999 drop multicast]: Could not evaluate: can't dup NilClass
Debug: Puppet::Type::Firewall::ProviderIptables: [instances]
@mvisonneau
mvisonneau / random_unique_range.php
Created June 14, 2016 22:16
generate_random_unique_range
<?php
$min = 1 ;
$max = 99999 ;
$array = range($min, $max);
function getRandomUnusedNumber( $array, $min, $max ) {
$i = rand( $min, $max ) ;
if( isset( $array[$i] ) )
return $array[$i] ;
@mvisonneau
mvisonneau / config
Created March 17, 2015 13:09
Terminator Config File
[global_config]
suppress_multiple_term_dialog = True
title_transmit_bg_color = "#839496"
title_inactive_fg_color = "#93a1a1"
title_transmit_fg_color = "#eee8d5"
title_inactive_bg_color = "#586e75"
[keybindings]
[profiles]
[[default]]
palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1"
@mvisonneau
mvisonneau / bumpme
Last active October 15, 2017 14:14
Sun Oct 15 14:14:30 UTC 2017
#!/usr/bin/env bash
if ! [ -x "$(command -v git)" ]; then
echo 'Error: jq is not installed.' >&2
exit 1
fi
if [ -z "$1" ]; then
echo "Error: you must pass the filename as an argument"
exit 1