<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>beastiebytes.com</title>
    <link>http://beastiebytes.com/</link>
    <description>hacking for fun and profit</description>
    <item>
      <title>Nothing to hide? You are boring!</title>
      <link>http://beastiebytes.com/blog/Nothing to hide? You are boring!</link>
      <description>&lt;p&gt;Talking to my friends and random strangers about privacy problems like data collections and data mining, I often have to deal with the 'good guy have nothing to hide.' argument.&lt;br&gt;&lt;br&gt;Here is my list of answers, add yours in the comments&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;You are boring!&lt;/b&gt;&lt;br&gt;Everybody makes mistakes, behaves like an idiot, breaks or bends the rules of his community from time to time. In case you never do, you are incredibly boring. I do not want all my stupidity saved on tape for future amusement.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Everything you say or do can and will be used against you (even if it takes some time)&lt;/b&gt;&lt;br&gt;Do you want your insurance company to know that you buy alcohol regularly, smoke two packs of cigarettes each day and ate lots of raw British beef in the 90ies? That your father died of cancer, your mother has diabetes and your girlfriend wants a child? None of this is illegal, but private. I am sure you want it to stay that way.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;b&gt;Really want it? Really need it? Have enough money?&lt;/b&gt;&lt;br&gt;So your car is broken, you commute each day and you hate public transportation? Good to know that you have 8,435$ in the bank, because that is the price the car dealer will quote you. It is called &lt;i&gt;price discrimination&lt;/i&gt;, one of the oldest retail strategies. Less privacy will mean price discrimination on steroids, where everyone will charge you the maximum price you would be willing to pay.&lt;br&gt;&lt;br&gt;&lt;b&gt;Perhaps somebody else has to hide something&lt;br&gt;&lt;/b&gt;Think about journalists. Do you want their sources to be afraid of contacting them? You probably want that conversations between you and your lawyer are confidential. What about politics? Do you want members of the opposition under surveillance?&lt;br&gt;&lt;br&gt;&lt;b&gt;In the end, you are just consumer ID#3370318/2716057.&lt;/b&gt;&lt;br&gt;You buy only unhealthy stuff in the store because you mostly eat home-grown organic food. You want health insurance? Today, you might be able to talk to someone who will get to know you and evaluate your risks. With unlimited data mining, that decision will be made by an algorithm. The insurance company is aware that there is a possibility that you are in fact a vegetarian, although your credit card shows other shopping habits. They also know that this is not very likely. In the end they do not take the risk.&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Nothing to hide? You are boring!</guid>
    </item>
    <item>
      <title>Gentoo, Rails and mod_fcgid</title>
      <link>http://beastiebytes.com/blog/Gentoo, Rails and mod_fcgid</link>
      <description>&lt;p&gt;My friend Marcel asked me about my Gentoo, Rails and mod_fcgid configuration.&lt;/p&gt;&lt;p&gt;Here it is:&lt;/p&gt;&lt;p&gt;&lt;b&gt;Software versions:&lt;/b&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;apache-2.2.6&lt;/li&gt;&lt;li&gt;mod_fcgid 1.10&lt;/li&gt;&lt;li&gt;rails 1.2.5&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;b&gt;Content of the .htaccess file inside the public directory of the rails application:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Options +FollowSymLinks +ExecCGI&lt;br&gt;RewriteEngine On&lt;br&gt;RewriteBase /&lt;br&gt;RewriteRule ^$ index.html [QSA]&lt;br&gt;RewriteRule ^([^.]+)$ $1.html [QSA]&lt;br&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;br&gt;RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]&lt;br&gt;ErrorDocument 500 "&amp;lt;h2&amp;gt;Application error&amp;lt;/h2&amp;gt;Rails application failed to start properly"&lt;/p&gt;&lt;p&gt;&lt;b&gt;Example vhost entry:&lt;/b&gt;&lt;br&gt;&lt;br&gt;&amp;lt;VirtualHost *:80&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServerAdmin webmaster@domain.tld&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DocumentRoot "/var/www/www.domain.tld/public/"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ErrorLog /var/www/www.domain.tld/log/apache.log&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServerName domain.tld&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serveralias domain.tld&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Directory "/var/www/www.domain.tld/public"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Options ExecCGI FollowSymLinks&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddHandler fcgid-script .cgi .fcgi .fcg&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AllowOverride all&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Order allow,deny&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow from all&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Directory&amp;gt;&lt;br&gt;&amp;lt;/VirtualHost&amp;gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Last things to do:&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Make sure that the rails tmp directory is writeable by the webserver.&lt;/p&gt;&lt;p&gt;Do not forget to run apache with mod_fcgid enabled. Edit
