Happy Halloween archers =)

Arch rocks!

BufferMenu+: an enhanced BufferMenu for Emacs

I’m happy to announce my first contribution to the AUR in the form of a helper mode for Emacs.
BufferMenu+ brings some interesting features to the buffer-menu routine like adding a new “size” column, fancy colored columns (makes it easier to work with the buffer menu), the ability to sort buffers by any column criteria and the ability to choose the default column for sorting buffers among other interesting things.
More info here: AUR:emacs-buffmenu+
Special thanks goes to @falconindy for helping me get this working.

Recent files in Emacs

I think you will be glad to add this mode to your ~/.emacs file if you use Emacs as your primary text editor or IDE:
;Enable recentf (recent files mode)
;M-x recentf-mode
(require ‘recentf)
(recentf-mode 1)
(global-set-key (kbd “C-x C-g”) ‘recentf-open-files)
;If you make extensive use of Tramp, recentf will track those files too, and do it’s periodic cleanup thing which can be a real mess since the files are remote. Prevent this by putting this in your startup file:
(setq recentf-auto-cleanup ‘never)

This way every time you need to access an often used file just press C-x C-g.
Of course this can be mapped to anywhere else – and I’m sure C-x C-d is far convenient, but as I like to keep things vanilla because this easies to work on different systems not owned by me I prefer to bind recentf-mode to an unused key combination.



I love this picture from Revolution OS

With Free Software you have Freedom

Time to relax

If you ever has surfed then there’s nothing much to say about this song – you will feel like if you’re sitting on your board enjoying a gentle splash and swaying while you wait for the next wave, living a magical moment.
If you never surfed before I’m confident you will too enjoy this song and I hope the feeling you’ll get from it will push you to grab a surfboard, hit the ocean and enjoy being alive.
Pura Vida Surfing!!!

HP Pavilion dv7-4287cl

Some days ago I got a brand-new machine but it wasn’t until yesterday I could finally make it work in a decent way mainly because of the “hybrid” video card system (Intel/ATi) – since this is the first notebook on which I install Arch I’m still lighting the dark corners, expect to have more info in the next days and possibly write a wiki page at Arch about it.

Optimizations / Optimizaciones

Levante la mano el que luego de reinstalar el SO se acordó de exactamente todos los tweaks que fue haciendo en su sistema a lo largo del tiempo… ¡hum! ¡nadie que use distros rolling-release! jejeje. Si hay algo odioso de tener que reinstalar una rolling-release es tener que tweakearla nuevamente a fondo para dejarla como la teníamos, porque seamos sinceros: ¿cuántos de Uds. backupean seguido sus archivos de configuración? Hablo en serio: ¿cuántos de Uds. guardan varias versiones del mismo archivo para ir rotándolas a lo largo del tiempo en por lo menos tres lugares distintos? Ok, lo que suponía, bienvenidos al club!! :D

Aunque regularmente realizo backups de /boot y / y ~/.{varios} (tengo /home y /tmp en discos y particiones diferentes)  no viene mal tener una copia más de resguardo en el blog y además poder compartirla con otros usuarios a los que quizás les sirva algo de todo esto, así que sin más preámbulo empiezo:


~ $ cat .bash_profile
term3=$(echo $(/usr/bin/tty | cut -d “/” -f3));
term4=$(echo $(/usr/bin/tty | cut -d “/” -f4));

# Parseamos el archivo de configuración del usuario
. $HOME/.bashrc

# Chequeamos que la sesión se inicia en una terminal de texto y que TMUX no está
# corriendo e iniciamos TMUX automáticamente
if [ -z "$DISPLAY" ] && [ -z "$TMUX" ] ; then tmux; fi;

# Chequeamos si el entorno gráfico está corriendo, si no es así
# lo iniciamos
if [[ $term4 -eq 0 ]] && [[ ! -e "/tmp/.X0-lock" ]]; then
echo -n “Iniciando entorno gráfico en 5 segundos… “;
until [  $contador -eq 0 ]; do
sleep 1; echo -n $contador”, “;
let contador-=1
sleep 1;
echo $(tput bold)$(tput setaf 7)”ahora!”$(tput sgr0); sleep 1;



