Skip to content

Instantly share code, notes, and snippets.

View pierreozoux's full-sized avatar

Pierre Ozoux pierreozoux

View GitHub Profile
@pierreozoux
pierreozoux / stale_security_groups.py
Last active September 30, 2021 01:31 — forked from astrikos/stale_security_groups.py
Script to detect stale AWS security groups
#!/usr/bin/env python3
import boto3
import argparse
class StaleSGDetector(object):
"""
Class to hold the logic for detecting AWS security groups that are stale.
"""
def __init__(self):
super(StaleSGDetector, self).__init__()
@pierreozoux
pierreozoux / portKnocking.md
Last active January 11, 2020 22:54
In Beta, waiting a review!

Have you ever wonder how to do like in secret agent movies : they knock the door with a secret sequence and the door opens! You can do it with your server too! (or RasPi ;)

##Prepare your firewall

edit /etc/iptables.test.rules

*filter

# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0

-A INPUT -i lo -j ACCEPT

@pierreozoux
pierreozoux / gist:7292309
Created November 3, 2013 16:59
Python...
✘ pierreozoux@local ⮀ ~ ⮀ python
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.today()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'today'
>>> from datetime import datetime
@pierreozoux
pierreozoux / death-letter-en.txt
Created November 20, 2018 08:20 — forked from aeris/death-letter-en.txt
GDPR death letter
Dear Sir/Madam:
I am writing to you in your capacity as data protection officer for your
company. In light of recent spam received on this email address,
I am making this request for access to personal data
pursuant to Article 15 of the General Data Protection Regulation.
I am concerned that your company’s information practices may be putting my
personal information at undue risk of exposure or in fact has breached its
obligation to safeguard my personal information.
@pierreozoux
pierreozoux / car.js
Last active July 25, 2016 21:44
Issue in context - how to solve that?
function Car(color) {
this.color = color
}
Car.prototype.getColor = function() {
return this.color;
}
car = new Car('blue');
@pierreozoux
pierreozoux / reboot_gentoo.json
Created August 29, 2013 16:19
reboot_gentoo not working
{
"provisioners": [
{
"type": "shell",
"inline": [
"echo '1st script'",
"reboot",
"ifconfig enp0s3 down"
]
},
@pierreozoux
pierreozoux / result
Last active December 18, 2015 16:39
Bug OHAI-478
INTERFACE
Gentoo
type: eth, number: 0:
error here --^
Ubuntu
type: eth, number: 0
Addresse
Gentoo
nil
Ubuntu
@pierreozoux
pierreozoux / Runmefile
Created June 17, 2013 15:59
Example of a Runmefile
#!/bin/bash
tmp_home=/tmp/home_$(basename $PWD)
if [ -d $tmp_home ]; then
rm -rf $tmp_home
fi
mkdir $tmp_home
@pierreozoux
pierreozoux / brew doctor
Last active December 15, 2015 20:29
brew issue - gnutls-3.1.10
brew doctor
Your system is raring to brew.
brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: c64a2a8fe19c300dd99af8cca665bd17fad64c90
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
@pierreozoux
pierreozoux / csv2html.rb
Last active December 13, 2015 16:59
2 little quick and dirty script. A shell script to push ressources usage from a process running to a csv file. And a ruby script to draw a graph from a csv file.
#!/usr/bin/env ruby
require 'erb'
require 'csv'
csv_path = ARGV[0]
@csv_array = CSV.read(csv_path)
@csv_array.each_with_index do |row,row_index|