Skip to content

Instantly share code, notes, and snippets.

View asyd's full-sized avatar

Bruno Bonfils asyd

View GitHub Profile
@asyd
asyd / hack.sh
Created April 1, 2012 04:50 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@asyd
asyd / gist:d618fa3b234b759ab6ee
Created August 8, 2014 09:50
Use groovy script
GroovyShell groovyShell = new GroovyShell(getClass().getClassLoader());
Script groovyScript = null;
if (paramsImport.getGroovyScript() == null ) {
String groovyScriptName = "defaultUserMapping.groovy";
groovyScript = groovyShell.parse(new InputStreamReader(this.getClass().getResourceAsStream("/" + groovyScriptName)));
} else {
try {
groovyScript = groovyShell.parse(new File(paramsImport.getGroovyScript()));
} catch (IOException exception) {
@asyd
asyd / ReconTest.java
Created August 12, 2014 06:44
In memory LDAP Server with unboundid
@BeforeClass()
public void setUp() throws LDAPException {
InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=example,dc=com");
config.addAdditionalBindCredentials("cn=Directory Manager", "password");
directoryServer = new InMemoryDirectoryServer(config);
directoryServer.importFromLDIF(true, getClass().getResource("/00-initial.ldif").getPath());
directoryServer.startListening();
ldapConnection = directoryServer.getConnection();
}
[Unit]
Description=carbon-cache instance %i (graphite)
[Service]
User=graphite
Group=graphite
ExecStartPre=/bin/rm -f /opt/graphite/storage/carbon-cache-%i.pid
ExecStart=/opt/graphite/bin/carbon-cache.py --instance=%i start
Type=forking
PIDFile=/opt/graphite/storage/carbon-cache-%i.pid
@asyd
asyd / haproxy.lua
Last active August 29, 2015 14:25 — forked from vcastellm/haproxy.lua
LUA decoders to parse haproxy default http log, with extra http_host
local dt = require "date_time"
local ip = require "ip_address"
local l = require 'lpeg'
local syslog = require "syslog"
l.locale(l)
local msg = {
Timestamp = nil,
Hostname = nil,
Payload = nil,
@asyd
asyd / gpg-offline-master.md
Last active August 29, 2015 14:27 — forked from abeluck/gpg-offline-master.md
GPG Offline Master Key w/ smartcard
#!/usr/bin/env python
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.uic import *
import random
class App(QMainWindow):
@asyd
asyd / gist:349027e80d8279151ce3bae432017870
Last active February 7, 2017 22:05
Qt4 timer example #2
#!/usr/bin/env python
# encoding: utf-8:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.uic import *
import random
@asyd
asyd / buildDJ3.sh
Created April 27, 2017 09:30 — forked from aldaris/buildDJ3.sh
Shell script to build OpenDJ 3.0.0 from opendj-public repository
#!/bin/bash
function build() {
mvn clean install
if [ $? -ne 0 ] ; then
exit 1;
fi
}
mkdir commons