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
@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
@AlexandreRio
AlexandreRio / display.sh
Last active December 18, 2015 03:39
Manage multiple screen display for chipset GPU.
#!/bin/bash
xrandr --auto
if [ -n "$1" ] && [ $1 == "--vertical" ]; then
xrandr --output VGA1 --left-of LVDS1
xrandr --output VGA1 --rotate right
elif [ -n "$1" ] && [ $1 == "--above" ]; then
xrandr --output VGA1 --above LVDS1
else
xrandr --output VGA1 --left-of LVDS1 --rotate normal
fi
@AlexandreRio
AlexandreRio / .pentadactylrc
Last active December 17, 2015 14:58
Firefox plugin Pentadactyl config file
"hg6928
loadplugins '\.(js|penta)$'
group user
command! -nargs=+ -description='Twitter client through ttytter.pl' twitter ! ~/scripts/ttytter.pl -status="<args>"
highlight Boolean color: #ffa0a0;
highlight CompDesc color: #c6c6c6; width: 50%; font-weight: normal !important;
highlight CompItem[selected] color: #f0e685; background: #6b8e23;
highlight CompTitle color: #78cee4 !important; background: #000000 !important;
highlight Disabled color: #bb493b;