~ $ cat .bashrc

#———– Definición de variables

#txtblk=’\e[0;30m' # Black - Regular
#txtred='\e[0;31m' # Red
#txtgrn='\e[0;32m' # Green
#txtylw='\e[0;33m' # Yellow
#txtblu='\e[0;34m' # Blue
#txtpur='\e[0;35m' # Purple
#txtcyn='\e[0;36m' # Cyan
txtwht='\[$(tput sgr0)\]\[$(tput setaf 7)\]‘ # White

#[ Bold / Negrita ]
bldblk=’\[$(tput bold)\]\[$(tput setaf 0)\]‘ # Black
bldred=’\[$(tput bold)\]\[$(tput setaf 1)\]‘ # Red
bldgrn=’\[$(tput bold)\]\[$(tput setaf 2)\]‘ # Green
bldylw=’\[$(tput bold)\]\[$(tput setaf 3)\]‘ # Yellow
bldblu=’\[$(tput bold)\]\[$(tput setaf 4)\]‘ # Blue
bldpur=’\[$(tput bold)\]\[$(tput setaf 5)\]‘ # Purple
bldcyn=’\[$(tput bold)\]\[$(tput setaf 6)\]‘ # Cyan
bldwht=’\[$(tput bold)\]\[$(tput setaf 7)\]‘ # White

#unkblk=’\e[4;30m' # Black - Underline
#undred='\e[4;31m' # Red
#undgrn='\e[4;32m' # Green
#undylw='\e[4;33m' # Yellow
#undblu='\e[4;34m' # Blue
#undpur='\e[4;35m' # Purple
#undcyn='\e[4;36m' # Cyan
#undwht='\e[4;37m' # White

#bakblk='\e[40m'   # Black - Background
#bakred='\e[41m'   # Red
#badgrn='\e[42m'   # Green
#bakylw='\e[43m'   # Yellow
#bakblu='\e[44m'   # Blue
#bakpur='\e[45m'   # Purple
#bakcyn='\e[46m'   # Cyan
#bakwht='\e[47m'   # White

txtrst='\[$(tput sgr0)\]‘    # Text Reset

#———– Comienzo configuración personalizada

#function files_size {

#tput bold; tput setaf 2;
#echo -n “(“; tput setaf 7;
#echo -n $(/bin/ls -1 | /usr/bin/wc -l | /bin/sed ‘s: ::g’); echo -n ” archivo(s), “;
#tput setaf 3;
#echo -n $(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed ‘s/total //’)b;
#tput setaf 2;
#echo “)”;


# Con reloj
#PS1=”\n${bldgrn}(${txtwh8}\u@\h en ${bldpur}tty\$(echo $((/usr/bin/tty | /bin/sed -e ‘s:/dev/::’) | cut -d “/” -f2))${bldgrn})-(${bldwht}jobs:\j${bldgrn})-(${txtwh8}\A \d${bldgrn})\n(${bldcyn}\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed ‘s: ::g’) archivo(s), ${bldylw}\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed ‘s/total //’)b${bldgrn}) ${bldwht}\w ${txtwh8}$ ${txtrst}”
#PS1=”${bldgrn}(${txtwh8}\u@\h en ${bldgrn}tty\$(echo $((/usr/bin/tty | /bin/sed -e ‘s:/dev/::’) | cut -d “/” -f2))${bldgrn})-(${bldwht}jobs:\j${bldgrn})\n${bldcyn}(\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed ‘s: ::g’) archivo(s), ${bldylw}\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed ‘s/total //’)b${bldgrn}) ${bldwht}\w ${txtrst}$ ${txtrst}”
#PS1=”\n${bldgrn}(${txtrst}\u@\h en ${bldgrn}tty\$(echo $(/usr/bin/tty | cut -d “/” -f4))${bldgrn})-(${bldwht}jobs:\j${bldgrn})-(${bldcyn}\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed ‘s: ::g’) archivo(s), ${bldylw}\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed ‘s/total //’)b${bldgrn})\n${bldwht}\w ${bldgrn}$ ${txtrst}”

