<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>kallasoft</title>
	
	<link>http://www.kallasoft.com</link>
	<description>Feed for posts on kallasoft - commercial-friendly, Open Source software development site.</description>
	<pubDate>Mon, 24 Nov 2008 20:12:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/kallasoft" type="application/rss+xml" /><feedburner:emailServiceId>1486841</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>Programming a Simple Client/Server Application with Ruby</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/463549316/</link>
		<comments>http://www.kallasoft.com/programming-a-simple-clientserver-with-ruby/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 06:09:31 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Servers]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[client]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[server]]></category>

		<category><![CDATA[sockets]]></category>

		<category><![CDATA[TCPServer]]></category>

		<category><![CDATA[TCPSocket]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=636</guid>
		<description><![CDATA[
Being able to add some sort of client/server model to your programs is pretty essential these days, and Ruby does a fine job making your life easier.
For this article, I&#8217;ll show you a quick, down-and-dirty way of getting a very simple server up and running and a client that will say &#8220;Hello Server World&#8221; and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/ruby-logo.png"><img class="alignnone size-medium wp-image-637" style="float: left; margin-left: 8px; margin-right: 8px;" title="Ruby Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/11/ruby-logo.png" alt="" width="107" height="123" /></a></p>
<p>Being able to add some sort of client/server model to your programs is pretty essential these days, and Ruby does a fine job making your life easier.</p>
<p>For this article, I&#8217;ll show you a quick, down-and-dirty way of getting a very simple server up and running and a client that will say &#8220;Hello Server World&#8221; and disconnect. You will, of course, need Ruby installed, for Ubuntu users</p>
<pre class="console">sudo apt-get install ruby</pre>
<p>and for Fedora users</p>
<pre class="console">sudo yum install ruby</pre>
<p>Now, the first plan of action for a client/server assignment is to map out what exactly you want to occur.  Setting those expectations in comments before you even think about code a good practice and will make your life a whole lot easier. That being said, let&#8217;s start with the server,  by adding the following to a file we&#8217;ll name server.rb:</p>
<pre name="code" class="ruby">
#establish server
#setup to listen and accept connections
#start new thread conversation
#reply with goodbye
#end loop</pre>
<p>Now let&#8217;s do the same thing for the client script but name it client.rb</p>
<pre name="code" class="ruby">
#establish connection
#send a quick message
#wait for messages from the server
#if one of the messages contains 'Goodbye' we'll disconnect
#end loop</pre>
<p>Okay, now, lets get coding. There is only one requirement for writing these scripts, you will need to add:</p>
<pre class="console">require 'socket'</pre>
<p>to the top of your script so that you have access to the TCPServer class. The TCPServer constructor needs at least port number, so I&#8217;ll set it up with port 2008. Also, we want to be able to have the server allow many clients to connect so we will need some sort of Thread structure built in to handle multiple requests. We will then accept any incoming TCP connections on port, 2008 say &#8220;Welcome&#8221; to the client, and wait for any response.&#8221;  To keep this tutorial short, the server will be implemented in a forever loop that constantly listens for connections.  Edit your server.rb file to follow what I&#8217;ve outlined above (I&#8217;ve used ## to denote comments further explaining what is going on) :</p>
<pre name="code" class="ruby">
#!/usr/bin/ruby
require 'socket'

puts "Starting up server..."

# establish the server
## Server established to listen for connections on port 2008
server = TCPServer.new(2008)

# setup to listen and accept connections
while (session = server.accept)

 #start new thread conversation
 ## Here we will establish a new thread for a connection client
 Thread.start do

   ## I want to be sure to output something on the server side
   ## to show that there has been a connection
   puts "log: Connection from #{session.peeraddr[2]} at
          #{session.peeraddr[3]}"
   puts "log: got input from client"

   ## lets see what the client has to say by grabbing the input
   ## then display it. Please note that the session.gets will look
   ## for an end of line character "\n" before moving forward.
   input = session.gets
   puts input

   ## Lets respond with a nice warm welcome message
   session.puts "Server: Welcome #{session.peeraddr[2]}\n"

   # reply with goodbye
   ## now lets end the session since all we wanted to do is
   ## acknowledge the client
   puts "log: sending goodbye"
   session.puts "Server: Goodbye\n"

 end  #end thread conversation
end   #end loop</pre>
<p>Cool, the server is written.  If you run this script, it won&#8217;t look like much so lets just let it go for now. The client is pretty simple, we just want to say Hello, wait for any messages back from our super sophisticated server, and disconnect if the server says &#8216;Goodbye&#8217;.</p>
<p>Modify your client.rb file to look something like this:</p>
<pre name="code" class="ruby">
#!/usr/bin/ruby
require 'socket'

# establish connection
## We need to tell the client where to connect
## Conveniently it is on localhost at port 2008!
clientSession = TCPSocket.new( "localhost", 2008 )

puts "log: starting connection"

#send a quick message
## Note that this has a carriage return. Remember our server
## uses the method gets() to get input back from the server.
puts "log: saying hello"
clientSession.puts "Client: Hello Server World!\n"

#wait for messages from the server
## You've sent your message, now we need to make sure
## the session isn't closed, spit out any messages the server
## has to say, and check to see if any of those messages
## contain 'Goodbye'. If they do we can close the connection
 while !(clientSession.closed?) &amp;&amp;
          (serverMessage = clientSession.gets)
  ## lets output our server messages
  puts serverMessage

  #if one of the messages contains 'Goodbye' we'll disconnect
  ## we disconnect by 'closing' the session.
  if serverMessage.include?("Goodbye")
   puts "log: closing connection"
   clientSession.close
  end
 end #end loop</pre>
<p>Now open up two terminal sessions, and, from the directory you were editing your client and server scripts from, run them.</p>
<p>Localhost Terminal Session 1</p>
<pre class="console">~$ ruby server.rb
Starting up server...
log: Connection from localhost at ::1
log: got input from client
Client: Hello Server World!
log: sending goodbye</pre>
<p>Localhost Terminal Session 2</p>
<pre class="console">~$ ruby client.rb
log: starting connection
log: saying hello
Server: Welcome localhost
Server: Goodbye
log: closing connection
~$</pre>
<p>Of course the server running in terminal session 1 will continue running until you hit Control-C to stop it. If you have port 2008 open, you should now be able to run the client script from a remote computer if you change &#8216;localhost&#8217; to the ipaddress of your server.  My server resides at &#8220;192.168.0.127&#8243; and my client resides at &#8220;192.168.0.141&#8243;.  I modified the &#8216;clientSession&#8221; line to look like this:</p>
<pre name="code" class="ruby">
clientSession = TCPSocket.new( "192.168.0.127", 2008 )</pre>
<p>Then, I ran this across my small network and saw:</p>
<p>on Server Side terminal:</p>
<pre class="console">macbook:~ presenter$ ruby server.rb
Starting up server...
log: Connection from sparta at 192.168.0.141
log: got input from client
Client: Hello Server World!
log: sending goodbye</pre>
<p>on Client side terminal:</p>
<pre class="console">codenomad@sparta:~$ ruby client.rb
log: starting connection
log: saying hello
Server: Welcome sparta
Server: Goodbye
log: closing connection
codenomad@sparta:~$</pre>
<p>Now, if you really wanted to add some more features, try adding the ability to respond to messages sent by the client in the server script or try to raise or rescue exceptions when a connection is lost.  You can see the types of exceptions that TCPServer raises <a href="http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/TCPServer.html">here</a> under either Unix-based Exceptions or Windows Exceptions.  Good luck with creating your client/server app, and happy coding!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=Q7zYN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Q7zYN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=68XgN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=68XgN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=JxMcn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=JxMcn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=lHFsN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=lHFsN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=GQz5n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=GQz5n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=mmruN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=mmruN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=HL6Rn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=HL6Rn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=LPAGN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=LPAGN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=KAGln"><img src="http://feeds.feedburner.com/~f/kallasoft?i=KAGln" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=n89SN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=n89SN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/463549316" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/programming-a-simple-clientserver-with-ruby/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fprogramming-a-simple-clientserver-with-ruby%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/programming-a-simple-clientserver-with-ruby/</feedburner:origLink></item>
		<item>
		<title>Floola as iPod Management Software</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/461959310/</link>
		<comments>http://www.kallasoft.com/floola-as-ipod-management-software/#comments</comments>
		<pubDate>Sat, 22 Nov 2008 16:16:44 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Floola]]></category>

		<category><![CDATA[iPod]]></category>

		<category><![CDATA[management]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=546</guid>
		<description><![CDATA[Looking for that great iTunes replacement app to run on Linux? Have you ever heard of Floola? Offering most of the features of iTunes, Floola now gives Linux users the ability to copy Music, Photos, Movies, and even YouTube and MySpace videos to their treasured ipods.
For those whose music is encoded in ogg or FLAC, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.floola.com/modules/wiwimod/"><img class="alignleft size-medium wp-image-548" style="float: left; margin-left: 8px; margin-right: 8px;" title="Floola Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/11/floola.jpeg" alt="" width="85" height="83" /></a>Looking for that great iTunes replacement app to run on Linux? Have you ever heard of <a href="http://www.floola.com/modules/wiwimod/">Floola</a>? Offering most of the features of iTunes, Floola now gives Linux users the ability to copy Music, Photos, Movies, and even YouTube and MySpace videos to their treasured ipods.</p>
<p>For those whose music is encoded in ogg or FLAC, well, Floola can also convert these formats so that they are playable on the iPod. You can even manage the notes on your iPod. The greatest part is that the software is cross platform and runs on Windows, Mac OS X, and Linux. If you are running Ubuntu you will need either libxine or gstreamer and libstdc++5 (for notifications you&#8217;ll need libnotify as well). These can all be installed pretty easy by running:</p>
<pre class="console">sudo apt-get install libstdc++5 libxine1 libnotify-bin</pre>
<p>After that completes you can grab the Floola download <a href="http://www.floola.com/modules/wiwimod/index.php?page=download_linux">here</a></p>
<p>You will then need to unzip the archive and copy to your /usr/bin.  Assuming you downloaded it to the desktop you can issue these commands:</p>
<pre class="console">~/Desktop$ tar -xvzf Floola-linux.tar.gz
~/Desktop$ cd Floola-linux/
~/Desktop/Floola-linux$ sudo cp Floola /usr/bin/</pre>
<p>Be sure your ipod is plugged in and now you can run it:</p>
<pre class="console">~$ Floola</pre>
<p>The first time you run Floola you will need to go through a simple setup:</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot1.png"><img class="size-medium wp-image-626 aligncenter" title="floola-screenshot1" src="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot1.png" alt="" width="475" height="320" /></a></p>
<p>Select your iPod version:</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot2.png"><img class="size-medium wp-image-627 aligncenter" title="floola-screenshot2" src="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot2.png" alt="" width="475" height="320" /></a></p>
<p>And now you are good to go:</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot.png"><img class="size-medium wp-image-625 aligncenter" title="floola-screenshot" src="http://www.kallasoft.com/wp-content/uploads/2008/11/floola-screenshot.png" alt="" width="475" height="298" /></a></p>
<p>You like Floola? Let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=W4LSN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=W4LSN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=4AYSN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=4AYSN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=yyMxn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=yyMxn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=4bqRN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=4bqRN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=HfVkn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=HfVkn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=sPzKN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=sPzKN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=rYatn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=rYatn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=njI9N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=njI9N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=XLmVn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=XLmVn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ARV9N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ARV9N" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/461959310" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/floola-as-ipod-management-software/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Ffloola-as-ipod-management-software%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/floola-as-ipod-management-software/</feedburner:origLink></item>
		<item>
		<title>AjaXplorer: a Web-based File Manager</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/460818586/</link>
		<comments>http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 14:40:10 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Servers]]></category>

		<category><![CDATA[Ajax Explorer]]></category>

		<category><![CDATA[Ajax file access]]></category>

		<category><![CDATA[AjaXplorer]]></category>

		<category><![CDATA[explorer]]></category>

		<category><![CDATA[file manager]]></category>

		<category><![CDATA[remote file management]]></category>

		<category><![CDATA[web based file manager]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=603</guid>
		<description><![CDATA[
AjaXplorer is quite a unique tool, and if you haven&#8217;t heard of it you might want to check out the latest 2.3.8 version.  Essentially, AjaXplorer creates a web-based file manager using, you guessed it, Ajax.  You can upload and view files, edit text files, create folders, and move or rename files and folders. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/ajaxplorer-firefox.png"><img class="size-medium wp-image-605 aligncenter" title="AjaXplorer View in Firefox on Ubuntu 8.10" src="http://www.kallasoft.com/wp-content/uploads/2008/11/ajaxplorer-firefox.png" alt="" width="450" height="290" /></a></p>
<p style="text-align: left;"><a href="http://www.ajaxplorer.info/">AjaXplorer</a> is quite a unique tool, and if you haven&#8217;t heard of it you might want to check out the latest 2.3.8 version.  Essentially, AjaXplorer creates a web-based file manager using, you guessed it, Ajax.  You can upload and view files, edit text files, create folders, and move or rename files and folders. Standard stuff maybe, but the beauty is that it can all be done from within your web browser at home, at work, or on the road. The setup is pretty easy, all you need is a working Apache server with PHP support. From Ubuntu you can enter:</p>
<pre class="console">~$ sudo apt-get install php5 apache2 libapache2-mod-php5</pre>
<p>Then, go grab the latest <a href="http://sourceforge.net/project/showfiles.php?group_id=192639">version</a>. Then you will need to unzip the contents of the file and put it into the Apache web folder.</p>
<pre class="console">~$ unzip ajaxplorer-core-2.3.8-dist.zip
~$ sudo mv AjaXplorer-2.3.8/ /var/www/explorer</pre>
<p>We need to change some permissions on the files folder and on the server folder. These folders need to be writable, and we&#8217;ll restart apache to make sure everything is in place.</p>
<pre class="console">~$ sudo chmod -R 777 /var/www/explorer/files
~$ sudo chmod -R 777 /var/www/explorer/server
~$ sudo /etc/init.d/apache2 restart</pre>
<p>Now you can check to make sure it is here by clicking <a href="http://localhost/explorer">http://localhost/explorer</a>. As soon as the AjaXplorer loads you should be prompted to change your default admin password from &#8216;admin&#8217;.  After doing that you can start to setup your repositories and users. Now this setup might be good enough for an internal trusted network, but I would recommend that anything done over the open web should be encrypted.  Luckily AjaXplorer also kept this in mind and has a bit of documentation on how to set that up in section 8.7 of their <a href="http://www.ajaxplorer.info/documentation/chapter-8-faq/">F.A.Q</a>. You will also need to be sure to restrict access to</p>
<pre class="console">/var/www/explorer/server/conf</pre>
<p>and</p>
<pre class="console">/var/www/explorer/server/users</pre>
<p>as soon as you have completed your configuration.  According to the website, AjaXplorer uses .htaccess files to protect these directories. The interface is pretty easy to navigate, though there are still a few interface bugs.  You can see some screenshots below of my tests using Firefox 3, Camino 1.6.5, and Safari 3.2.</p>

<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/ajaxplorer-firefox/' title='AjaXplorer View in Firefox on Ubuntu 8.10'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/ajaxplorer-firefox.png" width="150" height="96" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/ajaxplorer-about-small/' title='About AjaXplorer View in Firefox on Ubuntu 8.10'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/ajaxplorer-about-small.png" width="150" height="148" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-admin-repository/' title='AjaXplorer Admin Repository View in Safari'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-admin-repository.png" width="150" height="96" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-admin-screenshot/' title='AjaXplorer Admin Screenshot in Safari'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-admin-screenshot.png" width="150" height="96" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-camino-filebrowser/' title='AjaXplorer Filebrowser View in Camino'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-camino-filebrowser.png" width="150" height="94" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-camino-repository/' title='AjaXplorer Repository View in Camino'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-camino-repository.png" width="150" height="94" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-camino-users/' title='AjaXplorer Users View'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-camino-users.png" width="150" height="94" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mac-camino-view-larger/' title='AjaXplorer View File in Camino'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-camino-view-larger.png" width="150" height="94" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/mysql-connection/' title='mysql-connection'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/mysql-connection.png" width="150" height="107" class="attachment-thumbnail" alt="" /></a>

<p>One of the coolest features is the ability to use a MySQL database as your &#8216;repository&#8217;.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-admin-repository.png"><img class="size-medium wp-image-612 aligncenter" title="AjaXplorer Admin Repository View in Safari" src="http://www.kallasoft.com/wp-content/uploads/2008/11/mac-admin-repository.png" alt="" width="450" height="289" /></a></p>
<p>If you are creative there are a lot of great things you can do with this, like manage a dynamic photo album&#8217;s pictures or even use the explorer as a type of collaboration tool. Check it out and let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=hdAeN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=hdAeN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=gERtN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=gERtN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=f2Zan"><img src="http://feeds.feedburner.com/~f/kallasoft?i=f2Zan" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=in7qN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=in7qN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=NXoGn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=NXoGn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=xxveN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=xxveN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=jetin"><img src="http://feeds.feedburner.com/~f/kallasoft?i=jetin" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Ozd2N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Ozd2N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=0lhhn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=0lhhn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=sDMPN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=sDMPN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/460818586" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fajaxplorer-a-web-based-file-manager%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/ajaxplorer-a-web-based-file-manager/</feedburner:origLink></item>
		<item>
		<title>ClamTk 4.04 - A GUI Front End for ClamAV - Released</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/457352096/</link>
		<comments>http://www.kallasoft.com/clamtk-404-a-gui-front-end-for-clamav-released/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 16:34:49 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[antivirus]]></category>

		<category><![CDATA[Clam AntiVirus]]></category>

		<category><![CDATA[Clamtk]]></category>

		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=576</guid>
		<description><![CDATA[
ClamTk just released the latest version of their frontend to Clam AntiVirus which &#8220;brings back the Debian builds.&#8221;
If you&#8217;ve never heard of Clam AntiVirus (aka ClamAV) before it is an Open Source antivirus solution for Linux. Over the years ClamAV has gained much popularity, and has been used by many companies small and big alike [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/clamavtk1.png"><img class="size-medium wp-image-577 aligncenter" title="ClamTk" src="http://www.kallasoft.com/wp-content/uploads/2008/11/clamavtk1.png" alt="The ClamTk front end" width="298" height="210" /></a></p>
<p>ClamTk just released the latest version of their frontend to <a href="http://www.clamav.net/">Clam AntiVirus</a> which &#8220;brings back the Debian builds.&#8221;</p>
<p>If you&#8217;ve never heard of <a href="http://www.clamav.net/">Clam AntiVirus</a> (aka ClamAV) before it is an Open Source antivirus solution for Linux. Over the years ClamAV has gained much popularity, and has been used by many companies small and big alike to scan incoming email. With ClamTk you can harness this power on the desktop, and with the new 4.04 release you are only a <em>dpk -i</em> away from trying it out, sort of&#8230;</p>
<p>As the homepage <a href="http://clamtk.sourceforge.net/">states</a> ClamTk 4.04 is the first 4.x release to have a Debian package. That being said the latest version hasn&#8217;t hit the repositories. If you are running Ubuntu or Debian you can still try out the latest version of ClamTk by grabbing a copy <a href="http://sourceforge.net/project/showfiles.php?group_id=131278&amp;package_id=144061&amp;release_id=640823&lt;br &gt;&lt;/a&gt;">here</a>.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/clamavtk2.png"><img class="aligncenter size-medium wp-image-578" title="Clamtk in action" src="http://www.kallasoft.com/wp-content/uploads/2008/11/clamavtk2.png" alt="" width="298" height="269" /></a></p>
<p>Be sure to install gtk2-perl to satisfy dependencies by running</p>
<pre class="console">sudo apt-get install libgtk2-perl</pre>
<p>Then you can install the .deb package by running</p>
<pre class="console">sudo dpkg -i clamtk_4.04-1_all.deb</pre>
<p>Check it out, and let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=0M9gN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=0M9gN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=cnooN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=cnooN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=5qm4n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=5qm4n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ZxQFN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ZxQFN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=rd0Xn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=rd0Xn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=NWLvN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=NWLvN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=sZIgn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=sZIgn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=5eQ5N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=5eQ5N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ZqkHn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ZqkHn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=udDrN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=udDrN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/457352096" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/clamtk-404-a-gui-front-end-for-clamav-released/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fclamtk-404-a-gui-front-end-for-clamav-released%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/clamtk-404-a-gui-front-end-for-clamav-released/</feedburner:origLink></item>
		<item>
		<title>How to Setup an SVN Server to use in Eclipse</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/456013807/</link>
		<comments>http://www.kallasoft.com/how-to-setup-an-svn-server-to-use-in-eclipse/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 14:13:36 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[how to]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[source repository]]></category>

		<category><![CDATA[Subversion]]></category>

		<category><![CDATA[Subversive]]></category>

		<category><![CDATA[SVN]]></category>

		<category><![CDATA[team]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=557</guid>
		<description><![CDATA[
So, after thousands of lines of code you&#8217;ve managed to build an awesome, feature rich program, and you are really to label it 1.0.  You want to bring in more developers because it is doing so great&#8230; What do you do?  Well, regardless of whether you have hit 1.0, version control is something [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse-file-new.png"><img class="alignnone size-medium wp-image-564" title="Eclipse File New" src="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse-file-new.png" alt="" width="450" height="303" /></a></p>
<p>So, after thousands of lines of code you&#8217;ve managed to build an awesome, feature rich program, and you are really to label it 1.0.  You want to bring in more developers because it is doing so great&#8230; What do you do?  Well, regardless of whether you have hit 1.0, version control is something that should be considered from a project&#8217;s inception.  It will allow you to collaborate and share code with a team, or the world.  That being said, how does one set up control versioning? Enter Subversion, this article will show you how-to setup a subversion server and Eclipse for sharing?  Read on!</p>
<p>If you are running Ubuntu, the install is fast and easy.</p>
<pre class="console">codenomad@sparta:~$ sudo apt-get install subversion</pre>
<p>If you are running Fedora, you have a simple one line command as well:</p>
<pre class="console">codenomad@sparta:~$ sudo yum install subversion</pre>
<p><span style="font-size: x-small;">(Note: There is also a good graphical front-end to subversion for KDE called kdesvn that allows you to create and manage subversion repositories.  For now, lets do this the command line way, it&#8217;s pretty easy.)</span></p>
<p>We are now ready to start. You must first create a repository to store all of your configuration files for subversion, and, of course, your code.  I like keeping server information in my /var directory so lets create a subdirectory for subversion:</p>
<pre class="console">codenomad@sparta:~$ sudo mkdir -p /var/subversion/</pre>
<p>Now lets add the repository (Note: Standard security practices should be considered here. I&#8217;m creating a directory that I can have access to without requiring admin privileges):</p>
<pre class="console">codenomad@sparta:~$ sudo chown codenomad subversion
codenomad@sparta:~$ chmod 755 subversion
codenomad@sparta:~$ svnadmin create /var/subversion/my_project</pre>
<p>This should setup everything you need to get started. Go into the /var/subversion/my_project/conf folder and you should see some files:</p>
<pre class="console">codenomad@sparta:/var/subversion/my_project$ cd conf
codenomad@sparta:/var/subversion/my_project/conf$ ls
authz  passwd  svnserve.conf
codenomad@sparta:/var/subversion/my_project/conf$</pre>
<p>You will need to modify the passwd and svnserve.conf file with the usernames and passwords of those who need to have access to the repository.  First, lets modify the passwd file. Since the &#8216;#&#8217; are comment lines, lets remove those and add a user name (I will use codenomad as my username and supersecret as my password) :</p>
<pre class="console">### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret</pre>
<p>should now look something like this:</p>
<pre class="console">### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
codenomad = supersecret</pre>
<p>Now we need to modify the svnserve.conf file.  This file allows you to edit all the server specifics.  For this situation we will need to give authorization to codenomad and tell subversion to look for the user information (the user password) in the passwd file.  Looking at this file, you will note there is a [general] section.  This is where you need to give authorization to your users.</p>
<p>My section looks like:</p>
<pre class="console">[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
codenomad = write
# anon-access = read
# auth-access = write</pre>
<p>Just below the access section, uncomment this line:</p>
<pre class="console">password-db = passwd</pre>
<p>NOTE: Be sure when you make these modifcations, there should be NO spaces at the beginning of the lines. In other words, the c in codenomad lines up with the very first space of the file.  This will cause problems later on if you don&#8217;t take care</p>
<p>Now we can start the svn server in daemon mode giving it the root directory of our project:</p>
<pre class="console"> svnserve -d -r /var/subversion/my_project/</pre>
<p>Everything is now setup from the subversion side!</p>
<p>Since I use Eclipse for a good majority of my work I&#8217;ll use this new repository to house &#8220;My_Project&#8221;. If you don&#8217;t already have the Subversive plugin installed in Eclipse, go to Help &gt; Software Updates. Then from there, select the Available software tab, Click on Ganymede, and then expand Collaboration Tools. Select all the Subversive packages</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse1.png"><img class="size-medium wp-image-566 aligncenter" title="eclipse1" src="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse1.png" alt="" width="450" height="303" /></a></p>
<p>Then, on the right, you&#8217;ll need to click &#8220;Add site&#8221; and enter the plugin connectors information from <a href="http://www.polarion.com/products/svn/subversive.php?src=eclipseproject">Polarion&#8217;s website</a>:</p>
<p>http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site</p>
<p>This is needed to be able to connect to your subversion repository in Eclipse.  Hit okay, then select all the packages in that list:</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse3.png"><img class="size-medium wp-image-568 aligncenter" title="Screen shot of installing subversion connector" src="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse3.png" alt="" width="450" height="303" /></a></p>
<p style="text-align: left;">Next, hit install, accept the agreements, and then say okay to restart Eclipse.  Eclipse should then be ready to go and will be able to share your files.  Right click on your Project, select Team, and then select Share Project.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse-share.png"><img class="size-medium wp-image-565 aligncenter" title="Right Clicking on My_Project for Sharing" src="http://www.kallasoft.com/wp-content/uploads/2008/11/eclipse-share.png" alt="" width="450" height="303" /></a></p>
<p style="text-align: left;">Give the repository information (for this case it will be localhost since I am developing on the same box I am serving from).</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/share-my_project.png"><img class="size-medium wp-image-571 aligncenter" title="share-my_project" src="http://www.kallasoft.com/wp-content/uploads/2008/11/share-my_project.png" alt="" width="450" height="303" /></a></p>
<p style="text-align: left;">Enter your username and password that you stored in the passwd file in the next window. Then, to promote good practice, enter in a detailed message about the code you are about to commit.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/commit-options.png"><img class="size-medium wp-image-562 aligncenter" title="Commit Options and Message" src="http://www.kallasoft.com/wp-content/uploads/2008/11/commit-options.png" alt="" width="450" height="303" /></a></p>
<p style="text-align: left;">If you tweak your router settings or your firewall, you should be able to give access to others outside of your network and not just on this box.  For that you should open up or forward external 3690 to your box. When all is said and done, you should have your project stored in a repository available to share with others!  Happy Coding!</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/committed-source-tree.png"><img class="size-medium wp-image-563 aligncenter" title="This is the Committed Source Tree" src="http://www.kallasoft.com/wp-content/uploads/2008/11/committed-source-tree.png" alt="" width="450" height="303" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=CRnWN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=CRnWN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=mUeHN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=mUeHN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Wc44n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Wc44n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=vAnON"><img src="http://feeds.feedburner.com/~f/kallasoft?i=vAnON" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Sb4nn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Sb4nn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=PYeUN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=PYeUN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=MFZin"><img src="http://feeds.feedburner.com/~f/kallasoft?i=MFZin" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=46CQN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=46CQN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=LaEkn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=LaEkn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=TgKEN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=TgKEN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/456013807" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/how-to-setup-an-svn-server-to-use-in-eclipse/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fhow-to-setup-an-svn-server-to-use-in-eclipse%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/how-to-setup-an-svn-server-to-use-in-eclipse/</feedburner:origLink></item>
		<item>
		<title>Using host.allow and hosts.deny for Quick Network Security</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/451878400/</link>
		<comments>http://www.kallasoft.com/using-hostallow-and-hostsdeny-for-quick-security/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 15:19:30 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Servers]]></category>

		<category><![CDATA[DMZ]]></category>

		<category><![CDATA[firewall]]></category>

		<category><![CDATA[hosts.allow]]></category>

		<category><![CDATA[hosts.deny]]></category>

		<category><![CDATA[networking]]></category>

		<category><![CDATA[quick security]]></category>

		<category><![CDATA[restrict access]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=533</guid>
		<description><![CDATA[
While configuring a firewall is by far the best way to secure your system, there are times when you need a way to access a remote server that doesn&#8217;t compromise security.
A quick fix for boxes that need to be in the De Militarized Zone (DMZ) for a short period of time is to modify your [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/gnome-lockscreen.png"><img class="alignleft size-medium wp-image-534" style="float: left; margin-left: 8px; margin-right: 8px;" title="lock screen" src="http://www.kallasoft.com/wp-content/uploads/2008/11/gnome-lockscreen.png" alt="" width="77" height="77" /></a></p>
<p>While configuring a firewall is by far the best way to secure your system, there are times when you need a way to access a remote server that doesn&#8217;t compromise security.</p>
<p>A quick fix for boxes that need to be in the De Militarized Zone (DMZ) for a short period of time is to modify your <em>hosts.deny</em> and <em>hosts.allow</em> files, normally located in the /etc directory. Simply, and as you can probably gather from the filenames, the files will either deny or allow access to servers running on your box. The <em>hosts.deny</em> allows you to specify hostnames, IP addresses, or domains you wish to deny access and the <em>hosts.allow</em> will let you allow access.</p>
<p>For a quick, down and dirty configuration denying all access to your box make sure your <em>/etc/hosts.deny</em> has the following:</p>
<pre class="console">ALL: ALL</pre>
<p>With this simple addition your <em>/etc/hosts.deny</em> should look similar to this:</p>
<pre class="console"># /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
#                  See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: some.host.name, .some.domain
#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.

# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID
ALL:ALL</pre>
<p>Note: Similar to shell scripts the &#8220;#&#8221; is a comment line.  Also be sure to add an extra blank line at the bottom of the file.</p>
<p>Moving on, the <em>hosts.allow</em> has a lot more power with the default configuration because it will override anything that is listed in the <em>hosts.deny</em> file. Please take care to note the previous statement because the more information you know about which networks or IP&#8217;s you want to have access to your box the better. For now, lets say I want to connect to my computer at home when I am at work.  Before we can start, you&#8217;ll have to make sure your home server is placed in the DMZ area of your network.  Most routers have this feature built in so please check your manual for the specifics.</p>
<p>Let&#8217;s get started. At work I have the IP address 65.0.12.4. Since I only need SSH access from this location I can add</p>
<pre class="console">SSHD : 65.0.12.4</pre>
<p>Of course, I use my laptop at work and there are a pool of IP addresses that I can potentially get, in other words, I might not always get the same address &#8216;65.0.12.4&#8242;. So what can we do? Well, the <em>hosts.allow</em> file also gives you the ability to specify a complete domain. I can give access to systems at mycompany.com by adding the following:</p>
<pre class="console">SSHD : .mycompany.com</pre>
<p>Lets modify the <em>/etc/hosts.allow</em> file. Yours should look similar to this:</p>
<pre class="console"># /etc/hosts.allow: list of hosts that are allowed to access the system.
#                   See the manual pages hosts_access(5) and hosts_options(5).
#
# Example:    ALL: LOCAL @some_netgroup
#             ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
# for further information.
#
SSHD : 65.0.12.4, .mycompany.com</pre>
<p>Now I have access from any of the IP addresses that are from my company&#8217;s domain. This should give you the basic idea of how to restrict services on a remote server with these files. With a little more Google searching you should be able to find that you can restrict access to different types of servers as long as they are &#8216;wrapped&#8217; by TCP. In other words, pretty much any service compiled with the <em>libwrap.a</em> library can be restricted using this method.</p>
<p>You can read more about the <em>hosts.allow</em> and <em>hosts.deny</em> by looking at their manpages by entering the following in a terminal:</p>
<pre class="console">~$ man hosts.allow</pre>
<p>or</p>
<pre class="console">~$ man hosts.deny</pre>
<p>Of course this is not meant as a full time solution, but it does offer a quick fix for boxes that are on the open net for a limited time. Try it out, and let us know how it goes!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=9mMPN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=9mMPN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=7nCIN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=7nCIN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ID00n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ID00n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=0VTzN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=0VTzN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=YLr1n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=YLr1n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Ogp3N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Ogp3N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=WT2dn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=WT2dn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=fj04N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=fj04N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=oO3In"><img src="http://feeds.feedburner.com/~f/kallasoft?i=oO3In" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=jJApN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=jJApN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/451878400" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/using-hostallow-and-hostsdeny-for-quick-security/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fusing-hostallow-and-hostsdeny-for-quick-security%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/using-hostallow-and-hostsdeny-for-quick-security/</feedburner:origLink></item>
		<item>
		<title>Sockso Personal Music Server</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/444378086/</link>
		<comments>http://www.kallasoft.com/sockso-personal-music-server/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 13:44:51 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Servers]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[media server]]></category>

		<category><![CDATA[Open Source]]></category>

		<category><![CDATA[server]]></category>

		<category><![CDATA[service]]></category>

		<category><![CDATA[Sockso]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[streaming music]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=522</guid>
		<description><![CDATA[
If you have ever wanted to have access to your personal music collection from anywhere on the road Sockso Personal Music Server just might be the answer you were looking for. All that is required for the installation is Java and a Windows, Linux, or Mac box to run the server on. The software has [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/socksoplayer.png"><img class="aligncenter size-medium wp-image-527" title="Sockso player" src="http://www.kallasoft.com/wp-content/uploads/2008/11/socksoplayer.png" alt="" width="315" height="244" /></a></p>
<p>If you have ever wanted to have access to your personal music collection from anywhere on the road <a href="http://sockso.pu-gh.com/">Sockso Personal Music Server</a> just might be the answer you were looking for. All that is required for the installation is Java and a Windows, Linux, or Mac box to run the server on. The software has both a GUI for controlling the server, and a web interface for accessing your music remotely.  The software seems pretty robust, and is incredibly easy to set up.  Inside the zip file there is a batch file for double-clickability in Windows, a shell script that needs to be made executable for Linux or Unix, and an executable Jar for double-clickability in Mac OS X.</p>
<p>Both the web and server gui interfaces are pretty straight forward, and have quite a few features.  The server gui allows you to add Collections of music, create playlists, restricting access to users or to features like uploading music, and it even gives you the ability to specify an encoder for re-encoding your music for slower connections or for compatibility.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/11/socksowindows.png"><img class="size-medium wp-image-526 aligncenter" title="Sockso Running in Windows" src="http://www.kallasoft.com/wp-content/uploads/2008/11/socksowindows.png" alt="" width="450" height="320" /></a></p>
<p>The web interface can be seen below with the Sockso flash player along with a view of the Sockso server gui in Linux, and a custom playlist.</p>

<a href='http://www.kallasoft.com/sockso-personal-music-server/sockso-with-playlist/' title='Sockso with Playlist'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/sockso-with-playlist.png" width="150" height="107" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sockso-personal-music-server/socksoplayer/' title='Sockso player'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/socksoplayer.png" width="150" height="116" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sockso-personal-music-server/socksowindows/' title='Sockso Running in Windows'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/socksowindows.png" width="150" height="106" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sockso-personal-music-server/socksolinux/' title='socksolinux'><img src="http://www.kallasoft.com/wp-content/uploads/2008/11/socksolinux.png" width="150" height="84" class="attachment-thumbnail" alt="" /></a>

<p style="text-align: left;">If you&#8217;ve ever wanted a quick, easy way to setup a music server, or to just be able to have access to your personal music collection while on the road, Sockso might be a solution worth looking into.  It is lightweight, multi platform, and easy to use.  Just be sure to forward port 4444 from your router to your Sockso server, start up Sockso and you are good to go.  I haven&#8217;t seen an easier Open Source and multiplatform solution yet!</p>
<p style="text-align: left;">Check it out and let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=gkSCN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=gkSCN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=AHzEN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=AHzEN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=EfYyn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=EfYyn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=dkt6N"><img src="http://feeds.feedburner.com/~f/kallasoft?i=dkt6N" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Gh5wn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Gh5wn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=IT0eN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=IT0eN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=n2GWn"><img src="http://feeds.feedburner.com/~f/kallasoft?i=n2GWn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=7n6AN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=7n6AN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=KIG6n"><img src="http://feeds.feedburner.com/~f/kallasoft?i=KIG6n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=oPUyN"><img src="http://feeds.feedburner.com/~f/kallasoft?i=oPUyN" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/444378086" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/sockso-personal-music-server/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fsockso-personal-music-server%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/sockso-personal-music-server/</feedburner:origLink></item>
		<item>
		<title>Untangle offers VPN, Snort, Firewall, and Much More!</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/438295249/</link>
		<comments>http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 18:08:22 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Servers]]></category>

		<category><![CDATA[Linux Server]]></category>

		<category><![CDATA[OpenVPN]]></category>

		<category><![CDATA[Snort]]></category>

		<category><![CDATA[Untangle]]></category>

		<category><![CDATA[Virtualized Server]]></category>

		<category><![CDATA[Web Filter]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=173</guid>
		<description><![CDATA[
If you have ever been involved in setting up a small to mid size network that requires full access to roadwarriors, the ability to detect intrusions, and the need for a firewall, then you will know that it is no easy task.  The commercial cost of this alone is enough to consume your entire [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle-boot-screen.png"><img class="size-medium wp-image-508 aligncenter" title="Untangle Boot Screen" src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle-boot-screen.png" alt="" width="450" height="366" /></a></p>
<p>If you have ever been involved in setting up a small to mid size network that requires full access to roadwarriors, the ability to detect intrusions, and the need for a firewall, then you will know that it is no easy task.  The commercial cost of this alone is enough to consume your entire budget for the network, and quite possibly, eat into the budget you need to buy the computers to run on the network.  Try asking for that from a startup that can barely afford the computers!  Of course, there are many opensource solutions that can give you all of what you need for free, but with a one man IT shop expect many long nights and truck loads of hot pockets.</p>
<p>There is a quick and very cheap alternative: <a title="Untangle" href="http://www.untangle.com/" target="_blank">Untangle</a>.  Offering quite possibly the best free network solutions I have seen thus far, Untangle is the one stop shop for any networking requirement.  From VPN to intrusion detection, Untangle offers the best of the open source community and rolls it up into a very nice package that is easy to manage. The interface is clean, and each open source offering is presented as a rack mount server.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle.png"><img class="size-medium wp-image-504 aligncenter" title="untangle" src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle.png" alt="" width="450" height="340" /></a></p>
<p>Below you can see a wide variety of offerings (taken straight from their site) that are available for free, and some commercial offerings that help make the most of your Untangle server.</p>
<table style="height: 215px;" border="0" width="405" align="center">
<tbody>
<tr valign="top">
<td><strong>A list of Open Source offerings are below:</strong></p>
<ul>
<li>Web Filter</li>
<li>Spam Blocker</li>
<li>Spyware Blocker</li>
<li>Protocol Control</li>
<li>Virus Blocking</li>
<li>Phish Blocker</li>
<li>IPS</li>
<li>Attack Blocker</li>
<li>Firewall</li>
<li>OpenVPN</li>
<li>Untangle Reports</li>
<li>Routing and QoS</li>
</ul>
</td>
<td><strong>Commercial offerings below:</strong></p>
<ul>
<li>Live Support</li>
<li>AD Connector</li>
<li>Policy Manager</li>
<li>Kaspersky Virus Blocker</li>
<li>PC Remote</li>
<li>Remote Access Portal</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Don&#8217;t have a server to spare?  Not a problem, virtualization is the key.  Not only did the Untangle team spend countless hours creating such a seamless, feature rich product that encompasses some of the best of the open source world (and a few pay for goodies), they went the extra mile and wrote an amazing tutorial on how to get Untangle up and running in a virtual environment <a title="Untangle as Virtual Appliance on VMware" href="http://wiki.untangle.com/index.php/Untangle_Virtual_Appliance_on_VMware" target="_blank">here</a>.</p>
<p>Check it out, and let us know what you think!!</p>

<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/attack-blocker/' title='attack-blocker'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/attack-blocker.png" width="150" height="122" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/attack-blocker1/' title='attack-blocker1'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/attack-blocker1.png" width="150" height="112" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/untangle/' title='untangle'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle.png" width="150" height="113" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/untangle1/' title='untangle1'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle1.png" width="150" height="113" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/untangle3/' title='untangle3'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle3.png" width="150" height="113" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/untangle4/' title='untangle4'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle4.png" width="150" height="104" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/untangle-boot-screen/' title='Untangle Boot Screen'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/untangle-boot-screen.png" width="150" height="122" class="attachment-thumbnail" alt="" /></a>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=CsnLM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=CsnLM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Z7X0M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Z7X0M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=0WzYm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=0WzYm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=HiCdM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=HiCdM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=k8R4m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=k8R4m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=S9FbM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=S9FbM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=qzBqm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=qzBqm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Pa8KM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Pa8KM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=8tc7m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=8tc7m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=jWn2M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=jWn2M" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/438295249" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Funtangle-offers-vpn-snort-firewall-and-much-more%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/untangle-offers-vpn-snort-firewall-and-much-more/</feedburner:origLink></item>
		<item>
		<title>Handling Exceptions in Ruby</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/434662436/</link>
		<comments>http://www.kallasoft.com/handling-exceptions-in-ruby/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 12:35:44 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Exception handling]]></category>

		<category><![CDATA[exceptions]]></category>

		<category><![CDATA[Raising Exceptions]]></category>

		<category><![CDATA[Rescuing Exceptions]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[try catch]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=495</guid>
		<description><![CDATA[
Dealing with exceptions is a big part of any object oriented programmer&#8217;s job. We need to be able to recover from things like connect failures or syntax errors, and do so gracefully. Thankfully, raising and &#8220;rescuing&#8221; exceptions in Ruby is a fairly easy task.  Let&#8217;s start with a basic example.  We all know [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/ruby-logo.png"><img class="alignleft size-medium wp-image-496" style="float: left; margin-left: 8px; margin-right: 8px;" title="Ruby Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/10/ruby-logo.png" alt="" width="107" height="123" /></a></p>
<p>Dealing with exceptions is a big part of any object oriented programmer&#8217;s job. We need to be able to recover from things like connect failures or syntax errors, and do so gracefully. Thankfully, raising and &#8220;rescuing&#8221; exceptions in Ruby is a fairly easy task.  Let&#8217;s start with a basic example.  We all know that  dividing by zero is a <a href="http://www.wired.com/science/discoveries/news/1998/07/13987">very bad thing</a>, so lets tackle that scenario.</p>
<p>For fun let&#8217;s test this scenario out in irb. If you didn&#8217;t know already, irb is a ruby shell that allows you to execute ruby code on a line-per-line basis and is a great way of checking those one-liners. Lets fire it up and give you a very brief exposure to it.</p>
<p>Note: Ubuntu/Debian users, if you don&#8217;t have irb you can install it simply by running:</p>
<pre class="console">sudo apt-get install irb</pre>
<p>On to the goods&#8230; Open up your favorite terminal session and type in the following into an irb session:</p>
<pre class="console">i=1
i/0</pre>
<p>Your output should look like this:</p>
<pre class="console">codenomad@sparta:~$ irb
irb(main):001:0&gt; i=1
=&gt; 1
irb(main):002:0&gt; i/0
ZeroDivisionError: divided by 0
  from (irb):2:in `/'
  from (irb):2</pre>
<p>As you can see you can assign values to a variable, and perform a quick operation on it in irb.  You can go ahead and quit irb by typing in &#8220;quit&#8221;, and we&#8217;ll start writing a script to catch this troublemaking scenario.</p>
<p>Handing exceptions in Ruby is referred to as &#8220;Rescuing&#8221;.  In Ruby to rescue exceptions we need to surround our trouble code with a begin/end statement. Below you&#8217;ll find that I&#8217;ve surrounded our divide by zero scenario by this begin/end structure, and rescued the exception by putting a rescue clause right before the &#8216;end&#8217;. Add the following to a file called rescue.rb:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
begin
  i = 1
  i/0
  rescue ZeroDivisionError
    puts "you divided by zero putts"
end</pre>
<p>Make the file executable and let&#8217;s run it:</p>
<pre class="console">~$ chmod +x rescue.rb
~$ ./rescue.rb
you divided by zero putts
~$</pre>
<p>What if you just wanted to rescue any type of standard error?  Well, lets modify our script again to rescue a file open error using StandardError:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
begin
  i = 1
  File.open("ABSsdt.xyz")
  i/0
  rescue ZeroDivisionError
    puts "you divided by zero putz"
  rescue StandardError
    puts "you had an error of some sort"
end</pre>
<p>Run it, and you should get something like this:</p>
<pre class="console">~$ ./rescue.rb
you had an error of some sort</pre>
<p>Be sure to check the Ruby documentation when writing your code, and you can see what exceptions can be through by different method calls. (ie look at the <a href="http://www.ruby-doc.org/core/classes/Array.html#M002186">Array.fetch() method call.</a> )</p>
<p>Now that you know how to rescue exceptions and where to look for the types of exceptions a method call can make, what about raising exceptions?  Well, thats just as easy lets make a new script named raise.rb and add the following:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
begin
 if (File.exist? "file_1.rb")
  puts "file found"
 else
  raise "File not found"
 end
end</pre>
<p>If you don&#8217;t have file_1.rb in your running directory, this code will raise an exception!  It&#8217;s as easy as that! For a quick list of exceptions check out <a href="http://www.zenspider.com/Languages/Ruby/QuickRef.html#34">Zenspider&#8217;s QuickRef site</a>. At this point you have a basic idea of how to handle exceptions, whether you raise them or rescue them, in Ruby. Get out there and get scripting, and be sure to let us know how it goes!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=Q2VKM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Q2VKM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=67ckM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=67ckM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=KTgdm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=KTgdm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=oICEM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=oICEM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=gHhUm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=gHhUm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=aTaYM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=aTaYM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=X20Em"><img src="http://feeds.feedburner.com/~f/kallasoft?i=X20Em" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=bxyWM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=bxyWM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=DO14m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=DO14m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=n8hOM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=n8hOM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/434662436" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/handling-exceptions-in-ruby/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fhandling-exceptions-in-ruby%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/handling-exceptions-in-ruby/</feedburner:origLink></item>
		<item>
		<title>Setting up Apache Tomcat 6.x and ZK in Ubuntu</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/433883755/</link>
		<comments>http://www.kallasoft.com/setting-up-apache-tomcat-6x-and-zk-in-ubuntu/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 18:58:11 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Servers]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Java Server Pages]]></category>

		<category><![CDATA[JSP]]></category>

		<category><![CDATA[Tomcat 6]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=481</guid>
		<description><![CDATA[Apache Tomcat is the name in JSP, and you&#8217;ll need to get a copy before being able to try out the many cool web applications and frameworks out there (like ZKoss&#8217;s ZK).  Finding a development need to run JSP pages (and wanting to try out ZK), I decided to get the latest Tomcat version [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tomcat.apache.org/"><img class="alignleft size-medium wp-image-482" style="float: left; margin-left: 8px; margin-right: 8px;" title="Tomcat Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcat.gif" alt="" width="130" height="92" /></a>Apache Tomcat is <em>the</em> name in JSP, and you&#8217;ll need to get a copy before being able to try out the many cool web applications and frameworks out there (like <a title="ZK" href="http://www.kallasoft.com/zk-351-released-ria-framework-netbeans-plugin-and-tutorial/" target="_blank">ZKoss&#8217;s ZK</a>).  Finding a development need to run JSP pages (and wanting to try out ZK), I decided to get the latest Tomcat version (<small>6.0.18</small>) installed, and give you the scoop on getting it up and running.  It is a pretty easy install, you just need to have Java 6.  If you are running Ubuntu, the easiest way is to run a simple apt-get install:</p>
<pre class="console">$ sudo apt-get install sun-java6-jdk</pre>
<p>I really like to have full control over my development environments, so I&#8217;m not going to grab Tomcat using apt (besides, I said the latest version). Go ahead and grab a zipped copy of the core distribution from the <a title="Apache Tomcat website" href="http://tomcat.apache.org/download-60.cgi" target="_blank">Tomcat website</a>. Now that you have the latest and greatest lets unzip the contents of your .zip into a /usr/local/tomcat folder.</p>
<pre class="console">~$ unzip apache-tomcat-6.0.18.zip
~$ sudo mv apache-tomcat-6.0.18 /usr/local/tomcat</pre>
<p>Now, before we can start the Tomcat server, we&#8217;ll need to make some of the script files executable (note: if you downloaded the tar.gz archive instead, these scripts might already have the executable bit on. To avoid any potential snags, I&#8217;d issue these regardless of which compressed file you downloaded).</p>
<pre class="console">~$ cd /usr/local/tomcat/bin
~$ sudo chmod +x *.sh</pre>
<p>Since I&#8217;d like to check out the neat framework demo <a title="ZKoss Download Site" href="http://www.zkoss.org/download/" target="_blank">ZK has</a>, I need to be able to deploy their WAR in my webapps.  To make deploying point and click, I&#8217;ll be using the Tomcat Manager. If you want to use the Tomcat Manager you&#8217;ll need to modify the users and roles specified in the tomcat-users.xml file located in the /usr/local/tomcat/conf folder.  Modify this xml file to have something similar to what is below.  Be sure to change username to something more creative and change the password (I don&#8217;t suggest using your real password considering this is a flat file). The file should contains something like this;</p>
<pre class="console">&lt;tomcat-users&gt;
  &lt;role rolename="manager"/&gt;
  &lt;role rolename="tomcat"/&gt;
  &lt;role rolename="admin"/&gt;
  &lt;user username="codenomad" password="supersecret" roles="tomcat,admin,manager"/&gt;
  &lt;user username="admin" password="secret" roles="manager,admin"/&gt;
&lt;/tomcat-users&gt;</pre>
<p>That should just about do it.  Let&#8217;s start up the server by running:</p>
<pre class="console">~$ sudo /usr/local/tomcat/bin/startup.sh</pre>
<p>You can test your install by clicking <a title="Apache install" href="http://localhost:8080" target="_blank">here</a>. You should see something like this:</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen.png"><img class="aligncenter size-medium wp-image-486" title="Tomcat Server Screen" src="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen.png" alt="" width="450" height="425" /></a></p>
<p>If you need to shutdown the server you can issue a similar command:</p>
<pre class="console">~$ sudo /usr/local/tomcat/bin/shutdown.sh</pre>
<p>Now that we have Tomcat installed, lets check out that ZK demo I was talking about.  First, you&#8217;ll need a couple things. You&#8217;ll need the ZK binary and the ZK demo.  Download both of those <a href="http://www.zkoss.org/download/">here</a>.</p>
<p>Unzip those files and copy the .jar&#8217;s over to your Tomcat library (this will allow you to include all of the greatness that is ZK in your future webapps).</p>
<pre class="console">~$ unzip zk-bin-prof-3.5.1.zip
~$ unzip zk-demo-3.5.1.zip
~$ cd zk-bin-prof-3.5.1/dist/lib
~$ sudo cp *.jar /usr/local/tomcat/lib/
~$ sudo cp ext/*.jar /usr/local/tomcat/lib
~$ sudo cp zkforge/*.jar /usr/local/tomcat/lib</pre>
<p>Next, you&#8217;ll have to restart your Tomcat server:</p>
<pre class="console">~$ sudo /usr/local/tomcat/bin/shutdown.sh
~$ sudo /usr/local/tomcat/bin/startup.sh</pre>
<p>Head back to the Tomcat page <a title="Apache install" href="localhost:8080" target="_blank">here</a>, and click on the Tomcat Manager link in the top left. Enter in the username and password you modified in the XML file above, and scroll to the very bottom where it says &#8220;WAR file to deploy&#8221;.  Click browse, and find the zkdemo.war file in the unzipped zk-demo-3.5.1 folder that was unzipped earlier.</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen3.png"><img class="aligncenter size-medium wp-image-487" title="Tomcat Deploy Snippet Screenshot" src="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen3.png" alt="" width="450" height="56" /></a></p>
<p>Next, click on the Deploy button.  You should see that the zkdemo is now in the Applications list, and if you click on the link that Tomcat provides you&#8217;ll get a welcome screen:</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen2.png"><img class="aligncenter size-medium wp-image-488" title="ZK Demo Welcome screen" src="http://www.kallasoft.com/wp-content/uploads/2008/10/tomcatscreen2.png" alt="" width="450" height="167" /></a></p>
<p>Thats it!  You have a fully functional Tomcat Server, and you can start developing with the ZK platform!  Check out <a href="http://www.zkoss.org/support/training/webinar/zkintro.dsp">ZK&#8217;s site</a> for more development information.  Good luck, and happy coding!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=zwjWM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=zwjWM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=cBmzM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=cBmzM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=8IsEm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=8IsEm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=iRCAM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=iRCAM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=mcrKm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=mcrKm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=uYwMM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=uYwMM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=6TY6m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=6TY6m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=NWbsM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=NWbsM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=VrkHm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=VrkHm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=3v1GM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=3v1GM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/433883755" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/setting-up-apache-tomcat-6x-and-zk-in-ubuntu/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fsetting-up-apache-tomcat-6x-and-zk-in-ubuntu%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/setting-up-apache-tomcat-6x-and-zk-in-ubuntu/</feedburner:origLink></item>
		<item>
		<title>Linux Alternatives to Apple’s Time Machine</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/430302584/</link>
		<comments>http://www.kallasoft.com/linux-alternatives-to-apples-time-machine/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 03:46:42 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Back-In-Time]]></category>

		<category><![CDATA[Backup]]></category>

		<category><![CDATA[Flyback]]></category>

		<category><![CDATA[Mac OS X]]></category>

		<category><![CDATA[Snapshot]]></category>

		<category><![CDATA[Time Machine]]></category>

		<category><![CDATA[TimeVault]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=444</guid>
		<description><![CDATA[Have you ever caught yourself drooling over Apples Time Machine, but just couldn&#8217;t bare jumping ship to MacOS X?  You are in luck because you have a few projects to choose from.  Most of these applications use rsync (a filesyncing program for *nix) and cron (a task scheduler) to mimic the characteristics of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/timemachine_icon20071016.png"><img class="alignnone size-medium wp-image-445" style="float: left; margin-left: 8px; margin-right: 8px;" title="Time Machine Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/10/timemachine_icon20071016.png" alt="" width="86" height="86" /></a>Have you ever caught yourself drooling over Apples Time Machine, but just couldn&#8217;t bare jumping ship to MacOS X?  You are in luck because you have a few projects to choose from.  Most of these applications use rsync (a filesyncing program for *nix) and cron (a task scheduler) to mimic the characteristics of Time Machine.</p>
<p>A savvy scripter could get similar features using these tools, but space for maintain backups can really become an issue.  From my experience, there are 3 main gui driving projects out there: <a href="https://wiki.ubuntu.com/TimeVault">Timevault</a>, <a href="http://code.google.com/p/flyback/">Flyback</a>, and <a href="http://www.le-web.org/back-in-time/">Back-In-Time</a>.</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/popupnotification-timevault.png"><img class="size-medium wp-image-450 aligncenter" title="Popup Notification for TimeVault in Ubuntu" src="http://www.kallasoft.com/wp-content/uploads/2008/10/popupnotification-timevault.png" alt="" width="351" height="156" /></a></p>
<p>TimeVault, an integrated, and advanced backup utility that is currently in <a href="https://launchpad.net/timevault">launchpad for Ubuntu</a>, offers features comparable to Time Machine.  It includes pop up notifications and a snapshot browser that allows you to filter search results.  On top of that you are even given a graphical representation of a file change at the very top of the snapshot browser.</p>
<p>For those wishing everything to be maintained by the Operating System, this seems like a pretty solid choice and doesn&#8217;t skimp on the details when needed.  It is probably the best bet when looking for a solution that is system integrated, and for those looking to come as close to Apple&#8217;s Time Machine as possible (minus the eyecandy).</p>
<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/snapshotbrowser-timevault.png"><img class="size-medium wp-image-451 aligncenter" title="snapshotbrowser-timevault" src="http://www.kallasoft.com/wp-content/uploads/2008/10/snapshotbrowser-timevault.png" alt="" width="450" height="355" /></a><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/snapshotbrowser-timevault.png"><br />
</a></p>
<p>Above you can see a screenshot of TimeVault&#8217;s snapshot browser, including the aforementioned representation of file changes.  The next couple of solutions feel a bit more hands on, that&#8217;s probably because they don&#8217;t have the tight system integration that TimeVault does.</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/screenshot-flyback.jpg"><img class="size-medium wp-image-452 alignnone" style="float: left; margin-left: 8px; margin-right: 8px;" title="Flyback Screenshot" src="http://www.kallasoft.com/wp-content/uploads/2008/10/screenshot-flyback.jpg" alt="" width="201" height="206" /></a>Flyback and Back-In-Time are the two other frontends I spoke of.  Using rsync and cron to maintain backups, they both maintain pretty similar features.</p>
<p>Both applications have snapshot capabilities, and have the basic usermode backup where a filesystems/folder with write permission can be backed up and restored.   Their main windows are pretty straight forward and give you the standard views of timestamped snapshots for a given folder structure.</p>
<p>Each application can schedule when a backup is to take place and when backups are deleted. Of course you don&#8217;t want all those /tmp files so each application gives you the ability to enter exclude parameters for backups.</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/mainwindow-back-in-time.png"><img class="alignnone size-medium wp-image-453" style="float: right; margin-left: 8px; margin-right: 8px;" title="Back In Time Screenshot" src="http://www.kallasoft.com/wp-content/uploads/2008/10/mainwindow-back-in-time.png" alt="" width="266" height="167" /></a></p>
<p>It all comes down to preference, and with multiple products out we have the best thing possible: choice.</p>
<p>While TimeVault offers features comparable to Time Machine and system integration, Flyback and Back-In-Time might be easier to dive into for some homebrew modifications.  You can check out TimeVault <a href="https://wiki.ubuntu.com/TimeVault">here</a>, Back-In-Time <a href="http://www.le-web.org/back-in-time/">here</a>, or Flyback <a href="http://flyback-project.org/">here</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=sijlM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=sijlM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=gTmtM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=gTmtM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=MoT2m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=MoT2m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=bdDvM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=bdDvM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=pehum"><img src="http://feeds.feedburner.com/~f/kallasoft?i=pehum" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=npGGM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=npGGM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=FHVum"><img src="http://feeds.feedburner.com/~f/kallasoft?i=FHVum" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=bchnM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=bchnM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=4C6km"><img src="http://feeds.feedburner.com/~f/kallasoft?i=4C6km" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=L2dLM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=L2dLM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/430302584" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/linux-alternatives-to-apples-time-machine/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Flinux-alternatives-to-apples-time-machine%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/linux-alternatives-to-apples-time-machine/</feedburner:origLink></item>
		<item>
		<title>Stream Your Video Feeds with Palantir</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/429069237/</link>
		<comments>http://www.kallasoft.com/stream-your-video-feeds-with-palantir/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 23:57:50 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[daemon]]></category>

		<category><![CDATA[monitoring software]]></category>

		<category><![CDATA[Palantir]]></category>

		<category><![CDATA[project]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[streaming]]></category>

		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=428</guid>
		<description><![CDATA[Snapshot from palantir.santinoli.com:

Over the past couple of weeks I&#8217;ve dabbled with the idea to add a webcam to my personal site that monitored a couple of pet furballs.  The task was not too straight forward.  I ran into many hiccups with alpha software and missing libraries.  Most of the software related to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">Snapshot from palantir.santinoli.com:<br />
<a href="http://www.fastpath.it/products/palantir/index.php"><img class="aligncenter" src="http://palantir.santinoli.com:14334/?mode=single" alt="[Snapshot]" /></a></p>
<p>Over the past couple of weeks I&#8217;ve dabbled with the idea to add a webcam to my personal site that monitored a couple of pet furballs.  The task was not too straight forward.  I ran into many hiccups with alpha software and missing libraries.  Most of the software related to setting up a webcam server was severely outdated, and hadn&#8217;t received an update in many months.  I tried <a href="http://linuxbrit.co.uk/camE/">camE</a> and webcam (the two most standard daemon webcam servers), but they required far more thought in the security realm than I would have liked to invest in the project.</p>
<p>Minutes from assuming all was lost, I ran into a nice little piece of software named <a title="Palantir website" href="http://www.fastpath.it/products/palantir/index.php" target="_blank">Palantir</a> (yes, after that crystal ball thing in Lord of the Rings).  The program was built with performance in mind, and can handle a fair  load with old hardware.  Offering streaming pix, sound, and even the ability to control (assuming you have the hardware) the motion of a camera, my search was finally at an end.</p>
<p>Adding a stream to my website was as easy as embedding an image in my webserver index.html file, and starting up the Palantir server. All you need is the address of the box running the server, and modifying the following line (replacing the 192.168.0.20 ip with your server&#8217;s address):</p>
<pre class="console">&lt;<span class="start-tag">img</span><span class="attribute-name"> border</span>=<span class="attribute-value">"1" </span><span class="attribute-name">src</span>=<span class="attribute-value">"http://192.168.0.20:3000/" </span><span class="attribute-name">alt</span>=<span class="attribute-value">"[Live stream]"</span>&gt;</pre>
<p>You instantly have a live feed that will stay alive for the default 120 seconds.  The project also gives you the ability to use a stand alone client instead of a browser to stream your shots (choose from a native QT linux app, a Java app, or even a Windows app).</p>
<p>You can see a demo stream where the above snapshot was taken at the Palantir site <a href="http://www.fastpath.it/products/palantir/demo_video.php?s=palantir.santinoli.com&amp;p=14334&amp;t=120">here</a>. Check it out, and let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=qSECM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=qSECM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=QpUOM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=QpUOM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=SeS6m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=SeS6m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=M5MOM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=M5MOM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=yjuPm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=yjuPm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Tmv2M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Tmv2M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=yJp1m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=yJp1m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=1v7fM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=1v7fM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=fC6wm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=fC6wm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=PKXQM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=PKXQM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/429069237" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/stream-your-video-feeds-with-palantir/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fstream-your-video-feeds-with-palantir%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/stream-your-video-feeds-with-palantir/</feedburner:origLink></item>
		<item>
		<title>Sneak Peak at KDE 4.2</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/427440891/</link>
		<comments>http://www.kallasoft.com/sneak-peak-at-kde-42/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 12:57:34 +0000</pubDate>
		<dc:creator>Riyad Kalla</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[desktop]]></category>

		<category><![CDATA[KDE 4.2]]></category>

		<category><![CDATA[screenshots]]></category>

		<category><![CDATA[sneak peak]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=413</guid>
		<description><![CDATA[
polishlinux.org has put together a great sneak-peak at the current incarnation of what will become KDE 4.2 directly from the SVN repo.
Overall 4.2 is looking to be a natural evolution to 4.1, which was a surprising leap over 4.0 from a user&#8217;s perspective given how disappointingly 4.0 was received from the end-user community (4.0 laid [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-dolphin-file-manager.png"><img class="size-medium wp-image-416 aligncenter" title="kde-42-screenshot-dolphin-file-manager" src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-dolphin-file-manager.png" alt="" width="449" height="313" /></a></p>
<p><a href="http://polishlinux.org/kde/quick-look-at-kde-42-svn/">polishlinux.org</a> has put together a great sneak-peak at the current incarnation of what will become KDE 4.2 directly from the SVN repo.</p>
<p>Overall 4.2 is looking to be a natural evolution to 4.1, which was a surprising leap over 4.0 from a user&#8217;s perspective given how disappointingly 4.0 was received from the end-user community (4.0 laid all the technical groundwork for the infrastructure, but still had a lot of UI rough edges that were all ironed out in 4.1).</p>
<p>Dolphin has gotten some minor tweaks and enhancements to make it a better everyday file manager like GNOME has or Finder, leaving Konqueror to be the browser (or advanced file manager for folks that liked that more complex interface).</p>
<p>Improvements to Konqueror include back-ported SVG support from WebKit along with KJS (KDE JavaScript Engine) and KHTML (KDE HTML Rendering Engine) seeing improvements inline with the WebKit work as well to improve rendering speed.</p>
<p>Okular has replaced KPDF as the default viewer for PDF, CHM, DJVU and graphic files.</p>
<p>Improvements to the Plasma manager and it&#8217;s embeddable components, Plasmoids, has been done but there are still instabilities there. Kickoff4 can be integrated as a Plasmoid and has some additional searching enhancements (that are a little wonky right now).</p>
<p>The author, Piotr, recommends people wait for the 4.2.1 release of KDE if they are planning on switching. <em>This</em> author cannot help but appreciate the irony of that statement given he has read that, and adhered to it, since he first got into Linux almost 10 years ago&#8230; &#8220;XYZ is looking awesome, but wait for the patch release ABC&#8230;&#8221;</p>
<p>As far as I can tell, Linux has been <em>almost</em> great on the desktop for 10 years, but continues to loose the battle against Audio, Video and Gaming which keeps it out of the mainstream every single time.</p>
<p>I also fully expect 100 people to tell me why I&#8217;m wrong&#8230; I was one of you from 1998 until about 2005 when I finally realized that Linux would never <em>really</em> be dominant on the desktop because it cannot deliver what the majority of people want.</p>
<p>That&#8217;s not saying it doesn&#8217;t deliver a great experience to some people&#8230; those people will post here <em>rabidl</em> about why it&#8217;s superior, but it still cannot deliver the experience that <strong>most</strong> people want.</p>
<p>I&#8217;d suggest waiting for the patch release <img src='http://www.kallasoft.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-amarok-juk-mp3-players/' title='kde-42-screenshot-amarok-juk-mp3-players'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-amarok-juk-mp3-players.png" width="150" height="84" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-dolphin-ark-desktop/' title='kde-42-screenshot-dolphin-ark-desktop'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-dolphin-ark-desktop.jpg" width="150" height="93" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-dolphin-file-manager/' title='kde-42-screenshot-dolphin-file-manager'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-dolphin-file-manager.png" width="150" height="104" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-kget-download-manager/' title='kde-42-screenshot-kget-download-manager'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-kget-download-manager.png" width="150" height="84" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-kickoff-4/' title='kde-42-screenshot-kickoff-4'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-kickoff-4.png" width="150" height="63" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.kallasoft.com/sneak-peak-at-kde-42/kde-42-screenshot-okular/' title='kde-42-screenshot-okular'><img src="http://www.kallasoft.com/wp-content/uploads/2008/10/kde-42-screenshot-okular.png" width="150" height="91" class="attachment-thumbnail" alt="" /></a>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=HyMPM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=HyMPM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=lB3MM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=lB3MM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=mD27m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=mD27m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Q83dM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Q83dM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=UCQFm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=UCQFm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=9XpiM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=9XpiM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=8VFcm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=8VFcm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=BsNCM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=BsNCM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=E1GQm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=E1GQm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=esZzM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=esZzM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/427440891" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/sneak-peak-at-kde-42/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fsneak-peak-at-kde-42%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/sneak-peak-at-kde-42/</feedburner:origLink></item>
		<item>
		<title>Using Namespaces in C#</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/421800083/</link>
		<comments>http://www.kallasoft.com/using-namespaces-in-csharp/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 17:51:34 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[alias]]></category>

		<category><![CDATA[aliasing namespace]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[global::]]></category>

		<category><![CDATA[Mono]]></category>

		<category><![CDATA[Namespace]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=380</guid>
		<description><![CDATA[As we&#8217;ve seen briefly in a previous example, namespaces in C# can give a project some useful ways to organize code.  The most common example of where namespaces are useful is what I&#8217;ve dubbed the &#8220;System&#8221; example.  A quick google on C# namespace will land you a ton of results showing a basic [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-thumbnail wp-image-70" style="float: left; margin-left: 8px; margin-right: 8px;" title="mono-c-sharp" src="http://www.kallasoft.com/wp-content/uploads/2008/10/mono_logo.png" alt="" width="86" height="104" />As we&#8217;ve seen briefly in a previous example, namespaces in C# can give a project some useful ways to organize code.  The most common example of where namespaces are useful is what I&#8217;ve dubbed the &#8220;System&#8221; example.  A quick google on C# namespace will land you a ton of results showing a basic example.  Lets go over a common basic example, and talk about some of the features to resolve conflicts.  </p>
<p>First, lets explain what a namespace is.  <a href="http://www.kallasoft.com/a-quick-intro-into-csharp/">In my previous article</a>, I described a namespace as a tool shed that can house many tools.  If you exist in the too shed you have the ability to use a hammer object or a saw object that exist in the same shed.  You can have multiple sheds, and even sheds within sheds. Now that you understand the concept here is the basic example:</p>
<pre name="code" class="java">
using System;
class MyCoolApp
{
    public class System { }

    public static void Main()
    {
		System.Console.WriteLine("Write me!");
    }
}
</pre>
<p>You should notice that the namespace you are using is System.  You will also notice that the class  name is System as well.  If you were to compile this you would get an error:</p>
<pre class="console">
MyCoolApp.cs(8,24): error CS0117: `MyCoolApp.System' does not contain a definition for `Console'
MyCoolApp.cs(4,18): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
</pre>
<p>{smartads}</p>
<p>You can see that the class System inside of MyCoolApp is found before the System namespace or, as Microsoft puts it, &#8220;hidden by the class&#8221; MyCoolApp.System.  </p>
<p>There is a quick feature to get around this issue, and is usually refered to as the global:: operator.  This gives a programmer access to specify the global namespace.  In other words, this will give us access to C# System namespace instead of trying to overriding the System call with our own System class. </p>
<p>To use the global:: operator change the above example to:</p>
<pre name="code" class="java">
using System;
class MyCoolApp
{
    public class System { }

    public static void Main()
    {
		global::System.Console.WriteLine("Write me!");
    }
}
</pre>
<p>This modified example should now be able to compile run.  There is also another feature of namespaces that could help with avoiding this issue and improve the readability of your code.  That feature is called aliasing, and, like the global:: operator, you can refer to classes inside the namespace using the double colon notation.</p>
<p>Say you want to create an alias of the default C# System namespace and give it the name SysAlias. You could rewrite the example above to look like this:</p>
<pre name="code" class="java">
using SysAlias = System;
class MyCoolApp
{
    public class System { }

    public static void Main()
    {
		SysAlias::Console.WriteLine("Write me!");
    }
}
</pre>
<p>Notice that the global System.Console can be reached properly using this method. This may not look very helpful at first glance, but it can really help if you have many levels of namespaces. For example, you can improve code readability by aliasing the following class structure:</p>
<pre class="console">
Transportation.Vehicles.Automobiles.FourDoor.ManualTransmission
</pre>
<p>to be referenced by an alias like &#8220;FourDoorManual&#8221; if you use the following:</p>
<pre class="console">
using FourDoorManual = Transportation.Vehicles.Automobiles.FourDoor.ManualTransmission;
</pre>
<p>In the end, namespaces will allow you to eliminate the need to fully qualify classes such as System.Console or Transportation.Vehicles.Automobiles.FourDoor.ManualTransmission, and they offer a nice way of organizing code. I can see this being a very useful coding technique for keeping your code understandable, without sacrificing. I can even see it being a great feature to use when you want to debug or unit test your code (think modifying your namespace to use a simulator framework&#8230;). Try it out and let us know if you find some more interesting uses!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=JhtWM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=JhtWM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=xI6gM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=xI6gM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=pA2Zm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=pA2Zm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=4hwiM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=4hwiM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=xFthm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=xFthm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=zJYzM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=zJYzM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=cmZGm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=cmZGm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=HrR3M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=HrR3M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Iq2zm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Iq2zm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=Vi0yM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=Vi0yM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/421800083" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/using-namespaces-in-csharp/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fusing-namespaces-in-csharp%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/using-namespaces-in-csharp/</feedburner:origLink></item>
		<item>
		<title>Add Logging to Ruby Scripts with Log4r</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/420642590/</link>
		<comments>http://www.kallasoft.com/add-logging-to-ruby-scripts-with-log4r/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 15:37:33 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[apache log4j]]></category>

		<category><![CDATA[java logging]]></category>

		<category><![CDATA[Log4j]]></category>

		<category><![CDATA[Log4r]]></category>

		<category><![CDATA[logging]]></category>

		<category><![CDATA[logging ruby]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=336</guid>
		<description><![CDATA[Log4r is a logging library inspired by Apache Foundation&#8217;s Log4j, &#8220;but is not a direct implementation or clone.&#8221;  Of course this doesn&#8217;t change the fact that log4r is a very efficient, fast, and easy to use library. I&#8217;m going give a quick tutorial how to add logging capabilities to your Ruby scripts using Log4r. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://log4r.sourceforge.net/"><img class="alignnone size-medium wp-image-143" style="float: left; margin-left: 8px; margin-right: 8px;" title="log4r-logo" src="http://www.kallasoft.com/wp-content/uploads/2008/10/log4r-logo.png" alt="" width="167" height="60" /></a><a href="http://log4r.sourceforge.net/">Log4r</a> is a logging library inspired by Apache Foundation&#8217;s <a href="http://logging.apache.org/log4j/1.2/index.html">Log4j</a>, &#8220;but is not a direct implementation or clone.&#8221;  Of course this doesn&#8217;t change the fact that log4r is a very efficient, fast, and easy to use library. I&#8217;m going give a quick tutorial how to add logging capabilities to your Ruby scripts using Log4r. First, let&#8217;s get everything we need installed and then I&#8217;ll show how I added logging capabilities to fibonacci Ruby script I&#8217;ve written in a previous post.</p>
<p>We have two basic ways of installing the log4r library.  We can either install directly by grabbing the source or we can install using ruby-gems.</p>
<p>To install using the source head on over to the Sourceforge <a href="http://sourceforge.net/project/showfiles.php?group_id=43396">download page</a>.</p>
<p>Extract the .zip or .tar.gz, enter the directory, and issue the install command</p>
<pre class="console">~$unzip log4r-1.0.5.zip
~$ cd log4r-1.0.5/
~/log4r-1.0.5$ sudo ruby install.rb</pre>
<p>To install using ruby-gems, first make sure you have gems installed:</p>
<pre class="console">~$ sudo apt-get install rubygems</pre>
<p>Then install the library:</p>
<pre class="console">~$ sudo gem install Log4jr</pre>
<p>This should get you everything you need to get started.  Now, lets look at the previously written<br />
script:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
require 'time'

puts "starting fibonacci"

def fib(num)
 if(num &lt; 2)
   return 1
 else
   return fib(num-1) + fib(num-2)
 end
end

if ARGV[0] != nil
 if (ARGV[0].to_i &gt;= 35)
  puts "This might take a bit...."
 end
 start = Time.now
 puts fib(ARGV[0].to_i)
 stop = Time.now - start
 puts "Finding the fib of #{ARGV[0]} took:"
 puts stop
 puts "seconds"
end</pre>
<p>We will need to add:</p>
<pre name="code" class="ruby">require 'log4r'
include Log4r</pre>
<p>to the top to get access to the Log4r library.</p>
<p>Then we will need to create a logger. We&#8217;ll do this by adding another method to setup the global<br />
logger. You can do this by adding:</p>
<pre name="code" class="ruby">def setupLogger()
  # create a logger
  @logger = Logger.new 'logger'
  @logger.outputters = Outputter.stdout
  @logger.debug "Logger is now setup"
end</pre>
<p>{smartads}</p>
<p>to just before the fib() method call in your script.</p>
<p>Normally, I would set this up in an initialize method (for those unfamiliar with Ruby, this is like a<br />
constructor method), but we&#8217;ll keep this simple for later examples.</p>
<p>I&#8217;m also going to replace all of the standard out (ie &#8220;puts&#8221;) messages, and<br />
replace them to be logged with the DEBUG logger.  Replace all &#8216;puts&#8217; messages with &#8220;@logger.debug&#8221;.</p>
<p>For instance:</p>
<pre class="console">puts "Finding the fib of #{ARGV[0]} took: #{stop} seconds"</pre>
<p>should now look like this:</p>
<pre class="console">@logger.debug "Finding the fib of #{ARGV[0]} took: #{stop} seconds"</pre>
<p>Of course, we still want feedback from our program so let&#8217;s change the logger to output directly<br />
to the console.  You can actually see that this is already being done with this line:</p>
<pre class="console">  @logger.outputters = Outputter.stdout</pre>
<p>After all of your edits, your script should now look like this:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
require 'time'
require 'log4r'
include Log4r

def setupLogger()
  # create a logger
  @logger = Logger.new 'logger'
  @logger.outputters = Outputter.stdout
  @logger.debug "Logger is now setup"
end

def fib(num)
 if(num &lt; 2)
   return num
 else
   return fib(num-1) + fib(num-2)
 end
end

#start of main script
@logger.debug "starting fibonacci"

if ARGV[0] != nil
 if (ARGV[0].to_i &gt;= 35)
  @logger.debug "This might take a bit...."
 end
 setupLogger()
 start = Time.now
 @logger.debug fib(ARGV[0].to_i)
 stop = Time.now - start
 @logger.debug "Finding the fib of #{ARGV[0]} took: "
 @logger.debug "#{stop}"
 @logger.debug "seconds"
end</pre>
<p>If you try and run your script at this point you&#8217;ll notice an &#8220;undefined method `info&#8217; for nil:NilClass (NoMethodError)&#8221; error.  This is because you haven&#8217;t setup the logger before you started debugging.  Lets move this log line to after the setupLogger() method call:</p>
<pre name="code" class="ruby">...
#start of main script

if ARGV[0] != nil
 if (ARGV[0].to_i &gt;= 35)
  @logger.debug "This might take a bit...."
 end
 setupLogger()
 @logger.debug "starting fibonacci"
 start = Time.now
 @logger.debug fib(ARGV[0].to_i)
 stop = Time.now - start
 @logger.debug "Finding the fib of #{ARGV[0]} took: "
 @logger.debug "#{stop}"
 @logger.debug "seconds"
end</pre>
<p>If you run your script now, it should work.  Here is output from my run:</p>
<pre class="console">~$ ruby fib-log.rb 10
DEBUG logger: Logger is now setup
DEBUG logger: starting fibonacci
DEBUG logger: Fixnum: 55
DEBUG logger: Finding the fib of 10 took:
DEBUG logger: 0.000828
DEBUG logger: seconds</pre>
<p>As you can see, adding a logger to your existing script is very easy, and you can get even more<br />
fancy with the types of logs you wish to create. Since there are multiple<br />
levels of logging (DEBUG&lt; INFO &lt; WARN &lt; ERROR &lt; FATAL), you can customize which level&#8217;s you use by changing the second qualifier (ie. @logger.debug could become @logger.info).  Lets do that for<br />
a couple of lines.</p>
<p>Change</p>
<pre class="console">@logger.debug "Logger is now setup"</pre>
<p>to</p>
<pre class="console">@logger.info "Logger is now setup"</pre>
<p>and change</p>
<pre class="console">@logger.debug "starting fibonacci"</pre>
<p>to</p>
<pre class="console">@logger.info "starting fibonacci"</pre>
<p>Your final script should look like this:</p>
<pre name="code" class="ruby">#!/usr/bin/ruby
require 'time'
require 'log4r'
include Log4r

def setupLogger()
  # create a logger named 'mylog' that logs to stdout
  @logger = Logger.new 'logger'
  @logger.outputters = Outputter.stdout
 @logger.info "Logger is now setup"
end

def fib(num)
 if(num &lt; 2)
   return num
 else
   return fib(num-1) + fib(num-2)
 end
end

#start of main script

if ARGV[0] != nil
 if (ARGV[0].to_i &gt;= 35)
  @logger.debug "This might take a bit...."
 end
 setupLogger()
 @logger.info "starting fibonacci"
 start = Time.now
 @logger.debug fib(ARGV[0].to_i)
 stop = Time.now - start
 @logger.debug "Finding the fib of #{ARGV[0]} took: "
 @logger.debug "#{stop}"
 @logger.debug "seconds"
end</pre>
<p>Now let&#8217;s run the final script.  You should have received output like this:</p>
<pre class="console">~$ ruby fib-log.rb 10
 INFO logger: Logger is now setup
 INFO logger: starting fibonacci
DEBUG logger: Fixnum: 55
DEBUG logger: Finding the fib of 10 took:
DEBUG logger: 0.000823
DEBUG logger: seconds</pre>
<p>If you are looking for a quick way to add log messages to your ruby scripts, log4r might be a<br />
very quick and easy to implement solution for you.  Offering features comparable to Apache<br />
Foundation&#8217;s log4j, you will find quite it quite capable of handing any of your current project&#8217;s<br />
logging needs.  Check it out, and let us know what you think.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=EriXM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=EriXM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=mETdM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=mETdM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=R7R9m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=R7R9m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ByF7M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ByF7M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=RSijm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=RSijm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=RtNPM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=RtNPM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=ZXkrm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=ZXkrm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=n88JM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=n88JM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=QOGXm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=QOGXm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=EQjRM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=EQjRM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/420642590" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.kallasoft.com/add-logging-to-ruby-scripts-with-log4r/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=kallasoft&amp;itemurl=http%3A%2F%2Fwww.kallasoft.com%2Fadd-logging-to-ruby-scripts-with-log4r%2F</feedburner:awareness><feedburner:origLink>http://www.kallasoft.com/add-logging-to-ruby-scripts-with-log4r/</feedburner:origLink></item>
		<item>
		<title>ZK 3.5.1 Released - RIA Framework, NetBeans Plugin and Tutorial</title>
		<link>http://feeds.feedburner.com/~r/kallasoft/~3/419718876/</link>
		<comments>http://www.kallasoft.com/zk-351-released-ria-framework-netbeans-plugin-and-tutorial/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 17:47:51 +0000</pubDate>
		<dc:creator>Ray Gomez</dc:creator>
		
		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[Groovy]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[NetBeans]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[web application]]></category>

		<category><![CDATA[ZK]]></category>

		<category><![CDATA[ZKoss]]></category>

		<guid isPermaLink="false">http://www.kallasoft.com/?p=330</guid>
		<description><![CDATA[This past week ZKoss refreshed their flagship product, ZK, to version 3.5.1. If you haven&#8217;t heard of ZK before, it is a very slick framework which was &#8220;designed to maximize enterprise operation efficiency and minimize the development cost [with] its groundbreaking Direct RIA architecture. &#8221;
Unlike most marketing ploys used to overstate the capabilities of a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zkoss.org/"><img class="alignnone size-thumbnail wp-image-70" style="float: left; margin-left: 8px; margin-right: 8px;" title="ZK Logo" src="http://www.kallasoft.com/wp-content/uploads/2008/10/zk-logo.gif" alt="" /></a>This past week <a title="ZKoss" href="http://www.zkoss.org/" target="_blank">ZKoss</a> refreshed their flagship product, ZK, to version 3.5.1. If you haven&#8217;t heard of ZK before, it is a very slick framework which was &#8220;designed to maximize enterprise operation efficiency and minimize the development cost [with] its groundbreaking Direct RIA architecture. &#8221;</p>
<p>Unlike most marketing ploys used to overstate the capabilities of a particular product, ZK seems to match enterprise needs and costs by giving the developer easy-to-use tools to create spectacular interfaces in a very short time. Of course it is easy for me to say this, but when you have a chance to check ZK out you&#8217;ll probably be left wondering why you weren&#8217;t using it before.</p>
<p>As mentioned before, ZK is marketed as a powerful Rich Internet Application (RIA) framework, and this framework is not limited to a particular language. In other words, ZK allows developers to code and deploy their website in a variety of programming languages like Java, Groovy, Ruby, Python, and JavaScript.</p>
<p>{smartads} On top of that, the technology is built on open standards and has over 170 &#8220;off-the-shelf state-of-art Ajax Components&#8221; that can be accessed by any one of the aforementioned languages with only a few lines a code.  The previous statement doesn&#8217;t nearly do the justice this framework requires, so check out the quick flash movie on the <a href="http://www.zkoss.org/Steps/learn.dsp">learn</a> page to get an idea; a quick example would be adding the <strong>&lt;gmaps/&gt;</strong> tag to embed a Google Maps component or or <strong>&lt;fckeditor/&gt;</strong> tag to embed the venerable <a href="http://www.fckeditor.net/">FCKEditor WYSIWYG HTML Editor</a>.</p>
<p>This particular release was a minor update but still managed to contain &#8220;over 6 new features&#8221; and &#8220;28 bugs were fixed.&#8221; The headliners are:</p>
<ul>
<li> Changing font size/family with system properties</li>
<li> A New Tree Style (think Windows Explorer)</li>
<li> Support for Session Fixation Protection</li>
<li> Extendlet supports Filters</li>
<li> Added support for bookmark-able and resumable downloads</li>
<li> Components.addForward can now handle casecade $ name patterns.</li>
</ul>
<p>If you would like to learn more, head on over to the <a title="ZK Page" href="http://www.zkoss.org/product/zk.dsp" target="_blank">ZK product page</a> or to the release notes for 3.5.1 <a title="ZK 3.5.1 Release notes" href="http://www.zkoss.org/release/rn-3.5.1.dsp">here</a>.</p>
<p><a href="http://www.kallasoft.com/wp-content/uploads/2008/10/netbeans-61-zk-design-palette-plugin.jpg"><img class="alignnone size-thumbnail wp-image-352" style="float: left; margin-left: 8px; margin-right: 8px;" title="netbeans-61-zk-design-palette-plugin" src="http://www.kallasoft.com/wp-content/uploads/2008/10/netbeans-61-zk-design-palette-plugin-150x150.jpg" alt="" width="150" height="150" /></a>There is also a <a href="http://sourceforge.net/projects/rem1/">NetBeans 6.1 plugin</a> available that adds ZK Framework support for Web Projects with an enhanced design palette that allows you to quickly drag and drop ZK components into your web page like CAPTCHA box, FCKEditor, Google Maps, File Upload and ZK Tree components&#8230; along with a lot of other FCK components.</p>
<p>There is a tutorial done by Ayman Elgharabawy <a href="http://elgharabawy.hostrator.com/NetBeansDemos/NetBeansZK.html">here</a>, that shows you how to get started with the NetBeans ZK plugin incase you wanted to try it out.</p>
<p>Check it out, and let us know what you think!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/kallasoft?a=RGyWM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=RGyWM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=T538M"><img src="http://feeds.feedburner.com/~f/kallasoft?i=T538M" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=7cTDm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=7cTDm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=RtQtM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=RtQtM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=0DzKm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=0DzKm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=tMSnM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=tMSnM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=fiPHm"><img src="http://feeds.feedburner.com/~f/kallasoft?i=fiPHm" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=qiVFM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=qiVFM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=bPp2m"><img src="http://feeds.feedburner.com/~f/kallasoft?i=bPp2m" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/kallasoft?a=jVRYM"><img src="http://feeds.feedburner.com/~f/kallasoft?i=jVRYM" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/kallasoft/~4/419718876" height="1" width="1"/>]]></content:encoded>
			<wfw:com