/etc/conf.d/apache and add ' -D FCGID ' to the APACHE2_OPTS. Then
restart the webserver with /etc/init.d/apache2 restart .&lt;/p&gt;&lt;p&gt;I removed dispatch.cgi to be sure that dispatch.fcgi is used. &lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Gentoo, Rails and mod_fcgid</guid>
    </item>
    <item>
      <title>Onetime Password plugin for rails</title>
      <link>http://beastiebytes.com/blog/Onetime Password plugin for rails</link>
      <description>&lt;p&gt;Do you blog from friends computers or the internet cafe? &lt;/p&gt;&lt;p&gt;I do not. &lt;/p&gt;&lt;p&gt;I am too much afraid that there is some sort of malware installed that will grab my password. To overcome this problem, I wrote a small onetime password (otp) system for my bewiso content management software.&lt;/p&gt;&lt;p&gt;As the name says, an onetime password can only be used one time; then it is invalid and not usable to unlock your account anymore. While this is great against shoulder surfing, it does not protect you from malware that takes over your current authenticated connection.&amp;nbsp; &lt;/p&gt;&lt;p&gt;There are two scenarios. In the first one, the attacker is able to read and write to your internet connection. This is very easy on public hotspots and doable more or less anywhere between your computer and the computer that you are talking to. You can protect your connection by using encryption and digital certificates to make sure that nobody is able to tamper with your data. That works.&lt;/p&gt;&lt;p&gt;In the second scenario, the malware or attacker has controll over your computer. In this case, the encryption will not help you much, as the attacker is able to read an write data before it gets crypted. Imagine you want to add a new post to your blog and the attacker changes the request from something like https://yourhost/new_article to https://yourhost/delete_all_articles . The result would be that all your post are deleted. Not good. &lt;/p&gt;&lt;p&gt;It is very hard to protect against such a thread, as your blog-server has no way of knowing whether you made the request or if your computer did it without you being aware of it.&lt;/p&gt;&lt;p&gt;Because of this problem, I wrote some additional code for the plugin that enables you to exclude some of the actions in your controller from being available during an onetime password session.&lt;/p&gt;&lt;p&gt;If you add something like&amp;nbsp;&lt;br&gt;&amp;nbsp; include OnetimepasswordSystem&lt;br&gt;&amp;nbsp; before_filter :no_otp_session, :except =&amp;gt; [:logout,:index]&lt;br&gt;to your controller, it will prevent all actions except 'logout' and 'index' to be available during an otp session. &lt;/p&gt;&lt;p&gt;Get version 0.1 of my plugin here: &lt;a href="http://beastiebytes.com/files/onetimepassword-0.1.tar.gz"&gt;onetimepassword plugin v0.1&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In case you have problems using the plugin, please &lt;a href="http://beastiebytes.com/blog/Contact+data"&gt;contact me&lt;/a&gt; or use the comment system.&amp;nbsp;&lt;/p&gt;&lt;p&gt;btw: I am aware that requests that change anything on a server, should be in the 'post' format and that there should be some protection against csrf in place, but this is out of the scope of this article.&amp;nbsp;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Onetime Password plugin for rails</guid>
    </item>
    <item>
      <title>7 reasons why computer security is hard</title>
      <link>http://beastiebytes.com/blog/7 reasons why computer security is hard</link>
      <description>1. Constant changes&lt;br&gt;&lt;br&gt;There are new attacks and new vulnerabilities every day.&lt;br&gt;It
is necessary to keep software up to date. If your software vendor
issues a patch or an update, make sure to apply it as quick as
possible. In case of mission critical systems, it is crucial to test
the updates first to avoid bad surprises.&lt;br&gt;Sometimes security
problems are known in public before there is a fix or workaround. You
will have to evaluate how risky it is to keep a software or system in
use.&lt;br&gt;Not only the bad guys get smarter, you do too. As you learn
more about security you will constantly reconsider your security
actions and adjust them to avoid being an easy target.&lt;br&gt;&lt;br&gt;&lt;br&gt;2. Snake oil&lt;br&gt;&lt;br&gt;It
is not possible for my mother to know about downsides of personal
firewalls and home-brew encryption algorithms. The media runs
advertisements for security products, is therefore biased when it comes
to an evaluation.&lt;br&gt;Many 'security' products are 'broken', hours after
they are available to the public. Not only because of errors during the
implementation, often because of the design itself.&lt;br&gt;Take anti virus
scanners for example. If your system is already infected, the notice of
your virus scanner that everything is ok is not very trustworthy. &lt;br&gt;&lt;br&gt;3. Find a good trade off&lt;br&gt;&lt;br&gt;Applying
security is always a trade off. Most of the time you loose comfort and
gain additional security. Take email for example: You need a connection
to your mailserver and you need a program to process the mails you
receive. This increases your attack surface, but as benefit you are
able to read email.&lt;br&gt;If you run your normal desktop computer, it is a
good practice to not install every funny gadget like a new moon
calendar. This means less "pimp my desktop"... but at least you do not
increase your attack surface.&lt;br&gt;&lt;br&gt;&lt;br&gt;4. Users&lt;br&gt;&lt;br&gt;Most of the
times humans are the weak chain in a security system. Bad guys do not
need to find a technical problem on a computer system, if the person in
front of it is willing to execute commands on the attackers behalf.
This can be done via email, on the phone or even by just sending an
unlabeled CD-ROM.&lt;br&gt;It is very hard to defend against such attacks as
they target the natural instincts of the human beings like fear, guilt
or the human want to help other people.&lt;br&gt;&lt;br&gt;&lt;br&gt;5. Real person?&lt;br&gt;&lt;br&gt;It
is next to impossible for a computer to decide whether it is talking to
a real human or to an other program. If the online system of your bank
receives a request from your computer, it is not able to tell if you
actually ordered a transaction or if some bad software did. When a
firewall sees a connection to a webserver, it is not able to tell if
you are surfing the web or if a program is sending data pretending to
be legitimate traffic.&lt;br&gt;&lt;br&gt;&lt;br&gt;6. Doing it wrong is easy&lt;br&gt;&lt;br&gt;A
security consultant needs to identify all ways to break into your
system and fix them properly. The criminal only needs to find one
mistake and you are in trouble.&lt;br&gt;There are many ways to limit the
impact of a security compromise, but in the end it comes down to: The
bad guys do have it much easier.&lt;br&gt;&lt;br&gt;&lt;br&gt;7. You have to trust someone&lt;br&gt;&lt;br&gt;How
do you know that you do not run an operating system with a build in
backdoor? Sure that there is no keylogger in your new computer? Is your
mobile phone really switched off? Is your new database server realy
unbreakable?&lt;br&gt;At the end of the day you need to make a trade off and decide whom to trust.&lt;br&gt;One
benefit of open source software or algorithms is that you (or someone
you pay) can look into the program code and try to find hidden
backdoors or security problems. This is no guarantee to find all
problems, but at least you have a chance.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Depressed now?
Don't be. By applying good security practices and constant work, you
can avoid to be low hanging fruit to the attackers.&lt;br&gt;&lt;br&gt;&lt;br&gt;</description>
      <guid>http://beastiebytes.com/blog/7 reasons why computer security is hard</guid>
    </item>
    <item>
      <title>A rails application in less than 10 hours.</title>
      <link>http://beastiebytes.com/blog/A rails application in less than 10 hours.</link>
      <description>&lt;p&gt;&lt;img src="http://beastiebytes.com/files/treesky.jpg" height="267" alt="tree and sky" width="400"&gt;&lt;/p&gt;&lt;p&gt; I was a bit bored and thought about the idea of writing an useful and production ready web application with 'ruby on rails' in less then 10 hours. When I say production ready, I mean that the code is more or less readable and there is a set of tests in place to validate functionality. In the end it took me a few hours more to make this application available online, but I still think that the ruby on rails framework provides an excellent starting point for fast and clean development.&lt;/p&gt;&lt;p&gt;The basic steps:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Generation of the rails skeleton &lt;/li&gt;&lt;li&gt;Installation of plugins (acts_as_authenticated,classic_pagination)&lt;/li&gt;&lt;li&gt;Generation of the user model and the account controller&lt;/li&gt;&lt;li&gt;Some modifications to make the email signup notification work&lt;/li&gt;&lt;li&gt;Code to prevent cross site request forgeries (csrf)&lt;/li&gt;&lt;li&gt;Tests for the basic functionalities&lt;/li&gt;&lt;li&gt;Create two models 'requests' and 'question' (request has many questions) (answers are saved inside questions table) &lt;/li&gt;&lt;li&gt;Check that the models are protected against mass assignment&lt;/li&gt;&lt;li&gt;Tests for the two controllers (account and lazyrequest)&lt;/li&gt;&lt;li&gt;Observer and notifier for the request model to send mails on creation of a request &lt;/li&gt;&lt;li&gt; Coding...&lt;/li&gt;&lt;li&gt;Testing...&lt;/li&gt;&lt;li&gt;Coding...&lt;/li&gt;&lt;li&gt;Nice layout&lt;/li&gt;&lt;li&gt;Manual testing&lt;/li&gt;&lt;li&gt;Kleinkram (german: small stuff)&lt;/li&gt;&lt;li&gt;Upload to beastiebytes.com&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Todo list:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;more information for the user&lt;/li&gt;&lt;li&gt;displayed information needs to be more visible &lt;/li&gt;&lt;li&gt;more and nicer widgets to create questions&lt;/li&gt;&lt;li&gt;already filled in question set or templates&lt;/li&gt;&lt;li&gt;gettext&lt;/li&gt;&lt;li&gt;better gui to create requests&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Roadmap:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;transform into survey tool&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The result is available here: &lt;a href="http://lazykid.beastiebytes.com/"&gt;http://lazykid.beastiebytes.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/A rails application in less than 10 hours.</guid>
    </item>
    <item>
      <title>Fail save</title>
      <link>http://beastiebytes.com/blog/Fail save</link>
      <description>&lt;p&gt;While working with the excellent &lt;a href="http://www.writertopia.com/developers/authorization"&gt;writertopia authorization plugin&lt;/a&gt;  I made some small changes to let it fail more secure in certain situations. &lt;/p&gt;&lt;p&gt;With
