Visualizzazione post con etichetta shell. Mostra tutti i post
Visualizzazione post con etichetta shell. Mostra tutti i post

20.4.10

the nice editor and the backspace

Subtitle: The sad state of Backspace and Delete key in linux(cit.)

For a newbie, what is the scariest part in a linux system? A lot of people hate linux 'cause "in a forum they made me open a DOS prompt to solve...".
The console is a powerful tool, but a lot of people doesn't like it.
Personally I prefer a lot of console applications, for the lighteness and the power of simple commands; sometimes is useful a quick edit in the console window of a configuration file, so I searched for a text editor that didn't change my mental keybinding. You know what I mean.
ctrl+c is for copy, ctrl+v is for paste, ctrl+x is for cut, ctrl+s is for saving, ctrl+q is for quit, ctrl+f is for search and ctrl+r is for replace.
In my experience, they are the same in EditPlus, UltraEdit, Notepad++, eclipse, kwrite, gedit: graphical text editor.
So after using vi, emacs -nw and nano for those dirty jobs I found ne.
It's the text editor that I'm searching for, just a console tool with the gui guys keybindings.
But...
The only thing that didn't work is the backspace key in urxvt. It's a well known problem in linux terminal, explained here (from the author of ne, Sebastiano Vigna).
The quick fix is the export TERM=gnome way, but I didn't like it, 'cause in some application it may cause mistake.
So I written a trivial fix for this:
~/bin/ne.sh

#!/bin/sh
export TERM=gnome
/usr/bin/ne $1
export TERM=rxvt

and added to my .zshrc

alias='ne=~/bin/ne.sh'


Fix'd! :)

17.4.10

my .zshrc


~ cat .zshrc
HISTFILE=~/.histfile
HISTSIZE=200
SAVEHIST=1000
#bindkey -e
bindkey -v
typeset -g -A key
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
# for rxvt
bindkey "\e[8~" end-of-line
bindkey "\e[7~" beginning-of-line

zstyle :compinstall filename '/home/milky/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

PROMPT=$'%~ '

eval $(dircolors -b)

alias 'mssh=ssh microbo -l root'
alias 'ls=/bin/ls --color=always -1 -S'
alias 'ne=~/bin/ne.sh'
alias 'emacs=/usr/bin/emacs -nw'
alias 'grep=/bin/grep --color=auto'
alias 'halt=/usr/bin/sudo /sbin/halt'
alias 'reboot=/usr/bin/sudo /sbin/reboot'
alias 'pacman=/usr/bin/sudo /usr/bin/pacman'
alias 'clyde=/usr/bin/sudo /usr/bin/clyde'
alias 'cat=/usr/bin/dog'
alias 'cp=/bin/cp -v'
alias 'mv=/bin/mv -v'
alias 'rm=/bin/rm -v'

fortune futurama calvin montypython
echo `whoami`@`hostname` - `date +'%A, %d %b %Y %k:%M.%S'`
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
    startx
fi
~

30.3.10

Fatherhood

I'm proud of it:

find /dir/full/of/jars -type f | grep jar | grep -v md5 | grep -v sha1 >> jars.txt
sed 's/\ cygdrive\ c/c:/g' jars.txt | while read LINE; do /cygdrive/c/Program\ Files/Java/jdk1.6.0_18/bin/jar.exe -tf $LINE | while read LINEINT; do echo $LINE:$LINEINT >> classes.txt; done ; done
cat classes.txt | grep package/ClassName


Edit: someone on reddit fixed my code:
http://www.reddit.com/r/smallprog/comments/bk6e4/cygwinbashsearch_the_jar_that_contain_that_class/c0n6hhb

find /dir/full/of/jars -type f -print0 -iname '*.jar' | sed 's/\/cygdrive\/c/c:/g' | xargs -0 /cygdrive/c/Program\ Files/Java/jdk1.6.0_18/bin/jar.exe -tf | grep package/Classname

Warning

My first language isn't english. Feel free to gently correct my words. :)
Powered By Blogger