Skip to content

Instantly share code, notes, and snippets.

@varhub
varhub / list_hashes.sh
Created June 9, 2017 17:24
git list_hashes
_pwd=$PWD
find . -name '.git' -type d | while read repo
do
repo_dir=$(dirname $repo)
cd $repo_dir
echo "$(git rev-parse --short HEAD) $(git rev-parse --show-toplevel)"
#echo -e "$(git rev-parse --show-toplevel) \t $(git rev-parse HEAD)"
cd $_
@varhub
varhub / dronecampeones_run_test.sh
Created March 23, 2016 20:23
The runner for single command execution of dronecampeones trainning test.
#!/bin/sh
#
# Copyright (c) 2016
# Author: Victor Arribas <v.arribas.urjc@gmail.com>
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.html>
if pgrep gzserver || pgrep gzclient
then
killall gzserver
@varhub
varhub / perspective.py
Last active March 16, 2016 14:45
Perspective correction demo
#
# Copyright (C) 2015 Victor Arribas
# Copyright (C) 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,
#!/bin/sh
#
# Copyright (c) 2016
# Author: Victor Arribas <v.arribas.urjc@gmail.com>
# License: GPLv3 <http://www.gnu.org/licenses/gpl-3.0.html>
## Download practices' container
wget -nc https://github.com/RoboticsURJC/JdeRobot-TeachingRobotics/archive/master.zip
unzip -q master.zip
@varhub
varhub / find_multiple_rename
Created January 14, 2016 21:39
Linux - Change extension of multiple files at once on Linux
# find files bigger than 100Mb. If match .log extension, rename it to .bigfile
find log/ -type f -size +100M -exec rename -v 's/\.log$/\.bigfile/i' {} \;
_GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH
BASE=$HOME/git/build.d/JdeRobot-sandbox/src/gazebo_plugins
BASE=$HOME/git/build.d/JdeRobot/src/stable/components/gazeboserver/plugins
GAZEBO_PLUGIN_PATH=$BASE/quadrotor2:$BASE/flyingKinect2:$_GAZEBO_PLUGIN_PATH
export GAZEBO_PLUGIN_PATH
@varhub
varhub / add_to_ignore.sh
Last active December 5, 2015 10:42
A script to simplify gitignore population
#!/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:
# add_to_ignore.sh https://github.com/github/gitignore/blob/master/C++.gitignore
set -e
@varhub
varhub / GIT_by_example-multiple_gitignores.txt
Created November 8, 2015 12:40
GIT by example: multiple gitignores
varribas@Ubuntu14lts:/tmp/gitignore-test$ git --version
git version 1.9.1
varribas@Ubuntu14lts:/tmp$ mkdir gitignore-test
varribas@Ubuntu14lts:/tmp$ cd gitignore-test/
varribas@Ubuntu14lts:/tmp/gitignore-test$ git init .
Initialized empty Git repository in /tmp/gitignore-test/.git/
varribas@Ubuntu14lts:/tmp/gitignore-test$ mkdir -p a/b b c
varribas@Ubuntu14lts:/tmp/gitignore-test$ touch a/A a/b/B b/B c/C
varribas@Ubuntu14lts:/tmp/gitignore-test$ git add .
@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
#
@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>