Skip to content

Instantly share code, notes, and snippets.

View antoinealb's full-sized avatar

Antoine Albertelli antoinealb

View GitHub Profile
@antoinealb
antoinealb / strat_avoid.c
Created May 14, 2019 17:15
Old obstacle avoidance code from Microb 2009
/*
* Copyright Droids Corporation, Microb Technology (2009)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@antoinealb
antoinealb / catch_sigsegv.c
Created February 19, 2019 14:43
How to catch segmentation faults
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
void myhandler(int signum)
{
printf("got signal %d\n", signum);
exit(1);
}
@antoinealb
antoinealb / keybase.md
Created July 6, 2018 08:54
keybase.md

Keybase proof

I hereby claim:

  • I am antoinealb on github.
  • I am antoinealb (https://keybase.io/antoinealb) on keybase.
  • I have a public key whose fingerprint is 42AE 539A 3A0F F017 E37A 2906 2042 F8B0 8DC9 DBE7

To claim this, I am signing this object:

@antoinealb
antoinealb / goap.py
Created April 24, 2017 22:27
A python implementation of the goap planner
def satisfies_goal(goal, state):
"""
Checks if the given goal is satisfied by the given world state.
"""
for key, value in goal.items():
try:
if state[key] != value:
return False
except KeyError:
return False
import gdb
from collections import namedtuple
THREAD_STATES = [
"READY", "CURRENT", "WTSTART", "SUSPENDED", "QUEUED", "WTSEM", "WTMTX",
"WTCOND", "SLEEPING", "WTEXIT", "WTOREVT", "WTANDEVT", "SNDMSGQ",
"SNDMSG", "WTMSG", "FINAL"]
Thread = namedtuple('Thread', ('r13', 'stklimit', 'name', 'state'))
@antoinealb
antoinealb / README.md
Created January 19, 2016 13:14 — forked from baetheus/README.md
SmartOS Single IP with NAT using VLAN

WARNING

These intructions might work, but they need a bit of attention. I've been reading through ipf and smf documentation and have found a few ways to improve this process. When I have time I'll add that information here, until then, be sure to look into the ipf settings if you're having issues with routing. Good luck!

Foreword

This is a modified version of sjorge's instructions for Single IP with NAT. Those instructions can be found here: https://docu.blackdot.be/snipets/solaris/smartos-nat

The primary difference is that this version does not rely on etherstubs for internal switching, but instead uses a vlan configuration. The benefits of this method over using etherstubs are:

  1. Project Fifo (project-fifo.net) can create vms and zones with vlans, but does not currently have etherstub support.
  2. Vlan switching is supposedly more efficient than creating an etherstub to handle switching. I have not tested this statement.
@antoinealb
antoinealb / slowmo_install.md
Created November 12, 2015 19:53
How to install slowmo on Ubuntu 14.04

#Installing SlowMo on Ubuntu 14.04

##Get the source

git clone https://github.com/slowmoVideo/slowmoVideo.git

##Build it

@antoinealb
antoinealb / trajectories.c
Last active August 29, 2015 14:20
Trajectory tracker
#include <string.h>
#include "trajectories.h"
void trajectory_init(trajectory_t *traj,
float *buffer, int len, int dimension,
uint64_t sampling_time_us)
{
traj->buffer = buffer;
traj->length = len;
traj->dimension = dimension;
@antoinealb
antoinealb / install_notes.markdown
Last active September 20, 2017 00:36
Laptop install

Summary

Needed features

  • Desktop environment, preferably GNOME+XMonad
  • Wifi, preferably using NetworkManager because of user friendlyness.
  • CUPS
  • Sound
  • Web browsing
  • The usual code tools
  • USB3.0, should work out of the box (How to test ?)
  • Main filesystems should be optimized for SSDs
@antoinealb
antoinealb / l4mf.PKGBUILD
Created April 14, 2014 18:51
An arch linux pkbuild for LM4F tool.
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
# for more information on packaging from GIT sources.
# Maintainer: Your Name <youremail@domain.com>
pkgname=lm4f-git