2012
08.14

so after some more work trying to ensure that my passwords are not easily gotten, i managed to get my passwords encrypted into one file and removed after being read.

here is the snippet from my .muttrc-accounts :

set my_tmp=`gpg -q --no-verbose -o /tmp/.passwords.tmp -d ~/.passwords.gpg`
set my_pass_acct1=`cat /tmp/.passwords.tmp | grep IDENTIFIER1 | awk '{ print $2 }'`
set my_pass_acct2=`cat /tmp/.passwords.tmp | grep IDENTIFIER2 | awk '{ print $2 }'`
set my_del=`rm -f /tmp/.passwords.tmp`

EDIT 03-feb-2014:
reader Kage (thanks btw) posted a way more elegant way of handling the unencryption of passwords:

set my_pass_acct1 = `gpg -q -d ~/.passwords.asc | grep ^acct1 | awk ‘{ print $NF }’ | tr -d ‘\n’`

which is placed under account-hook . 'unset preconnect imap_user imap_authenticators'

the format of the password file:

IDENTIFIER1 password1
IDENTIFIER2 password2

and for all this to work, you just have to change

imap_pass=xxxxxx
smtp_pass=xxxxxx

to

imap_pass = $my_pass_acctx
smtp_pass = $my_pass_acctx

to create the gpg file :

gpg -r EMAIL_ADDRESS_ON_KEY -e PASSWORD_FILE

this all implies that you have gpg installed with your keys already configured.

muttrc-accounts in github

2012
08.08

ok. i lied about the last screenshot being the last one with this phone. i just have not gotten around to grabbing a new phone yet and this one works fine (for now).

in this screenshot, the nexus s (crespo) is running android 4.1.1 (cyanogenmod skank nightly) with a custom kernel (jbn weekly). recovery was upgraded to clockworkmod recovery touch (thanks Koush) and running smooth and pretty stable so far.

click bar to enlarge

grab the source from XDA.

2012
08.07

exactly as the name says. if you are a citrusleaf user, here is an easy (and hacky) way to output your namespace values to graphite with a nohup script every 10 seconds in github or here:

#!/bin/bash

#######
# this script runs through clinfo and grabs all the values for citrusleaf, then parses them out to graphite every 10 seconds.
# it only sends numeric values.
#
# to run this script :
# nohup sh citrusleaf_graphite.sh &
#
#######

NAMESPACE=""
HOSTNAME=`echo $HOSTNAME | cut -d. -f1`
DATE=`date +%s`
NETCAT=`which nc`
CL_SERVER="127.0.0.1"
CL_PORT="3000"
GRAPHITE_SERVER=""
GRAPHITE_PORT="2003"
NUMBER="0"

#### this is to check whether or not netcat is installed ####

if [[ -z ${NETCAT} ]]; then
    printf "\nnc not found.\n"
    exit 1
fi

#### you should not have to change anything below this line ####

