Skip to content

Instantly share code, notes, and snippets.

@olivierlemoal
olivierlemoal / gist:e792841c28374aef1a6a
Last active August 29, 2015 14:01
Commandes utiles challenge
# Trouver répertoires en écriture
find -type d -writable 2> /dev/null
# Afficher permissions cible d'un lien
ls -lL
Avec gcc-multilib, pour compiler en 32 bits :
gcc -m32 test.c -o test
Pour compiler en code ASM :
gcc -S test.c -o test.asm
syntaxe intel :
gcc -S -masm=intel test.c -o test.asm
#! /usr/bin/env bash
# Default config
declare OUTPUT_FILE="analyse.txt"
declare VERBOSE=0
declare INPUT="*.log"
# Set parameters
while getopts "vi:o:" OPTION
do
#! /usr/bin/env python3
"""ElasticPurge
Usage:
elasticpurge.py -i <index> -b <date> [--check] [-p <port>] [-s <server>]
elasticpurge.py -i <index> -o <days> [--check] [-p <port>] [-s <server>]
elasticpurge.py -i <index> --list [-p <port>] [-s <server>]
elasticpurge.py (-h|--help)
#! /usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
import urllib2
from elasticsearch import Elasticsearch
class ElasticSearch:
def __init__(self, host, port):
# encoding: utf-8
require "logstash/filters/base"
require "logstash/namespace"
require 'elasticsearch'
# Check the content of a event field against an
# ES index. If the value is found, the target field of the event
# is filled with "malware", else "clean".
class LogStash::Filters::Malware < LogStash::Filters::Base
@olivierlemoal
olivierlemoal / dump_stanza
Last active August 29, 2015 14:15
Dump XMPP packet libstrophe
log_error("XMPP : ");
char* xmpp;
size_t length;
xmpp_stanza_to_text(stanza, &xmpp, &length);
log_error(xmpp);
free(xmpp);

Keybase proof

I hereby claim:

  • I am olivierlemoal on github.
  • I am olivierlm (https://keybase.io/olivierlm) on keybase.
  • I have a public key whose fingerprint is FABF AD56 1F5B 777F B8B1 6A07 A5B2 54E5 C81B 7E46

To claim this, I am signing this object:

@olivierlemoal
olivierlemoal / vpn_alert.py
Last active August 29, 2015 14:17
VPN Mail alert post connect
#! /usr/bin/env python2
# -*- coding: utf8 -*-
import os
import sys
import logging
import traceback
import smtplib
from email.mime.text import MIMEText
from datetime import tzinfo, timedelta, datetime
@olivierlemoal
olivierlemoal / .gitconfig
Last active January 11, 2017 14:54
Git global conf
[user]
email = XXX
name = Olivier Le Moal
[push]
default = current
[core]
editor = vim
excludesfile = /home/olivier/.gitignore
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative