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

24.5.10

arrays in bash: not for resale

Subtitle: the sad state of bash syntax for arrays
Crap. No way. Can't find great documentation, just try&fail to get what I want.

And now, for something completely different
I switched to DuckDuckGo as default search engine.
Send a feedback and yegg will reply in minutes! Awesome!

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! :)

11.4.10

Search in irssi through google Json API

I wrote this simple script for irssi:
http://github.com/dexgeh/googlejson4irssi
It is based on the google perl example.
Never wrote perl before. :)

5.3.10

A little jar hell

OpenIM is a Jabber Server written in Java. It uses maven to solve dependencies.
Maven is great, when you have an internet connection, but I have to put OpenIM in a private Lan without internet access.
So i googled for a method for the export of a maven project with all of its dependencies; but I was unlucky.
I know that maven put all downloaded jars in ~/.m2 directory.
So I temporary renamed my .m2/ and mvn install as described in OpenIM documentation.
With a directory full of jars, I want to collect all files in a directory so I did a bash script to do so:
cd .m2/repository/
find `pwd` -print | grep '.jar' | grep -v '.sha1' | grep -v '.md5' >> ~/templist.txt
cd
mkdir tempjars
cat ~/templist.txt | while read LINE do
    cp $LINE tempjars/
done
rm ~/templist.txt


And I prepared a script to run the server (to be placed in the same dir of the jars):
$JAVA_HOME/bin/java -classpath $(echo *.jar . | sed 's/ /:/g') -jar pomstrap-1.0.7.jar net.java.dev.openim:openim-plexus-server:1.5 net.java.dev.openim.App:launch

And that's all.

Warning

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