Skip to content

Instantly share code, notes, and snippets.

View txomon's full-sized avatar

Javier Domingo Cansino txomon

  • Germany/Koln, UK/London, Spain/Bilbao
View GitHub Profile
@txomon
txomon / gist:9098779
Last active August 29, 2015 13:56
main.c
/*
* main implementation: use this 'C' sample to create your own application
*
*/
#define PE_MCUINIT
#include "constantes.h"
#include <stdio.h>
//#include "MCUinit.h"
//#include <Driver_SLCD.h>
@txomon
txomon / bug.py
Created June 11, 2014 08:04
Found and error in the mock framework
import mock
def function_badly_called(boolean, integer):
return (boolean, integer)
def function_under_test(integer, boolean):
a,b = (integer, boolean)
function_badly_called(a,b)
function_badly_called = mock.MagicMock()
@txomon
txomon / gist:4a592aaca14ff09c9b0e
Created June 11, 2014 16:26
Mock's _Call's __eq__ method
def __eq__(self, other):
if other is ANY:
return True
try:
len_other = len(other)
except TypeError:
return False
self_name = ''
if len(self) == 2:
@txomon
txomon / buildroot-cmd
Created June 29, 2014 14:16
Buildroot build command
PATH="/home/javier/proyectos/master/master-sce/buildroot/output/host/bin:/home/javier/proyectos/master/master-sce/buildroot/output/host/sbin:/home/javier/proyectos/master/master-sce/buildroot/output/host/usr/bin:/home/javier/proyectos/master/master-sce/buildroot/output/host/usr/sbin:/home/javier/.gvm/pkgsets/go1.2/global/bin:/home/javier/.gvm/gos/go1.2/bin:/home/javier/.gvm/pkgsets/go1.2/global/overlay/bin:/home/javier/.gvm/bin:/home/javier/.gvm/bin:/home/javier/go/bin:/home/javier/bin:/home/javier/.rvm/gems/ruby-2.1.2/bin:/home/javier/.rvm/gems/ruby-2.1.2@global/bin:/home/javier/.rvm/rubies/ruby-2.1.2/bin:/home/javier/go/bin:/home/javier/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/javier/.rvm/bin" /usr/bin/make -j9 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm INSTALL_MOD_PATH=/home/javier/proyectos/master/master-sce/buildroot/output/target CROSS_COMPILE=" /home/javier/proyectos/master/master-sce/buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-" DEPMOD=/home/javier/proye
@txomon
txomon / authorized_keys.j2
Created September 7, 2014 09:30
Ansible user role for ssh authorized_keys management
{%- for user in users %}
{%- if user_groups | intersect(user.groups) %}
# {{ user.realname }}
{% for key in user.ssh_keys %}
{{ key.key }}
{% endfor %}
{%- endif %}
{%- endfor %}
@txomon
txomon / utox
Last active August 29, 2015 14:10
uTox coredump
@txomon
txomon / 0001-no-security-allows-dhcp-server.patch
Created January 15, 2015 20:05
Dirty neutron patch for enabling DHCP server when port isn't in security groups
diff --git a/neutron/agent/linux/iptables_firewall.py b/neutron/agent/linux/iptables_firewall.py
index 33793a0..5bb570e 100644
--- a/neutron/agent/linux/iptables_firewall.py
+++ b/neutron/agent/linux/iptables_firewall.py
@@ -343,7 +343,7 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
security_group_rules)
ipv4_iptables_rule = []
ipv6_iptables_rule = []
- if direction == EGRESS_DIRECTION:
+ if direction == EGRESS_DIRECTION and port.get('security_groups'):
@txomon
txomon / gist:06ee306ecff4f29285bf
Created February 12, 2015 15:23
Define error (if you run into this, the problem is the -DPACKAGE and it's ifndef in muzzley/muzzley.h)
$ g++ -DPACKAGE_NAME=\"amz\" -DPACKAGE_TARNAME=\"amz\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"amz\ 0.0.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"amz\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_LIBMUZZLEY=1 -DQCC_OS_GROUP_POSIX=1 -DQCC_OS_LINUX=1 -I. -I../include -I../inc-test -std=gnu++0x -fexceptions -fpermissive -Wno-error -D_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC -DQCC_CPU_X86 -DQCC_CPU_X86_64 -I/usr/include/libxml2 -pthread -I/usr/include/gupnp-1.0 -I/usr/include/gssdp-1.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/uuid -I/usr/local/alljoyn-14.12/include -g -O2 -MT amz-alljoyn_muzzley_connector.o -MD -MP -MF .deps/amz-alljoyn_muzzley_connector.Tpo -c -o amz-alljoyn_muzzley_c
@txomon
txomon / proposal.wiki
Last active August 29, 2015 14:19
Allseen repository and release proposal

https://wiki.allseenalliance.org/core/packaging_proposal_v1

AllJoyn package release and maintenance process proposal v1

Alljoyn framework is a set of projects where each one follows it's own release cadence. There are major versions of the Core functionality, and the rest of the projects release on their own convenience for those versions afterwards.

This proposal aims to ease the involment of both the comunity and non-leader companies within the development and the release process.

State of the process and flaws
(function(__global) {
var tmp0,
tmp1;
tmp1 = function() {
var self,
tmp2,
tmp3,
tmp4,
tmp1480;
self = this;