2010
09.02

I just found a nice extension for Firefox that allows one to just zoom in on webpages without having to put one hand on keyboard. I wanted something like this because i often just browse the web laid back, reading news or just browsing some daily nonsense.

The “Page Zoom Buttons” extension does exactly that. I just use the “Scroll Zoom”-Button only, as you can just move the mouse pointer over it, zoom by using the mouse wheel, or reset zoom to 100% by clicking on it:

https://addons.mozilla.org/de/firefox/addon/6827/

Additionally, there’s an option in about:config “browser.zoom.siteSpecific” that allows to keep zooming state when leaving a webpage (as in “clicking on a link”). Just set it to false and you keep surfing zoomed.

2010
09.01

Xresources


*VT100*foreground: gray95
*VT100*background: black
*VT100*cursorColor: #ff5544

*VT100*color4: #6677ff

XTerm*VT100.colorBDMode: on

*VT100*color1: #ff4444

*XTerm*foreground: gray95
*XTerm*background: black

*XTerm*scrollBar: false

XTerm*metaSendsEscape: true
XTerm*eightBitInput: false

! XTerm*iconPixmap: /usr/include/X11/bitmaps/xlogo64

! XTerm*iconName: terminal

*XConsole*font: -*-terminus-medium-*-normal-*-12-*-*-*-*-*-*-*
*XConsole*foreground: white
*XConsole*background: black

*XTerm.boldMode: false
*XTerm.boldFont: -*-terminus-medium-*-normal-*-12-*-*-*-*-*-*-*

*VT100*font: -*-terminus-medium-*-normal-*-16-*-*-*-*-*-*-*
*XTerm*font: -*-terminus-medium-*-normal-*-16-*-*-*-*-*-*-*

*fontMenu*font1*Label: Terminus 12 (Default)
*VT100*font1: -*-terminus-medium-*-normal-*-12-*-*-*-*-*-*-*
*XTerm*font1: -*-terminus-medium-*-normal-*-12-*-*-*-*-*-*-*

*fontMenu*font2*Label: Terminus 14
*VT100*font2: -*-terminus-medium-*-normal-*-14-*-*-*-*-*-*-*
*XTerm*font2: -*-terminus-medium-*-normal-*-14-*-*-*-*-*-*-*

*fontMenu*font3*Label: Terminus 16
*VT100*font3: -*-terminus-medium-*-normal-*-16-*-*-*-*-*-*-*
*XTerm*font3: -*-terminus-medium-*-normal-*-16-*-*-*-*-*-*-*

*fontMenu*font4*Label: Terminus 17
*VT100*font4: -*-terminus-medium-*-normal-*-17-*-*-*-*-*-*-*
*XTerm*font4: -*-terminus-medium-*-normal-*-17-*-*-*-*-*-*-*

*fontMenu*font5*Label: Terminus 20
*VT100*font5: -*-terminus-medium-*-normal-*-20-*-*-*-*-*-*-*
*XTerm*font5: -*-terminus-medium-*-normal-*-20-*-*-*-*-*-*-*

*fontMenu*font6*Label: Terminus 24
*VT100*font6: -*-terminus-medium-*-normal-*-24-*-*-*-*-*-*-*
*XTerm*font6: -*-terminus-medium-*-normal-*-24-*-*-*-*-*-*-*

*XTerm*shiftFonts: true
*VT100*shiftFonts: true

*VT100*translations:#override\n !Ctrl +: larger-vt-font()\n !Ctrl -: smaller-vt-font()
! *VT100*translations:#override\n !Ctrl -: smaller-vt-font()\n !Ctrl +: larger-vt-font()

2010
08.31

bashrc


# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi

# debian default coloured prompt
#case "$TERM" in
#xterm-color)
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# ;;
#*)
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# ;;
#esac

# beautiful prompt
case $TERM in
linux|xterm*|*rxvt*)
# Comment in the above and uncomment this below for a color prompt
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# PS1='\[\033[0;33m\][\[\033[1;32m\]\u\[\033[0;36m\]@\[\033[1;32m\]\h\[\033[1;36m\]:\[\033[1;31m\]\w\[\033[0;33m\]]\[\033[0m\] '
# PS1='\[\033[1;30m\](\[\033[1;32m\]\u\[\033[0;32m\]@\[\033[1;32m\]\h\[\033[1;35m\]:\[\033[1;36m\]\w\[\033[1;30m\])\[\033[0m\] '
PS1='\[\033[1;30m\][\[\033[1;32m\]\u\[\033[0;32m\]@\[\033[1;32m\]\h\[\033[1;35m\]:\[\033[1;37m\]\w\[\033[1;30m\]]\[\033[0m\] '
;;
esac

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
;;
*)
;;
esac

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
#if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
#fi

# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

# this is to keep environment when sudo'ing
alias sudo='sudo -E'

# coloured man-pages
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;33m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'

# hiding root's binarys from users is completely pointless,
# so let's add sbin dirs to $PATH for non-root users
if [ "$UID" != 0 ]; then PATH=$PATH:/sbin:/usr/local/sbin:/usr/sbin:/usr/libexec/; fi

# also, let's add ~/bin
export PATH="$PATH:~/bin"

# turn off annoying beepage
set bell-style none
xset b off 2>/dev/null
set blength=0 >/dev/null 2>&1

# this is a hack to execute a command to re-enable ctrl-alt-backspace when bash
# is executed from an x-terminal-emulator.
case $TERM in
xterm*|rxvt)
if [ -n "${DISPLAY+x}" ]; then
setxkbmap -option terminate:ctrl_alt_bksp
fi
;;
esac

# vi stuff
export EDITOR='vim'
which vim >/dev/null 2>&1 && alias vi='vim'

2010
08.28

vimrc


syn on
set title
autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g`\"" | endif
set bg=dark
ca Wq wq
ca WQ wq

set vb t_vb=""

set fileformat=unix
set notextauto

2010
08.22

The parameter expansion of the Bourne Again Shell (BASH) seems to be very confusing at first for most users. Even worse, documentation available for this mostly is even more confusing. Personally i’ve found examples very helpful for this, so here we go.


[armin@cube:~/test2] ls -al
total 44
drwxr-xr-x 2 armin armin 4096 2010-07-20 10:11 .
drwxr-xr-x 311 armin armin 40960 2010-07-20 10:11 ..
-rw-r--r-- 1 armin armin 0 2010-07-20 10:11 bla.bla1.bat
-rw-r--r-- 1 armin armin 0 2010-07-20 10:11 bla.mp3
-rw-r--r-- 1 armin armin 0 2010-07-20 10:11 bla.zip
[armin@cube:~/test2] for file in *; do echo "${file##*.}"; done
bat
mp3
zip
[armin@cube:~/test2]

[armin@cube:~] foo="/foo/bar/baz/qux"; echo "${foo##*/}"
qux
[armin@cube:~]

[armin@cube:~] file="Dies ist ein tolles Testfile.mp3"; echo "${file%.mp3}"
Dies ist ein tolles Testfile
[armin@cube:~]

[armin@cube:~] foo="/foo/bar/baz/qux"; echo ${foo%/*}
/foo/bar/baz
[armin@cube:~]

[armin@cube:~] foo="/foo/bar/baz/qux"; echo ${foo#*/foo/bar*}
/baz/qux
[armin@cube:~]

A very good article on parameter expansion can be found at http://mywiki.wooledge.org/BashFAQ/073