Skip to content

Instantly share code, notes, and snippets.

View AlexandreRio's full-sized avatar

Alexandre Rio AlexandreRio

View GitHub Profile
@AlexandreRio
AlexandreRio / .bashrc
Created November 18, 2012 18:07
My configuration files
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
[ -z "$PS1" ] && return
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
HISTCONTROL=ignoreboth
shopt -s histappend
@AlexandreRio
AlexandreRio / build_gen.sh
Created April 24, 2013 09:50
Generate a build.xml file for ant to generate javadoc from all the subdir containing src directory and java source files.
#!/bin/bash
FILE="build.xml"
echo -e "<project name=\"Ant build generator\" default=\"doc\">\n\n\t<property name=\"src.dir\" value=\".\"/>\n\t<property name=\"doc.dir\" value=\"doc\"/>" > $FILE
echo -e "<target name=\"doc\" description=\"Generates \${ant.project.name}'s Javadoc.\">\n\t<javadoc destdir=\"\${doc.dir}\" author=\"true\" version=\"true\">" >> $FILE
for line in `find -type d -name 'src'`; do echo -e "<fileset dir=\""$line"\" defaultexcludes=\"no\">\n\t<include name=\"**/*.java\"/>\n</fileset>">>$FILE; done;
echo -e "\t\t</javadoc>\n\t</target>\n</project>" >> $FILE
@AlexandreRio
AlexandreRio / .tint2rc
Last active December 17, 2015 14:58
tint2 conf file
#---------------------------------------------
# TINT2 CONFIG FILE
#---------------------------------------------
#
#---------------------------------------------
# BACKGROUND AND BORDER
#---------------------------------------------
rounded = 1
border_width = 1
background_color = #000000 10
@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;
@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 / 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 / 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
#!/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 / 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##*/}
@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