Skip to content

Instantly share code, notes, and snippets.

@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 / 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
_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 / 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' {} \;
#!/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 / 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,
@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 / 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 $_
[Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
## https://bugs.launchpad.net/fwts/+bug/1249978
# **https://ubuntuforums.org/showthread.php?t=1613132**
i915
### ???
realtek: No valid SSID, checking pincfg
### FIXED (overriding)
## https://bugzilla.redhat.com/show_bug.cgi?id=785417
@varhub
varhub / python3_loop_functional.py
Created April 20, 2018 09:40
Python: infinite loop in functional syntax
"""
From Python 3.3, functional programing on top of generators has been reached a new state-level.
Infinite loop without memory footprint with just a `list()` over the magic.
https://stackoverflow.com/questions/13243766/python-empty-generator-function
A new ofuscated way to hide traditional server-loops is here, muajajaja.
"""
def classical_yield():