Skip to content

Instantly share code, notes, and snippets.

View akerouanton's full-sized avatar

Albin Kerouanton akerouanton

View GitHub Profile
COMPOSER_PATH=$(which composer)
composer() {
options=$(ls -1 /usr/lib/php5/20131226/ | egrep -v 'xdebug|opcache|mysql|wddx|pgsql'| sed -e 's/\(.*\)/ --define extension=\1/' | tr -d '\n')
bash -xc "php -n -d memory_limit=-1 $options $COMPOSER_PATH $*"
}
@akerouanton
akerouanton / dump-unix-socket.sh
Created August 21, 2016 17:03
Dump what goes throught a unix domain socket
socat -x -v UNIX-LISTEN:/tmp/debug-docker.sock,mode=777,reuseaddr,fork,ignoreeof UNIX-CONNECT:/var/run/docker.sock
const amqp = require('amqp');
const config = require('./config');
const logger = require('./lib/logger');
const Analysis = require('./lib/Analysis');
const Runner = require('./lib/Runner');
const connection = amqp.createConnection(config.amqp);
const runner = new Runner(config.docker);
connection.on('error', logger.error);
@akerouanton
akerouanton / redis-lifecycle-events-to-sns-to-sqs.js
Created September 1, 2016 09:21
Programatically create a SQS queue and subscribe it to a specific SNS topic
const AWS = require('aws-sdk');
// should be configurable
const ACCOUNT_ID = '';
const TOPIC_ARN = "arn:aws:sns:eu-central-1:"+ACCOUNT_ID+":"+TOPIC_ID;
const REGION = 'eu-central-1';
AWS.config.region = REGION;
AWS.config.apiVerison = 'latest';
@akerouanton
akerouanton / ResourceManager.js
Created January 4, 2017 01:10
pure js IOC container
export default class ResourceManager {
constructor (defs) {
this._defs = new Map(defs);
this._booted = new Map();
}
async get (name) {
if (!this._defs.has(name)) {
throw new Error(`There is no resource named "${name}".`);
} else if (!this._booted.has(name)) {

Gaufrette XYZ adapter

This repository is a metapackage for Gaufrette XYZ adapter.

For issues and PRs please go on KnpLabs/Gaufrette.

Documentation

Read the official Gaufrette documentation and the documentation for this adapter here.

@akerouanton
akerouanton / cleanup.sh
Created July 2, 2017 23:06
Cleanup Gaufrette buckets
#!/bin/bash
set -o nounset
set -o errexit
# set -o xtrace
buckets=($(aws --profile knplabs s3api list-buckets | awk '{print $3}' | grep gaufrette))
echo "${#buckets[@]} buckets found."
for bucket in ${buckets[@]}
# ldd /usr/bin/wkhtmltopdf
/lib/ld-musl-x86_64.so.1 (0x560c028d2000)
libwkhtmltox.so.0 => /usr/lib/libwkhtmltox.so.0 (0x7fda8f3ee000)
libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x7fda8ec6e000)
libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x7fda8e58a000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7fda8e23a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fda8e027000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x560c028d2000)
libQt5WebKitWidgets.so.5 => /usr/lib/libQt5WebKitWidgets.so.5 (0x7fda8dde8000)
libQt5WebKit.so.5 => /usr/lib/libQt5WebKit.so.5 (0x7fda8c0d0000)

Keybase proof

I hereby claim:

  • I am nir- on github.
  • I am nisr (https://keybase.io/nisr) on keybase.
  • I have a public key ASDpaTxeqpdXZG4BIC7ejeQwZhrogrqaJVBTF572oIaSbwo

To claim this, I am signing this object:

@akerouanton
akerouanton / README.md
Last active August 22, 2017 14:11
wkhtmltopdf - installation guide and frequent issues

wkhtmltopdf - Installation guide and frequent issues

wkhtmltopdf is a rather complex software, with multiple ways of installing it, many dependencies and many options. It's generally hard to find the perfect configuration to get rid of every issues. This document summarizes the way you can install it, frequent issues and how to solve them.

Introduction

Linux

There're currently two versions available in the download section of wkhtmltopdf.org:

  • Stable version (0.12.x), based on a patched version of Qt4, using a pretty old version of WebKit ;