Skip to content

Instantly share code, notes, and snippets.

@varhub
varhub / issue-extractor.sh
Last active August 29, 2015 14:15
JdeRobot issue population (1/2): an script to extract possible issues from history.
#!/bin/sh
set -e
set -u
GREP_ISSUE_NUMBER='[#\[][0-9][0-9]*'
SEPARATOR='\t\t\t'
# retrive full log
git log --full-history --all --oneline --pretty=tformat:"%s" > git.messages
@varhub
varhub / issue-push.sh
Last active August 29, 2015 14:15
JdeRobot issue population (2/2): script for push previous generated issues.
#!/bin/sh
set -e
# Change it to fit your repository!
GITHUB_USER=varhub
GITHUB_REPO=JdeRobot
TWICE=$1
@varhub
varhub / terminal-invoker.sh
Created February 23, 2015 21:52
A simple terminal invoker. Perfect for single session environment, such as **forwarded ssh** or **chroot**
#!/bin/sh
# Terminal invoker
xterm -T "Terminal launcher" -geometry 40x3+0+0 -e '
while true
do
echo "Press Ctrl+C for a complete exit"
echo "Press enter to open a new console ;)"
read
x-terminal-emulator &
@varhub
varhub / jderobot-init.env
Created February 28, 2015 13:01
JdeRobot dev env setup (source it!)
# push into 'isolated' workspace
echo $HOME | grep -q $(pwd) || export HOME=$(pwd)
# setup gazebo env
. /usr/local/share/jderobot/gazebo/gazebo-setup.sh
# for chroot envs...
[ -z $DISPLAY ] && export DISPLAY=:0
@varhub
varhub / jderobot-post-install.sh
Created September 2, 2015 14:18
JdeRobot post-install step: config files injection into Gazebo
#!/bin/sh
# This script injects JdeRobot requirements into Gazebo user settings.
# This step should be done *once* installed. But also each time you
# fetch and compile newest code in order to update these files.
# Notice that cp `-f` could be mandatory instead.
# State: beta.
# Inject cfg files (=Ice configs)
mkdir -p ~/.gazebo/cfg
@varhub
varhub / hello_drone.py
Last active September 7, 2015 12:58
Hello Drone example for JdeRobot/ArDrone
#
# Copyright (C) 1997-2015 JDE Developers Team
#
# 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 3 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
@varhub
varhub / decoration_example.py
Last active September 10, 2015 12:35
Example of how to use decorators
## Public Domain
# Victor Arribas <v.arribas.urjc@gmail.com>
def deco(fn):
def wrapper(*args, **kwargs):
print 'wrapped'
fn(*args, **kwargs)
return wrapper
@deco
@varhub
varhub / schroot-jump.sh
Created November 1, 2015 17:46
shcroot wrapper to allow bootstrap from specified directory
#!/bin/sh
#
# Copyright (c) 2015
# Author: Victor Arribas <v.arribas.urjc@gmail.com>
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.html>
# Usage
if [ -z "$1" ]; then
echo "Little script to launch an SCHROOT throught a specific workspace"
@varhub
varhub / generate_code.cpp
Last active November 3, 2015 13:09
Related to JdeRobot #211
/* Code example related to
https://github.com/RoboticsURJC/JdeRobot/issues/211
Additional docs:
- http://www.boost.org/doc/libs/1_59_0/libs/format/doc/format.html
- http://studiofreya.com/cpp/a-few-boostformat-examples/
*/
#include <iostream>
#include <boost/format.hpp>
@varhub
varhub / ardrone_connect_to.sh
Last active November 3, 2015 13:17
Bash script to connect to ARDrone wifi. No more interaction with ugly Ubuntu GUI.
#!/bin/sh
#
# Copyright (c) 2015 Victor Arribas Raigadas
#
# This software is under GPL3 Lincense.
# You could get a copy at http://www.gnu.org/licenses/gpl-3.0.html
#
# Requires:
# * NetworkManager >= 0.96
#