mercoledì 12 dicembre 2012

Function strel for Octave

(tested on Octave 3.6.3)
version 0.5.1 available

Introduction
If you're looking for a "strel" function for Octave, you're in the right place.
If you, instead, do not know what a morphological structuring element for image processing is, you probably don't want to read further more.
Structuring elements are logical 2-dimensional matrixes, which are used in image processing operations including, but not limiting to dilation, erosion, opening, closing.
Although some people think you can easily build any structuring element you would ever imagine, and it's true, however if you just need to run an existing MATLAB® file, script or function, you might be miffed by substutution of all occurrences of strel by yourself, with the related structuring element it returns.



Download (current)
Since I've begun to contribute OctaveForge developing strel, many improvements has been made and thanks to Carnë Draug (maintainer of image package in Octave), strel is now included in the official package and it is available here for download.




Download (obsolete)
To download this function, press the following link: strel.m (0.5.1)
I want to point out that this post is not about "how to use additional octave function files", but just about strel.
The file is covered by GPLv3 license, and at the moment you download the file, it is supposed you have read and accepted it.
Before downloading, read it surfing here (GPL licenses).



Examples
Here some examples of output of strel with different parameters.

>>> strel('diamond', 3)
ans =

   0   0   0   1   0   0   0
   0   0   1   1   1   0   0
   0   1   1   1   1   1   0
   1   1   1   1   1   1   1
   0   1   1   1   1   1   0
   0   0   1   1   1   0   0
   0   0   0   1   0   0   0


>>> strel('pair', [3 2])
ans =

   0   0   0   0   0
   0   0   0   0   0
   0   0   0   0   0
   0   0   1   0   0
   0   0   0   0   0
   0   0   0   0   0
   0   0   0   0   1


>>> strel('rectangle', [3 2])
ans =

   1   1
   1   1
   1   1


>>> strel('square', 3)
ans =

   1   1   1
   1   1   1
   1   1   1


>>> strel('disk', 3)
ans =

   0   0   0   1   0   0   0
   0   1   1   1   1   1   0
   0   1   1   1   1   1   0
   1   1   1   1   1   1   1
   0   1   1   1   1   1   0
   0   1   1   1   1   1   0
   0   0   0   1   0   0   0




martedì 17 aprile 2012

Free Hamachi GUI Client for Linux

(tested on Slackware, Slackware64, Ubuntu; not tested, but it should work well also on Debian, Fedora, RedHat, SuSE, etc...)
version 1.5 available (new)

Prerequisites
You need LogMeIn Hamachi², which is not open-source, but free in some circumstances according to the license.
Slackware users can download SlackBuild from here and
$ tar xfv hamachi_slackbuild.tar.gz
$ cd hamachi_slackbuild
$ su
Password: 
# ./hamachi.SlackBuild
# upgradepkg --reinstall --install-new /tmp/hamachi-2.1.0.17-x86_64-1_nitrogl.txz # currently
(Every line is without initial $ or #)

Other distribution users Install package for their distribution from here  after having installed lsb version 3 or higher.


Making hamachi usable from your user
If you want to manage hamachi features from a user different from root, you have to list it into hamachi configuration. To do so, run the following commands from a shell.
$ USERNAME=`whoami` su -p
# printf "Ipc.User   ${USERNAME}\n" >> /var/lib/logmein-hamachi/h2-engine-override.cfg
(Without initial $ or #)



Making hamachi usable behind an http proxy
If you are behind a proxy server (i.e. http://193.205.206.25:3128) you can add these lines in the same file /var/lib/logmein-hamachi/h2-engine-override.cfg with your preferred text editor as super user:

Conn.PxyAddr        192.205.206.25
Conn.PxyPort        3128
Conn.PxySave        1
Conn.Mask           4
Conn.DisableUpnp    1
Core.AutoLogin      1
Login.OnLaunch      1


Remember to restart hamachi service after having changed configuration in order to have that configuration working.
Notice that the connection mask Conn.Mask without proxy has to be set to 7.


Install Quamachi2
Download Quamachi 2 (for python2).
Quamachi2 (1.5)(new) (Slackware and Slackware64)

Choose the package which best fit your distribution (Ubuntu/Debian .deb and RedHat .rpm are available) or directly download source code from here.

It is an open source GUI for hamachi which is compatible with python2. If you do not know if you just have these packages installed, I suggest you to use the command (from super user, as suggested by #):
# upgradepkg --install-new *.txz
in order to upgrade an eventually existing package, or install if you have not older versions of them.
If you are new in these things, read below.

Quickstart
Install both hamachi and quamachi2 in at least 2 hosts, we consider 2 hosts in this quickstart.

Run hamachi service (from super user or root) in each host:
# chmod +x /etc/rc.d/rc.hamachi
# /etc/rc.d/rc.hamachi start
Now run quamachi2 (you could find it in the application list under Applications). From gray, system tray icon should turn coloured. Open main window of quamachi2 by clicking once icon which lies in system tray.

On host1. Right click to (empty) list and choose "Create".
Just use a unique network name, like "mypersonalnet5234"; choose any password you want, like "abc".

On host2. Right click to (empty) list and choose "Join".
Use in this case the sanme name "mypersonalnet5234" and the same password "abc".

Now both hosts should recognize each other. Try to ping them or open some known service as both were in a real private network.

Enjoy!

domenica 25 marzo 2012

AWN extras

(working on Slackware64, should work on any Slackware64 version: just try, tested on current multilib)
version 0.4.0 available

You could live without other window manager typical panels, but only with Avant Window Navigator. Before installing following packages, ensure you've installed a working copy of Avant Window Navigator ← surf the link.
Afterwards, all you need is to install following packages:

Vala (0.12.0)
Python-dateutil (1.5)
Gdata (2.0.10)
Vobject (0.8.1c)
AWN Extras (0.4.0)


All packages are mandatory. If you do not know if you just have these packages installed, I suggest you to use the command (from super user, as suggested by #):
# upgradepkg --install-new *.txz

in order to upgrade an eventually existing package, or install if you have not older versions of them.


Enjoy!