while (true)
do
    DATE=`date +%s`
    NUMBER="0"
    for I in $(clinfo -h ${CL_SERVER} -p ${CL_PORT} -v ${NAMESPACE} | grep type | cut -d" " -f4 | tr ";" "\n")
    do
        # NUMBER=`expr ${NUMBER} + 2`
        NAME=`echo ${I} | cut -d"=" -f1`
        VALUE=`echo ${I} | cut -d"=" -f2 | cut -d";" -f1`
        VALUE_CHK=${VALUE//[^0-9]/}
            if [[ ${VALUE} == ${VALUE_CHK} ]]; then
                # echo ${NUMBER} ${I}
                # echo "value to nc:"
                # echo ${HOSTNAME}.${NAME} ${VALUE} ${DATE}
                echo "${HOSTNAME}.${NAME} ${VALUE} ${DATE}" | nc ${GRAPHITE_SERVER} ${GRAPHITE_PORT}
            fi
    done
    sleep 10
done

its pretty self explanatory.

2012
08.02

my zshrc

so after many years of using sh & bash i have decided to give zsh a try and after using it for a couple of weeks i cant go back.

so here is my zshrc @ github for people to use.

in detail (at time of writing this was my current zshrc):

#### interactive shell check #### {                                                                                                                                                                                                                                                                                                           
if [[ $- != *i* ]] ; then                                                                                                                                                                                                                                                                                                                     
    return                                                                                                                                                                                                                                                                                                                                    
fi                                                                                                                                                                                                                                                                                                                                            
#### end interactive check #### }                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                              
#### exports #### {                                                                                                                                                                                                                                                                                                                           
export LANG=en_US.UTF-8                                                                                                                                                                                                                                                                                                                       
export LC_ALL=en_US.UTF-8                                                                                                                                                                                                                                                                                                                     
export TERM=screen-256color                                                                                                                                                                                                                                                                                                                   
#### end exports #### }                                                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                                                                              
#### zsh key bindings #### {                                                                                                                                                                                                                                                                                                                  
bindkey '^A' beginning-of-line          # ctrl-a beginning of line binding                                                                                                                                                                                                                                                                    
bindkey '^E' end-of-line                # ctrl-e end of line binding                                                                                                                                                                                                                                                                          
bindkey '^R' history-incremental-search-backward        # ctrl-r history incremental search backwards                                                                                                                                                                                                                                         
bindkey '^[[2~' overwrite-mode          # insert key overwrite mode                                                                                                                                                                                                                                                                           
bindkey '^[[3~' delete-char             # delete key fix                                                                                                                                                                                                                                                                                      
bindkey '^[[7~' beginning-of-line       # home key                                                                                                                                                                                                                                                                                            
bindkey '^[[8~' end-of-line             # end key                                                                                                                                                                                                                                                                                             
bindkey -v                                                                                                                                                                                                                                                                                                                                    
#### end zsh key bindings #### }                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                              
#### zsh history #### {                                                                                                                                                                                                                                                                                                                       
HISTFILE=$HOME/.zsh_history                                                                                                                                                                                                                                                                                                                   
HISTSIZE=10000                                                                                                                                                                                                                                                                                                                                
SAVEHIST=10000                                                                                                                                                                                                                                                                                                                                
setopt APPEND_HISTORY           # append rather than overwrite history file.                                                                                                                                                                                                                                                                  
setopt EXTENDED_HISTORY         # save timestamp and runtime information                                                                                                                                                                                                                                                                      
setopt HIST_EXPIRE_DUPS_FIRST   # allow dups, but expire old ones when I hit HISTSIZE                                                                                                                                                                                                                                                         
setopt HIST_FIND_NO_DUPS        # don't find duplicates in history                                                                                                                                                                                                                                                                            
setopt HIST_IGNORE_ALL_DUPS     # ignore duplicate commands regardless of commands in between                                                                                                                                                                                                                                                 
setopt HIST_IGNORE_DUPS         # ignore duplicate commands                                                                                                                                                                                                                                                                                   
setopt HIST_REDUCE_BLANKS       # leave blanks out                                                                                                                                                                                                                                                                                            
setopt HIST_SAVE_NO_DUPS        # don't save duplicates                                                                                                                                                                                                                                                                                       
setopt INC_APPEND_HISTORY       # write after each command                                                                                                                                                                                                                                                                                    
setopt SHARE_HISTORY            # share history between sessions                                                                                                                                                                                                                                                                              
#### end zsh history #### }                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                              
#### ls colors zsh #### {                                                                                                                                                                                                                                                                                                                     
if [[ -x "`whence -p dircolors`" ]]; then                                                                                                                                                                                                                                                                                                     
      eval `dircolors`                                                                                                                                                                                                                                                                                                                        
        alias ls='ls -F --color=auto'                                                                                                                                                                                                                                                                                                         
    else                                                                                                                                                                                                                                                                                                                                      
          alias ls='ls -F'                                                                                                                                                                                                                                                                                                                    
      fi                                                                                                                                                                                                                                                                                                                                      
#### end ls colors #### }                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                              
#### zsh super globs #### {                                                                                                                                                                                                                                                                                                                   
setopt NO_CASE_GLOB             # case insensitive globbing                                                                                                                                                                                                                                                                                   
setopt NUMERIC_GLOB_SORT        # numeric glob sort                                                                                                                                                                                                                                                                                           
setopt extendedglob                                                                                                                                                                                                                                                                                                                           
unsetopt caseglob                                                                                                                                                                                                                                                                                                                             
#### end super globs #### }                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                              
#### misc zsh options #### {                                                                                                                                                                                                                                                                                                                  
setopt NO_BEEP                  # no more beeps                                                                                                                                                                                                                                                                                               
#### end misc zsh options #### }                                                                                                                                                                                                                                                                                                              
                            
#### aliases and functions #### {                                                                                                                                                                                                                                                                                                             
# alias speak_date='espeak “Today is `/bin/date \”+%A, %d %B 20%y\”`”‘                                                                                                                                                                                                                                                                        
# alias speak_time='espeak "Time is `/bin/date` \"+%H hours %M minutes %S seconds\""'                                                                                                                                                                                                                                                         
alias add='git add .'                                                                                                                                                                                                                                                                                                                         
alias commit='git commit .'                                                                                                                                                                                                                                                                                                                   
alias cpv="rsync -poghb --backup-dir=/tmp/rsync -e /dev/null --progress --"                                                                                                                                                                                                                                                                   
alias dud100='du -a --max-depth=1 | sort -n | awk '\''{if($1 > 102400) print $1/1024 "MB" " " $2 }'\'''                                                                                                                                                                                                                                       
alias dud='du --max-depth=1 -h'                                                                                                                                                                                                                                                                                                               
alias duf='du -sk * | sort -n | while read size fname; do for unit in k M G T P E Z Y; do if [ $size -lt 1024 ]; then echo -e "${size}${unit}\t${fname}"; break; fi; size=$((size/1024)); done; done'                                                                                                                                         
alias irc='if [[ $USER == root || `ps -ef | egrep tmux | egrep -v egrep | wc -l` -eq 0  ]] ; then irssi ; else  tmux rename-window "irc" && irssi ; fi'                                                                                                                                                                                       
alias mail='if [[ $USER == root || `ps -ef | egrep tmux | egrep -v egrep | wc -l` -eq 0  ]] ; then mutt ; else tmux rename-window "emails" && mutt ; fi'                                                                                                                                                                                      
alias o='popd'                                                                                                                                                                                                                                                                                                                                
alias p='pushd'                                                                                                                                                                                                                                                                                                                               
alias push='git push origin master'                                                                                                                                                                                                                                                                                                           
alias same="find . -type f -print0 | xargs -0 -n1 md5sum | sort -k 1,32 | uniq -w 32 -d --all-repeated=separate | sed -e 's/^[0-9a-f]*\ *//;'"                                                                                                                                                                                                
alias testunicode='perl -Mcharnames=:full -CS -wle '\''print "\N{EURO SIGN}"'\'''                                                                                                                                                                                                                                                             
alias x='exit'                                                                                                                                                                                                                                                                                                                                
function _force_rehash() { (( CURRENT == 1 )) && rehash ; return 1 }                                                                                                                                                                                                                                                                          
function goog; { /usr/bin/links 'http://www.google.com/search?q='${(j:+:)*} }                                                                                                                                                                                                                                                                 
function google; { /usr/bin/chromium 'http://www.google.com/search?q='${(j:+:)*} }                                                                                                                                                                                                                                                            
function h() { if [ -z "$*" ]; then history 1; else history 1 | egrep "$@"; fi; }                                                                                                                                                                                                                                                             
#### end aliases and functions #### }                                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                              
#### tmux shell init #### {                                                                                                                                                                                                                                                                                                                   
if [[ $USER != root ]]; then                                                                                                                                                                                                                                                                                                                  
    tmux_count=`tmux ls | wc -l`                                                                                                                                                                                                                                                                                                              
    if [[ "$tmux_count" == "0" ]]; then                                                                                                                                                                                                                                                                                                       
        tmux -2                                                                                                                                                                                                                                                                                                                               
    else                                                                                                                                                                                                                                                                                                                                      
        if [[ -z "$TMUX" ]]; then                                                                                                                                                                                                                                                                                                             
            if [[ "$tmux_count" == "1" ]]; then                                                                                                                                                                                                                                                                                               
                session_id=1                                                                                                                                                                                                                                                                                                                  
            else                                                                                                                                                                                                                                                                                                                              
                session_id=`echo $tmux_count`                                                                                                                                                                                                                                                                                                 
            fi                                                                                                                                                                                                                                                                                                                                
        tmux -2 new-session -d -s $session_id                                                                                                                                                                                                                                                                                                 
        tmux -2 attach-session -t $session_id                                                                                                                                                                                                                                                                                                 
        fi                                                                                                                                                                                                                                                                                                                                    
    fi                                                                                                                                                                                                                                                                                                                                        
else                                                                                                                                                                                                                                                                                                                                          
fi                                                                                                                                                                                                                                                                                                                                            
#### tmux init end #### }                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                              
#### motd / fortune #### {                                                                                                                                                                                                                                                                                                                    
fortune futurama                                                                                                                                                                                                                                                                                                                              
#### end motd / fortune #### }                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                              
#### prompt #### {                                                                                                                                                                                                                                                                                                                            
PS1='%(!.%B%F{red}%n %B%F{blue}[%d] %B%F{red}%{☿%} %b%f%k.%B%F{green}%n@%m%k %B%F{blue}%1~ %# %b%f%k)'                                                                                                                                                                                                                                        
#### end prompt #### }                                                       

all the brackets in the comments are for vim folding to make life easier.

on of the cool parts about zsh is the globbing features:

% ls *(
%  -- device files
)  -- end of qualifiers
*  -- executable plain files
+  -- + command name
-  -- follow symlinks toggle
.  -- plain files
/  -- directories
:  -- modifier
=  -- sockets
@  -- symbolic links
A  -- group-readable
D  -- glob dots
E  -- group-executable
F  -- non-empty directories
G  -- owned by EGID
I  -- group-writeable
L  -- + size
M  -- mark directories
N  -- use NULL_GLOB
O  -- + sort order, down
P  -- prepend word
R  -- world-readable
S  -- setgid
T  -- mark types
U  -- owned by EUID
W  -- world-writeable
X  -- world-executable
[  -- + range of files
^  -- negate qualifiers
a  -- + access time
c  -- + inode change time
d  -- + device
e  -- execute code
f  -- + access rights
g  -- + owning group
l  -- + link count
m  -- + modification time
n  -- numeric glob sort
o  -- + sort order, up
p  -- name pipes (FIFOS)
r  -- owner-readable
s  -- setuid
t  -- sticky bit set
u  -- + owning user
w  -- owner-writeable
x  -- owner-executable