this plugin you are able to query and set permissions for users and
optional additionally in relation to certain models. To quote their
website: "This plugin provides a flexible way to add authorization to
Rails." This is true.&lt;br&gt; &lt;/p&gt;&lt;p&gt;You can write code like&lt;/p&gt;&lt;p&gt;do_something if current_user.is_moderator_of? forum_obj&lt;/p&gt;&lt;p&gt;or &lt;/p&gt;&lt;p&gt;do_something if current_user.is_registered?&lt;/p&gt;&lt;p&gt;There
is no need to write a specific method called 'is_moderator_of?'.&amp;nbsp; The
plugin does its magic and queries the database to get the needed
information. &lt;/p&gt;&lt;p&gt;In the first example it would ask if the
current_user has a role called 'moderator' and if this role is
connected to the forum object. In the second example, the plugin would
just check if the current_user has a role called 'registered'.&amp;nbsp;&lt;/p&gt;&lt;p&gt;The problem comes now:&amp;nbsp;&lt;/p&gt;&lt;p&gt;If I call&lt;br&gt;&lt;br&gt;current_user.is_ROLENAME_of? authorizable_obj&lt;br&gt;&lt;br&gt;it evaluates to true in case authorizable_obj equals nil and the current_user has at least one role named ROLENAME.&lt;br&gt;&lt;br&gt;In
my opinion it should evaluate to false as this is more restrictive and
prevents unwanted authorization in case the programmer did not make
sure to test if authorizable_obj.nil?.&lt;br&gt;&lt;br&gt;This all goes down to the
problem that by the way 'has_role?' is called, it can not differentiate
between no authorizable_obj parameter at all and an authorizable_obj
which equals nil.&lt;br&gt;&lt;br&gt;Going from the problem backwards to the use of the api, I would change the the code like this:&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;br&gt;The 'has_role?' method inside object_roles_table.rb from&lt;br&gt;&lt;br&gt;def has_role?( role_name, authorizable_obj = nil )&lt;br&gt;&amp;nbsp; if authorizable_obj.nil?&lt;br&gt;# If we ask a general role question, return true if any role is defined.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.roles.find_by_name( role_name ) ? true : false&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp; else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; role = get_role( role_name, authorizable_obj )&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; role ? self.roles.exists?( role.id ) : false&lt;br&gt;&amp;nbsp; end&lt;br&gt;end&lt;br&gt;&lt;br&gt;to:&lt;br&gt;&lt;br&gt;def has_role?( role_name, authorizable_obj = -1 )&lt;br&gt;&amp;nbsp; return false if authorizable_obj.nil?&lt;br&gt;&amp;nbsp; if authorizable_obj == -1&lt;br&gt;# If we ask a general role question, return true if any role is defined.&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.roles.find_by_name( role_name ) ? true : false&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp; else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; role = get_role( role_name, authorizable_obj )&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; role ? self.roles.exists?( role.id ) : false&lt;br&gt;&amp;nbsp; end&lt;br&gt;end&lt;br&gt;&lt;br&gt;&lt;br&gt;In identity.rb change&lt;br&gt;&lt;br&gt;def is_role?( role_name, authorizable_object )&lt;br&gt;&amp;nbsp; if authorizable_object.nil?&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.has_role?(role_name)&lt;br&gt;&amp;nbsp; elsif authorizable_object.respond_to?(:accepts_role?)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.has_role?(role_name, authorizable_object)&lt;br&gt;&amp;nbsp; end&lt;br&gt;&amp;nbsp; false&lt;br&gt;end&lt;br&gt;&lt;br&gt;to:&lt;br&gt;&lt;br&gt;def is_role?( role_name, authorizable_object )&lt;br&gt;&amp;nbsp; if authorizable_object.nil?&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.has_role?(role_name,nil)&lt;br&gt;&amp;nbsp; elsif authorizable_object == -1&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.has_role?(role_name)&lt;br&gt;&amp;nbsp; elsif authorizable_object.respond_to?(:accepts_role?)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.has_role?(role_name, authorizable_object)&lt;br&gt;&amp;nbsp; end&lt;br&gt;&amp;nbsp; false&lt;br&gt;end&lt;br&gt;&lt;br&gt;&lt;br&gt;And in 'method_missing' the initialisation of authorizable_obj needs to be changed from&lt;br&gt;&lt;br&gt;def method_missing( method_sym, *args )&lt;br&gt;&amp;nbsp; method_name = method_sym.to_s&lt;br&gt;&amp;nbsp; authorizable_object = args.empty? ? nil : args[0]&lt;br&gt;&amp;nbsp; ...&lt;br&gt;&amp;nbsp; ...&lt;br&gt;&lt;br&gt;to&lt;br&gt;&lt;br&gt;def method_missing( method_sym, *args )&lt;br&gt;&amp;nbsp; method_name = method_sym.to_s&lt;br&gt;&amp;nbsp; authorizable_object = args.empty? ? -1 : args[0]&lt;br&gt;&amp;nbsp; ...&lt;br&gt;&amp;nbsp; ...&lt;br&gt;&lt;br&gt;In
case it is not obvious, I use -1 to show has_role? that there was no
parameter supplied, as it seems more likely that the parameter is nil
by accident. I sent my suggestions to writertopia and expect to hear
from them in a few days. &lt;/p&gt;&lt;p&gt;If you have any comments or spotted an error, or unwanted side effect, please use the comment system.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Fail save</guid>
    </item>
    <item>
      <title>Test driven development is your friend</title>
      <link>http://beastiebytes.com/blog/Test driven development is your friend</link>
      <description>&lt;p&gt;&lt;img src="http://beastiebytes.com/files/treeandsea.jpg" height="267" alt="tree in front of sea" width="400"&gt;&lt;/p&gt;Since I started programming in ruby, I tried to force myself to do test driven development. The pain of writing the test first and the actual code later prevents me from over engineering and makes me focus better on the actual problem I want to solve.&lt;br&gt;&lt;br&gt;Knowing about the great benefits of test driven development, I completely ignored them when I needed a file upload functionality in my new bewiso interface based on ruby on rails. The first test I wrote did not work and after I found out that there was an unpatched bug related to testing file uploads, I removed my test and forgot about the issue.&lt;br&gt;&lt;br&gt;This turned out to be a big mistake. One month later, I manually tested my file upload to check if my layout would look nice with an embedded picture. The upload failed and ruby complained with this error message:&lt;br&gt;&lt;br&gt;&amp;nbsp;undefined method `original_filename' for "#&amp;lt;File:0xb71f0cb8&amp;gt;":String&lt;br&gt;&lt;br&gt;After a bit of reading I found out that the uploaded file is supposed to be available as 'File' object or as 'StringIO' object if the file is bigger than xy.&lt;br&gt;The string object was not expected. As I did a rails update some days ago and had a new version of actionpack in use, I started looking into lib/action_controller/cgi_ext/cgi_methods.rb and lib/action_controller/cgi_process.rb but could not find any obvious problems. After reading the changelog of actionpack and getting more and more frustrated I found the line that caused all my trouble by accident.&lt;br&gt;&lt;br&gt;before_filter :validate_utf_params , inside my application controller. This calls a method that goes through my params and makes sure that there are no wired utf8 characters inside the data. It crashed my params object as I did not expect to find something different than a string.&lt;br&gt;&lt;br&gt;Lesson learned; write tests even for obvious stuff. If I had followed my own procedures with care I would have found this problem immediately after I checked in the utf8 stuff.</description>
      <guid>http://beastiebytes.com/blog/Test driven development is your friend</guid>
    </item>
    <item>
      <title>Html2Pdf with OpenOffice</title>
      <link>http://beastiebytes.com/blog/Html2Pdf with OpenOffice</link>
      <description>&lt;p&gt;There is an easy way to make use of the OpenOffice features via commandline.&lt;/p&gt;&lt;p&gt;Recently I was in need for a robust and fast way to convert html files to pdf. &lt;br&gt;Main requirement was the ability to run under win32 and linux systems. Rendering of embedded images and usage of css.&lt;br&gt;First
I used html2pdf from (www.tufat.com
[http://www.tufat.com/s_html2ps_html2pdf.htm]), but ran into problems
as the process used too much memory and processing power caused by many
tables inside the html. &lt;br&gt;&lt;br&gt;Here is how to do it with OpenOffice:&lt;br&gt;&lt;br&gt;1. Start OpenOffice&lt;br&gt;2. Go to: 'Tools' -&amp;gt; 'Macros' -&amp;gt; 'Organize Dialogs..'&lt;br&gt;3. Create a new library called 'Converter' by selecting the 'Library' tab, pressing new and entering the name ('Convert').&lt;br&gt;4.
Select the 'Modules' tab. There you can find your new library under the
'My Macros' menu item. Select it and press 'New' to &amp;nbsp;&amp;nbsp; &amp;nbsp;create a new
module. Call it 'Convert'.&lt;br&gt;5. If you are on the right track, an editor window should be open now. In case there is any default text inside. Delete it.&lt;br&gt;6. Now enter the following code into the editor and press the save button when you are done.&lt;br&gt;&lt;br&gt;Sub HtmlToPDF( cFile )&lt;br&gt;&amp;nbsp;&amp;nbsp; cURL = ConvertToURL( cFile )&lt;br&gt;&amp;nbsp;&amp;nbsp; oDoc = StarDesktop. loadComponentFromURL(cURL,"_blank",0,DimArray())&lt;br&gt;&amp;nbsp;&amp;nbsp; cFile = Left( cFile, Len( cFile ) ) + ".pdf"&lt;br&gt;&amp;nbsp;&amp;nbsp; cURL = ConvertToURL( cFile )&lt;br&gt;&amp;nbsp;&amp;nbsp; oDoc.storeToURL( cURL, Array(_&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MakePropertyValue( "FilterName", "writer_pdf_Export" ),_&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;&amp;nbsp;&amp;nbsp; oDoc.close( True )&lt;br&gt;End Sub&lt;br&gt;&lt;br&gt;&lt;br&gt;Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue&lt;br&gt;&amp;nbsp;&amp;nbsp; Dim oPropertyValue As New com.sun.star.beans.PropertyValue&lt;br&gt;&amp;nbsp;&amp;nbsp; If Not IsMissing( cName ) Then&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oPropertyValue.Name = cName&lt;br&gt;&amp;nbsp;&amp;nbsp; EndIf&lt;br&gt;&amp;nbsp;&amp;nbsp; If Not IsMissing( uValue ) Then&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oPropertyValue.Value = uValue&lt;br&gt;&amp;nbsp;&amp;nbsp; EndIf&lt;br&gt;&amp;nbsp;&amp;nbsp; MakePropertyValue() = oPropertyValue&lt;br&gt;End Function&lt;br&gt;&lt;br&gt;7. Ok. Close OpenOffice now. You are nearly done.&lt;br&gt;8. Download an example webpage. Lets call it 'test.html'&lt;br&gt;9. Test your macro by executing the following on your command prompt:&lt;br&gt;$ oowriter -invisible "macro:///Converter.Convert.HtmlToPDF(file:///tmp/test.html)"&lt;br&gt;10. Be happy with your new pdf at /tmp/test.html.pdf&lt;br&gt;&lt;br&gt;If you run into problems, have questions or know a better or more easy way, please use the comment system. &lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Html2Pdf with OpenOffice</guid>
    </item>
    <item>
      <title>Security consulting</title>
      <link>http://beastiebytes.com/blog/Security consulting</link>
      <description>A secure IT infrastructure is crucial for the core business of most
modern companies. The benefits of the internet have the side effect of
being exposed to various threats like viruses, worms or targeted
attacks. I can offer you security consulting with a strong focus on web
applications and general information security.&lt;br&gt;&lt;br&gt;I found security
problems in many different software products like web applications,
kernel modules or normal consumer software like ebook reader or video
player. While working for an ISP, I had a chance to see how many
companies have malicious software in their network although they had
firewalls and anti virus products installed. Sometimes there are only
few steps necessary to avoid being low hanging fruit for attackers.&lt;br&gt;&lt;br&gt;If
you need a security geek to check your new software or need a second
opinion about your network, please &lt;a href="http://beastiebytes.com/blog/Contact+data"&gt;contact me&lt;/a&gt;. In case I do not feel
qualified for the specific task I can help you find the right people to
fulfill your needs.&lt;br&gt;&lt;br&gt;</description>
      <guid>http://beastiebytes.com/blog/Security consulting</guid>
    </item>
    <item>
      <title>Application development</title>
      <link>http://beastiebytes.com/blog/Application development</link>
      <description>&lt;p&gt;Content management systems, community software, isp management solutions, time tracking...&lt;/p&gt;&lt;p&gt;Since I started programming on my dads Commodore 64, I came in contact with many programming languages, concepts and frameworks.&lt;/p&gt;&lt;p&gt;Although
a major part of my work was in the area of web development (perl, php,
ruby and java), I have also experience in writing software like
database filesystems in c, smart card programming or j2me for mobile
devices.&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you have an interesting project and need help, please &lt;a href="http://beastiebytes.com/blog/Contact+data"&gt;contact me&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Application development</guid>
    </item>
    <item>
      <title>Services</title>
      <link>http://beastiebytes.com/blog/Services</link>
      <description>&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://beastiebytes.com/blog/Application+development"&gt;Application development&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;p&gt;From web message boards to highly complex isp management suites.&lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://beastiebytes.com/blog/Security+consulting"&gt;Security consulting&lt;/a&gt; with focus on web applications &lt;/li&gt;&lt;p&gt;Is
your webserver running insecure code? Is your webcoder able to explain
cross site request forgeries to you? Let me check your software. &lt;/p&gt;&lt;/ul&gt; &lt;ul&gt;&lt;li&gt;Seminars and teaching&amp;nbsp;&lt;/li&gt;&lt;p&gt;See your network through the eyes of an attacker or let us train your staff about the security problems surrounding them. &lt;/p&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Support for open source software&lt;/li&gt;&lt;p&gt;Get your servers up to date and minimize updating intervals. &lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;/ul&gt;</description>
      <guid>http://beastiebytes.com/blog/Services</guid>
    </item>
    <item>
      <title>Contact data</title>
      <link>http://beastiebytes.com/blog/Contact data</link>
      <description>&lt;p&gt;If you prefere typing try web2007@beastiebytes.com or contact my jabber accout sven57@jabber.ccc.de&lt;/p&gt;&lt;p&gt;Get me on my cell phone by calling +49 177 7824828&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Sven Tantau&lt;/p&gt;&lt;p&gt;Drostestrasse 3&lt;/p&gt;&lt;p&gt;53819 Neunkirchen&lt;/p&gt;&lt;p&gt;USt-Id-Nr.: DE203610693&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Contact data</guid>
    </item>
    <item>
      <title>Welcome</title>
      <link>http://beastiebytes.com/blog/Welcome</link>
      <description>&lt;p&gt;Welcome to beastiebytes.com&lt;/p&gt;&lt;p&gt;My name is Sven Tantau and my websites are about:&lt;br&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;writing and breaking software&lt;/li&gt;&lt;li&gt;digital and analog security&lt;/li&gt;&lt;li&gt;linux and open source software&lt;br&gt;&lt;/li&gt;&lt;li&gt;digital self defense in the modern world&amp;nbsp;&lt;/li&gt;&lt;li&gt;some personal issues &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;If you are in need for a freelance developer with focus on web applications and security, please &lt;a href="http://beastiebytes.com/blog/Contact+data"&gt;contact me&lt;/a&gt; via email.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>http://beastiebytes.com/blog/Welcome</guid>
    </item>
  </channel>
</rss>
