Skip to content

Instantly share code, notes, and snippets.

View jpic's full-sized avatar
💾
Searching for my Monkey Island II floppy disks

Yacht Shaver jpic

💾
Searching for my Monkey Island II floppy disks
View GitHub Profile
@jpic
jpic / uwsgi_spooler.py
Last active August 23, 2018 00:24
generic uwsgi spooler minimal wrapper poc, base of django-uwsgi-spooler (halted) and django-call (ongoing)
from importlib import import_module
import pickle
from uuid import uuid4
try:
from uwsgi import SPOOL_OK
except ImportError:
SPOOL_OK = True
try:
class NameAdapter(StringAdapter):
# steps always executed in clean clone !
def validate(self):
if allcaps(self.data):
self.errors.append('omg poney')
def clean(self):
self.data = self.data.capitalize()
@jpic
jpic / drone.yml
Created January 5, 2018 18:21
setup drone with ansible
---
- name: Create drone network
docker_network:
name: drone
- name: Drone server
docker_container:
name: drone-server
image: drone/drone:0.8.2
@jpic
jpic / liremoi.rst
Last active December 9, 2017 02:13
Peut etre a opensourcer ?

Ce répo contient les playbooks d'infra de MRS, normalement on a rien de compliqué: ssh, firewall, backups et dockerd + containers, et quelques ptits potes qu'on a invité à la fête.

Ce répo de playbooks est prévu pour être utilisé avec votre répo privé qui contient les variables de vos environnements.

Un environnement est configuré dans des fichiers comme:

  • group_vars/all/docker-vars.yml: variables publiques pour docker, etc
@jpic
jpic / docker-dns-gen.yml
Created December 8, 2017 02:28
Install docker-dns-gen on Ubuntu artful
---
- hosts: all
become: true
become_method: sudo
become_user: root
handlers:
- name: Restart
notify: Restart dnsmasq
@jpic
jpic / zabbix.yml
Created December 3, 2017 18:26
ansible docker zabbix dockbix, not maintained, pasted here for posterity
---
- hosts: all
become: true
become_method: sudo
become_user: root
tasks:
- name: Create zabbix network
@jpic
jpic / xymon-nginx-ubuntu.conf
Created September 4, 2017 09:18
Xymon behind Nginx on ubuntu, requires fcgiwrap to be started
server {
listen 80;
server_name xymon.bd.yourlabs.org;
auth_basic "Admin-Section";
auth_basic_user_file /etc/nginx/.htpasswd;
location /xymon/ {
alias /usr/lib/xymon/server/www/ ;
index index.html ;
}
@jpic
jpic / crispy_form.html
Last active April 17, 2017 01:56
django rest framework django autocomplete light django filter
{# in templates/django_filters/rest_framework/crispy_form.html ensure you load jquery.js #}
{% load i18n %}
{% load crispy_forms_tags %}
{% load static %}
<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script>
<h2>{% trans "Field filters" %}</h2>
{% crispy filter.form %}
@jpic
jpic / .travis.yml
Created April 5, 2017 23:00
PhantomJS 2.1.1 Travis-CI recipe
before_script:
- set -eux;
export PHANTOMJS_VERSION=2.1.1;
phantomjs --version;
export PATH=$HOME/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH;
phantomjs --version;
if [ "$(phantomjs --version)" != "$PHANTOMJS_VERSION" ]; then
rm -rf $HOME/travis_phantomjs;
mkdir -p $HOME/travis_phantomjs;
if [ ! -f $HOME/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 ]; then
@jpic
jpic / build.sh
Created February 28, 2017 16:32
"Readable" and "idempotent" OCI container build script PoC for Arch Linux and Python
#!/bin/bash
set -ex
BUILD_DIR=.build
ROOTFS_DIR=$BUILD_DIR/image/rootfs
STATE_DIR=$BUILD_DIR/state
mkdir -p $BUILD_DIR $ROOTFS_DIR $STATE_DIR
cp $BUILD_DIR/templates/config.json $ROOTFS_DIR/../