Skip to content

Instantly share code, notes, and snippets.

View jbq's full-sized avatar

Jean-Baptiste Quenot jbq

View GitHub Profile
@jbq
jbq / calc.py
Created March 13, 2017 13:37
Python Calculator
#! /usr/bin/python3
import unittest
class NegativeNumber(Exception):
pass
class Calculator:
def add(self, numbers: str) -> int:
self.negatives = []
@jbq
jbq / gist:aa7e2b7db56aa2cacd6364b220204889
Created February 15, 2017 16:30
pipeline-stage-view build error
[INFO] Pipeline Stage View Plugin: Parent POM ............. SUCCESS [ 9.067 s]
[INFO] Pipeline: REST API Plugin .......................... SUCCESS [01:41 min]
[INFO] Pipeline: Stage View Plugin ........................ FAILURE [ 30.300 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:22 min
[INFO] Finished at: 2017-02-15T17:29:24+01:00
[INFO] Final Memory: 52M/1422M
[INFO] ------------------------------------------------------------------------
└─(2:15:27:%)(master↑4|✚1…)── dsh pimcore_440 sudo -u www-data php /var/www/pimcore/cli/console.php update -u 4.4.3 ──(Wed,Feb15)─┘
You are going to update to build 4044! Continue with this action? (y/n)y
Starting the update process ...
751/751 [============================] 100%
Update stopped by error! Please check your logs
Last return value was: [2017-02-15 16:57:39] core.ERROR: PDOException: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'reference' in /var/www/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /var/www/vendor/zendframework/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) #1 /var/www/vendor/zendframework/zendframework1/library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array) #2 /var/www/vendor/zendframework/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_S
Cause : <div ng-include="tab.contentUrl">
Version : 1.13.0
Build : 4762574
ESXi : 6.0.0
Navigateur : Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
Pile d'exception :
TypeError: Cannot read property 'supportedDiskControllerList' of undefined
at https://vmware.ubleamops.com/ui/scripts/main.js:368:28244
@jbq
jbq / docker-cleanup
Last active November 2, 2016 09:47 — forked from Dufgui/gist:72debe81068bf3ecd7d8
Script to delete exited containers and untagged/unused images from docker
#! /bin/bash
set -o errexit
echo "Removing exited docker containers..."
docker ps -a -f status=exited -q | xargs -r docker rm -v
# Do not remove dangling images they may still be in use
#echo "Removing dangling images..."
#docker images --no-trunc -q -f dangling=true | xargs -r docker rmi
@jbq
jbq / slack_delete.py
Last active October 28, 2016 11:22 — forked from Paradoxis/slack_delete.py
Delete Slack files via API. Usage: python slack_delete.py --token <apiToken> [-d <olderThanDays>] [-c <maxCount>]
import argparse
import requests
import time
import json
def main():
"""
Entry point of the application
:return: void
@jbq
jbq / registry-usage
Last active June 23, 2016 12:00
Command-line utility to get the disk usage of your private Docker registry. Works like the Linux du command.
#! /usr/bin/env python
import json
import requests
import os.path
import sys
import getopt
import itertools
def format_size(size, unit):
@jbq
jbq / nodejs.sls
Created March 22, 2016 17:40
SaltStack state file for NodeJS
nodejs_repo:
pkgrepo.managed:
- humanname: NodeJS Repo
- name: deb https://deb.nodesource.com/node_5.x trusty main
- file: /etc/apt/sources.list.d/nodesource.list
- keyid: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
- keyserver: keys.gnupg.net
- require_in:
- pkg: nodejs
@jbq
jbq / haproxy.cfg
Last active March 11, 2018 09:30
Haproxy SSL reverse proxy configuration for Docker registry
global
log 127.0.0.1 local0 debug
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
tune.ssl.default-dh-param 2048
defaults
log global
var path = require("path");
module.exports = {
entry: ['./app/scripts/main.js'],
output: {
path: path.resolve(__dirname, 'dist', 'js'),
filename: 'main.js'
},
module: {
loaders: [