Skip to content

Instantly share code, notes, and snippets.

View blaggacao's full-sized avatar
🚩
Working on an (ad)venture

David Arnold blaggacao

🚩
Working on an (ad)venture
View GitHub Profile
@blaggacao
blaggacao / run.py
Last active May 30, 2016 12:26
run file for testing
import cStringIO as StringIO
from PIL import Image
with open('/testimage.png', 'rb') as f:
data = f.read()
image_stream = StringIO.StringIO(data)
image = Image.open(image_stream)
image.load()
@blaggacao
blaggacao / valgrind.log
Created May 30, 2016 17:05
Valgrind Alpine Segfault Log
==1== by 0x5355035: PyEval_EvalFrameEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x535BAAD: PyEval_EvalCodeEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x52FFFF9: ??? (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x52E3653: PyObject_Call (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x535B2DD: PyEval_EvalFrameEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x535BAAD: PyEval_EvalCodeEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x5359E1A: PyEval_EvalFrameEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x535BAAD: PyEval_EvalCodeEx (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x52FFFF9: ??? (in /usr/lib/libpython2.7.so.1.0)
==1== by 0x52E3653: PyObject_Call (in /usr/lib/libpython2.7.so.1.0)
@blaggacao
blaggacao / Dockerfile
Created May 31, 2016 03:44
Creation of a python debug symbols build
# --- Build Debug Liraries for GDB Debugging ---
ENV CFLAGS='-Wall -O0 -g'
RUN apk add --update alpine-sdk \
&& adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder \
&& echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& mkdir /packages \
&& chown builder:abuild /packages \
&& git clone --depth 1 git://dev.alpinelinux.org/aports \
&& abuild-keygen -a -i \
&& cd aports/main/python
@blaggacao
blaggacao / my_first_cordeump.dump
Created June 1, 2016 06:15
Coredump after segfoult near Pillow on alpine (musl)
2016-06-01 06:03:25,474 13 DEBUG test3 PIL.PngImagePlugin: STREAM tIME 80 7
2016-06-01 06:03:25,475 13 DEBUG test3 PIL.PngImagePlugin: tIME 80 7 (unknown)
2016-06-01 06:03:25,475 13 DEBUG test3 PIL.PngImagePlugin: STREAM IDAT 99 7809
Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 32]
0x00007ffff7a9b073 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
(gdb) bt
#0 0x00007ffff7a9b073 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#1 0x00007ffff7aa2aae in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
[10:19:33.807][VpnKit ][Info ] com.docker.slirp.exe: Created instance tcp:0.0.0.0:10000:tcp:172.17.0.7:10000
[10:19:34.347][VpnKit ][Debug ] com.docker.slirp.exe: tcp:0.0.0.0:12900:tcp:172.17.0.16:12900: closing listening socket
[10:19:34.403][VpnKit ][Debug ] com.docker.slirp.exe: tcp:0.0.0.0:9000:tcp:172.17.0.16:9000: closing listening socket
[10:19:35.402][VpnKit ][Debug ] com.docker.slirp.exe: udp:0.0.0.0:4500:udp:172.17.0.3:4500: closing listening socket
[10:19:35.409][VpnKit ][Error ] com.docker.slirp.exe: udp:0.0.0.0:4500:udp:172.17.0.3:4500: shutting down recvfrom thread: Uwt.Uwt_error(Uwt.ECANCELED, "uwt_udp_recv", "")
[10:19:35.412][VpnKit ][Debug ] com.docker.slirp.exe: udp:0.0.0.0:4500:udp:172.17.0.3:4500: shutting down from vsock thread: End_of_file
[10:19:35.463][VpnKit ][Debug ] com.docker.slirp.exe: udp:0.0.0.0:500:udp:172.17.0.3:500: closing listening socket
[10:19:35.468][VpnKit ][Error ] com.docker.slirp.exe: udp:0.0.0
atlantic812:~/rancher# cat docker-compose.yml
version: "2"
services:
rancher-server:
image: rancher/server:stable
restart: unless-stopped
command: ["--db-host", "104.xyz.xyz.xyz", "--db-port", "3306", "--db-name", "cattle", "--db-user", "cattle", "--db-pass", "ERASED"]
environment:
ports:
@blaggacao
blaggacao / server.py
Created November 8, 2017 16:43
Maintenance Worker
class WorkerMaintenance(WorkerCron):
def __init__(self, multi):
super(WorkerMaintenance, self).__init__(multi)
self.watchdog_timeout = multi.maintenance_timeout
def process_work(self):
rpc_request = logging.getLogger('odoo.netsvc.rpc.request')
rpc_request_flag = rpc_request.isEnabledFor(logging.DEBUG)
_logger.debug("WorkerMaintenance (%s) polling for install/updates", self.pid)
@blaggacao
blaggacao / model.js
Created November 14, 2017 23:39
pos fp fix
point_of_sale: [FIX] fp map to empty tax
Before this commit, `_map_tax_fiscal_position` could map to undifined, if the
target tax was empty (a valid use case, in other words: "remove").
This commit filters or validates the mapping result in order to take care of the
undifined returns. As it is construed as a mapping function, we cannot take
care within the function itself but must handle it in downstream code.
@blaggacao
blaggacao / maquila.py
Last active November 19, 2017 20:29
Maquila for third party
# -*- coding: utf-8 -*-
# Copyright 2017, XOE Corp.
# XOE Enterprise Edition License v1.0.
from odoo import models, fields, api, _ # noqa
class MrpSettings(models.TransientModel):
_inherit = 'mrp.config.settings'
group_mrp_maquila = fields.Boolean('Manage maquila for third parties', implied_group='mrp_maquila.group_mrp_maquila')
@blaggacao
blaggacao / gist:f180ea5db4f20e563973f6e372eab67e
Created December 5, 2017 23:00
pos_variant limit problem
get_product_by_category: function(category_id){
var product_ids = this.product_by_category_id[category_id];
var list = [];
var tmpl_list = [];
if (product_ids) {
for (var i = 0, len = Math.min(product_ids.length, this.limit); i < len; i++) {
var product = this.product_by_id[product_ids[i]];
if (!tmpl_list.includes(product.product_tmpl_id)) {
list.push(product);
tmpl_list.push(product.product_tmpl_id);