# actual PS1=”\n${bldgrn}(${txtrst}\u@\h en ${bldgrn}\$(echo $(/usr/bin/tty | cut -d “/” -f3))\$(echo $(/usr/bin/tty | cut -d “/” -f4))${bldgrn})-(${bldcyn}jobs:${bldwht}\j${bldgrn})\n${bldwht}\w ${bldgrn}$ ${txtrst}”

# Seteamos las variables de entorno

source /etc/profile     # autojump
export PAGER=/usr/bin/most
export EDITOR=”joe”
export PATH=$PATH:/home/msx/bin

#[ -n "$WINDOWID" ] && transset-df -i $WINDOWID >/dev/null

# Programas que ejecutamos al inicio de sesión

alias xa=’xinit awesome’
alias xk=’xinit kde’
alias xo=’xinit openbox’
#alias xx=’xinit xfce’

#101 Linux Hacks
alias ..=”cd ..”
function mkdircd () { mkdir -p “$@” && eval cd “\”\$$#\”"; }

#comandos generales de GNU/Linux
alias ls=’ls –color=always’
alias ll=’ls | grep -v \\.’
alias la=’ls -ahl’
alias du=’du -lh’
alias df=’df -lh’
alias listarfuentes=’fc-list | sed ‘s,:.*,,’ | sort -u’
#alias man=’man -Pmost ‘
alias ta=’tar xfzv ‘
alias wifi=’sudo wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B && sleep 5 && sudo ifconfig wlan0 up && sleep 5 && sudo dhcpcd wlan0′

#comandos específicos de Arch Linux / Parabola GNU/Linux
alias b=’cd ~/Proyectos/build’
alias cower=’cower -dd –color=always -v’
alias cowers=’cower –color=always -v -s’
alias coweru=’cower -u –color=always -v’
alias instalar=’yaourt –aur -Sf’
alias instalarb=’sudo bauerbill –aur -Sf’
alias buscar=’yaourt -Ss’
alias buscarlocal=’yaourt -Qs’
#alias actualizar=’yaourt -Syu –aur –noconfirm’
alias actualizar=’yaourt -Syyuuf –aur’
alias actualizarb=’sudo bauerbill –aur -Syuf’
#alias actualizarmirrors=’sudo reflector -f 6 -l 6 -p http –save /etc/pacman.d/mirrorlist && yaourt -Syyuuf –aur’
alias am=’sudo reflector -f 6 -l 6 -p http –save /etc/pacman.d/mirrorlist && yaourt -Syyuuf –aur’
alias quitar=’yaourt -R’
alias quitard=’yaourt -Rd’

#atajos directorios
alias coding=’cd ~/Proyectos/Coding’
alias escritorio=’cd ~/Escritorio’
alias descargas=’cd /max/descargas’
alias jdown=’cd “/max/descargas/0 sitios hosting”‘
alias apps=’cd /home/data/Apps/Linux/Arch’
alias data=’cd /home/data’
alias pi=’cd /max/descargas/0\ sitios\ hosting/0\ Plowshare && ls’

alias chromiumm=’chromium –disable-logging –disable-metrics-reporting –disable-metrics –disable-dev-tools –enable-accelerated-compositing –enable-accelerated-2d-canvas –enable-accelerated-plugins –enable-click-to-play –start-maximized –memory-model=low –enable-accelerated-plugins –enable-click-to-play –enable-fastback –enable-history-quick-provider –enable-fullscreen –enable-in-browser-thumbnailing –enable-javascript-i18n-api –enable-nacl –enable-remoting –enable-p2papi –enable-preconnect –enable-print-preview –enable-snap-start –enable-video-fullscreen –enable-webaudio –no-default-browser-check –enable-media-player –web-worker-process-per-core %U’
alias emacs=’emacs -nw’
alias editark=’kdesu mousepad ‘
alias editar=’kwrite ‘
alias e=’exit’
alias l=’leafpad’
alias i=’irssi’
alias mo=’mocp -m -T /usr/share/moc/themes/moca_theme’
#alias limpiar=’sudo pacman -Scc && bleachbit && kdesu bleachbit’
alias limpiar=’bleachbit && kdesu bleachbit’
alias limpiarcli=’bleachbit -d deepscan.tmp system.desktop_entry system.localizations system.rotated_logs system.tmp && sudo bleachbit -d deepscan.tmp system.desktop_entry system.localizations system.rotated_logs system.tmp’
alias po=’plowdown –max-retries=50 –timeout=3600 -m ‘

[ -z "$PS1" ] && return

PS1=”\n${bldgrn}(${txtrst}\u@\h en ${bldgrn}\$(echo $(/usr/bin/tty | cut -d “/” -f3))\$(echo $(/usr/bin/tty | cut -d “/” -f4))${bldgrn})-(${bldcyn}jobs:${bldwht}\j${bldgrn})\n${bldwht}\w ${bldgrn}$ ${txtrst}”



~ $ cat /etc/rc.conf
# /etc/rc.conf – Main Configuration for Arch Linux

# ———————————————————————–
# ———————————————————————–
# LOCALE: available languages can be listed with the ‘locale -a’ command
# DAEMON_LOCALE: Set the locale during daemon startup and during the boot
#   process. If set to ‘no’, the C locale will be used.
# HARDWARECLOCK: set to “UTC” or “localtime”, any other value will result
#   in the hardware clock being left untouched (useful for virtualization)
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages

# ———————————————————————–
# ———————————————————————–
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
# NOTE: Use of ‘MOD_BLACKLIST’ is deprecated. Please use ! in the MODULES array.
#MOD_BLACKLIST=() #deprecated
MODULES=(it87 !coretemp fuse !fglrx acpi-cpufreq !cpufreq_ondemand !usblp)

# Scan for LVM volume groups at startup, required if you use LVM

# ———————————————————————–
# ———————————————————————–
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts

# Use ‘ifconfig -a’ or ‘ls /sys/class/net/’ to see all available interfaces.
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   – prefix an entry in INTERFACES with a ! to disable it
#   – no hyphens in your interface names – Bash doesn’t like it
# DHCP:     Set your interface to “dhcp” (eth0=”dhcp”)
# Wireless: See network profiles below

#Static IP example
#eth0=”eth0 netmask broadcast″

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   – prefix an entry in ROUTES with a ! to disable it
gateway=”default gw″

# Setting this to “yes” will skip network shutdown.
# This is required if your root device is on NFS.

# Enable these network profiles at boot-up.  These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
#   – set to ‘menu’ to present a menu during boot-up (dialog package required)
#   – prefix an entry with a ! to disable it
# Network profiles are found in /etc/network.d
# This now requires the netcfg package

# ———————————————————————–
# ———————————————————————–
# Daemons to start at boot-up (in this order)
#   – prefix a daemon with a ! to disable it
#   – prefix a daemon with a @ to start it up in the background
DAEMONS=(syslog-ng acpid dbus tomoyo @networkmanager @ufw @irqbalance @preload @alsa !avahi-daemon !avahi-dnsconfd @cups @network !netfs crond @sensors ulatencyd !kdm)

El /root/.bashrc es el mismo, lo único que cambia es la coloración del prompt:

PS1=”\n${bldgrn}(${txtrst}\u@\h en ${bldgrn}\$(echo $(/usr/bin/tty | cut -d “/” -f3))\$(echo $(/usr/bin/tty | cut -d “/” -f4))${bldgrn})-(${bldcyn}jobs:${bldwht}\j${bldgrn})\n${bldwht}\w ${bldgrn}$ ${txtrst}”


That’s all folks