Skip to content

Instantly share code, notes, and snippets.

View taitooz's full-sized avatar
👻
I may be slow to respond.

Emiliano Lourbet taitooz

👻
I may be slow to respond.
  • Despegar
  • La Plata
View GitHub Profile
@taitooz
taitooz / colorizeGit.sh
Created September 3, 2013 15:49
colorizeGit
function color_my_prompt {
local __user_and_host="\[\033[01;32m\]\u@\h"
local __cur_location="\[\033[01;34m\]\w"
local __git_branch_color="\[\033[31m\]"
#local __git_branch="\`ruby -e \"print (%x{git branch 2> /dev/null}.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`"
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`'
local __prompt_tail="\[\033[00m\]$"
local __last_color="\[\033[00m\]"
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color "
}
@taitooz
taitooz / unlockPdf.sh
Created August 7, 2013 02:46
Unlock pdf
#ghostscript
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%stdout% -c .setpdfwrite -f locked.pdf > unlocked.pdf
@taitooz
taitooz / convertEncodeToUtf8.sh
Created July 17, 2013 13:52
Convert latin1 to Utf-8
iconv -f ISO8859-1 -t UTF8 file.sql > file-utf8.sql
@taitooz
taitooz / console_keymap
Created July 15, 2013 18:59
Console keymap
The tools to manipulate the keyboard layout on the virtual consoles are loadkeys, dumpkeys and showkeys. Read their manpages and inform yourself about their intricacies.
Note that these tools only work in a virtual console, not in a terminal emulator in X. Read the answer to this question to learn about the differences.
Here is a short guide to do what you want:
Save your current keyboard layout:
$ dumpkeys > backup.kmap
In case something goes wrong you might be able restore your keymap using the command:
@taitooz
taitooz / PlayAudibleSoundPing.sh
Created July 15, 2013 16:51
Play audible sound when host comes back up.
until ping -c 1 -w 1 10.1.2.3 > /dev/null ; do echo -n ; sleep 1 ; done ; play alert.wav
@taitooz
taitooz / BASH_copyWebWithWget.sh
Created July 2, 2013 12:45
BASH - copy a web with wget
wget -m -F -p -np -k -erobots=off -U mozilla --limit-rate=50K --wait=2 --html-extension http://www.tupaginaweb.com
@taitooz
taitooz / BASH_perlGet
Created June 24, 2013 17:28
BASH perl Get
GET -Used http://localhost:8080/
@taitooz
taitooz / BASH_addUserToSudoers
Created June 20, 2013 19:32
BASH - add user to sudoers
<username> ALL=(ALL) NOPASSWD: ALL
@taitooz
taitooz / BASH_installSublimeText.sh
Created June 20, 2013 18:58
BASH - install sublime text
tar -xvjf Sublime\ Text\ 2.0.1.tar.bz2
mv Sublime\ Text\ 2 /opt/sublime-text-2
sudo mv Sublime\ Text\ 2 /opt/sublime-text-2
ln -s /opt/sublime-text-2/ /usr/local/sublime-text-2
sudo ln -s /opt/sublime-text-2/ /usr/local/sublime-text-2
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
sudo ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
@taitooz
taitooz / BASH_usefulCommands.sh
Created June 18, 2013 13:52
BASH - useful commands
multitail -> to show logs files.
finch -> pidgin for console.
remmina -> admin remote conections.
arandr -> admin displays
smbget -> wget for smb origins (sambatget)
canto -> rss reader
sensors -> info from sensors in bash
tint2 -> lightweight panel
geany -> nice editor
lxpanel -> old school panel