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 / fearme.out
Created February 14, 2019 03:44
ansible-compose
14/02 2019 04:39:23 jpic@jpic ~/src/ansible-compose (master)
$ ansible-compose [email protected]/home/jpic/bar stop
Running ssh [email protected] bash -euxc 'cd /home/jpic/bar; docker-compose stop'
+ cd /home/jpic/bar
+ docker-compose stop
@jpic
jpic / ObsceneAnsible
Created September 29, 2018 04:16
Help displays without argument for the playlabs command
29/09 2018 06:13:36 jpic@jpic ~/src/playlabs/playlabs/inventory_template (master)
$ playlabs
Playlabs: the obscene ansible distribution.
Init your ssh user with your key and secure sshd and passwordless sudo:
playlabs init [email protected]
# all options are ansible options are proxied
playlabs init @somehost --ask-become-pass
@jpic
jpic / import_callback.py
Created August 28, 2018 16:54
Import any python callback
"""
Currently with django we can only import an attribute from a module, not a sub-attribute. For example
import_string('foo.models.YourModel') # works
import_string('foo.models.YourModel.objects.update_stats') # doesn't
This snippet fixes that, originally for django-call which has tests.
@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 ;
}