Skip to content

Instantly share code, notes, and snippets.

View AlexandreRio's full-sized avatar

Alexandre Rio AlexandreRio

View GitHub Profile

Keybase proof

I hereby claim:

  • I am AlexandreRio on github.
  • I am alexrio (https://keybase.io/alexrio) on keybase.
  • I have a public key whose fingerprint is ABC1 A030 CC0A D4FD F752 0D5A DBD4 DB8F FA5A DD70

To claim this, I am signing this object:

@AlexandreRio
AlexandreRio / Arduino_test.sh
Created March 16, 2016 08:45
Compile ThingML test to ThingML file then compile it and run on an Arduino
#!/bin/bash
LIB="$HOME/SINTEF/lib-arduino/"
TMP="/tmp/"
for testFile in `find . -name 'test_*.thingml'`; do
compilerThingML.sh -t testconfigurationgen -s $testFile --options arduino > /dev/null
done
cd _arduino
@AlexandreRio
AlexandreRio / arduino.txt
Created March 3, 2016 12:40
Arduino build flag
/usr/bin/ano preproc --source-dir src -o .build_ano/uno/src/ard_cep.cpp src/ard_cep.ino
Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt
Detecting Arduino software version ... 1.0.6 (1.0.6)
/usr/bin/avr-gcc -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=106 -DARDUINO_ARCH_AVR
-ffunction-sections -fdata-sections -g -Os -w
-I/usr/share/arduino/hardware/arduino/cores/arduino
-I/usr/share/arduino/hardware/arduino/variants/standard
-I/usr/share/arduino/hardware/arduino/cores/arduino
-I/usr/share/arduino/hardware/arduino/cores/arduino/avr-libc
@AlexandreRio
AlexandreRio / arduino.sh
Last active February 10, 2016 09:28
Wrapper around ino (inotools) to build and upload arduino firmware
#!/bin/bash
# requirements: ano, picocom, dmenu...
LIB="$HOME/SINTEF/lib-arduino/"
SOURCE=`find $PWD -name '*.pde' | xargs ls -1t | dmenu -l 10`
if [ -z $SOURCE ] ; then
echo "Canceling build"
else

Keybase proof

I hereby claim:

  • I am alexandrerio on github.
  • I am alexrio (https://keybase.io/alexrio) on keybase.
  • I have a public key whose fingerprint is 742A E2C0 C310 4964 0783 DCD8 CDCC 2463 0F46 6888

To claim this, I am signing this object:

@AlexandreRio
AlexandreRio / .bashrc
Created January 29, 2014 17:44
Git PS1 for bash
#On fedora __git_ps1 is not in git_completion.sh
if [ -f /usr/share/git-core/contrib/completion/git-prompt.sh ]; then
. /usr/share/git-core/contrib/completion/git-prompt.sh
fi
function set_bash_prompt {
PS1="\[$IGreen\]\u \[$Blue\]\w \[$Color_Off\]$(__git_ps1 '(%s)') > "
}
PROMPT_COMMAND=set_bash_prompt
@AlexandreRio
AlexandreRio / flacToMP3
Last active January 4, 2016 02:59 — forked from SyBen/flacToMP3
#!/bin/bash
#License CC-BY-NC-SA for the code.
#This script converts all flac files in a directory into 320kpbs mp3 files, and then move them into another directory,
#set as the first argument. The occurences of words Flac and FLAC will be replace in the name of the working director.y
#considering wd is /path/nameOfDirectory-FLAC, the new directory will be $1/nameOfDirectory-mp3.
#Needs 1 parameter : the path to save the directory containing the mp3 files.
if [ $# -eq 1 ]; then
currentPath=`pwd`
currentFolder=${currentPath##*/}
#!/bin/bash
#License CC-BY-NC-SA for the code.
#This script converts all flac files in a directory into 320kpbs mp3 files, and then move them into another directory,
#set as the first argument. The occurences of words Flac and FLAC will be replace in the name of the working director.y
#considering wd is /path/nameOfDirectory-FLAC, the new directory will be $1/nameOfDirectory-mp3.
#Needs 1 parameter : the path to save the directory containing the mp3 files.
if [ $# -eq 1 ]; then
currentPath=`pwd`
currentFolder=${currentPath##*/}
@AlexandreRio
AlexandreRio / shell_color.sh
Created December 19, 2013 15:51
Display every shell color
#!/bin/bash
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done
@AlexandreRio
AlexandreRio / addSpammer.sh
Created October 10, 2013 22:04
Bind a key in Mutt to add new rule for imapfilter from email sender
#!/bin/bash
read "$@" <&0;
grep From: |
sed 's/>//g' |
cut -d '<' -f 2 >> ~/.mail_config/filters/spamer.list 2>&1