SEO tip: No redirect on homepage

July 21st, 2008

When someone calls http://www.viennastreetstyle.com/ we always want to show the last added shot

So I had the idea to always redirect to the page showing the last added shot.
For sure it worked fine, the application was doing the expected shot for the viewer.

But what was going wrong:

  1. As it seemed to me, Search engines were not following the redirect
  2. ViennaStreetStyle had no real home page URL.
    The homepage URL was changing every several days because of the changing redirects.
  3. People who linked to ViennaStreetStyle, linked to different URLs (the URLs of the different shots). Hence there was no URL that accumulated all the links to ViennaStreetStyle.

After changing this behaviour:
Showing the ‘last added shot’ without redirecting from the root URL … the search engine ranks increased day by day.

JavaDeus 08

June 20th, 2008

“I attended yesterday the JavaDeus in St. Pölten, Lower Austria, and I have to say I was quite surprised; very professional, interesting, and quite a fun….” …. that’ how a friend of mine starts his post.

… and I agree with every word in his post:

JavaDeus 2008 - a successful start for the Austrian Java Community

Toodledo - GTD TODO list how it should be done!

June 5th, 2008

For some time now I am a fond user of online TODO lists.

Doing so, really pushing myself to write every little task to a list has for me two big advantages:

  • I do not forget any task
  • I can forget my tasks. What I want to say: After writing down the tasks I am not able to do now, they won’t spin around in my head any longer.

At first I started with Tracks, an open source RoR which I installed on my server. It is a nice well-done application, but unfortunately it has some bugs and seems to be quite in development hibernation. [Not true anymore a new version just arrived, GIVE IT A TRY, could be perfect for you!]

After giving the big player RememberTheMilk I try, I was searching for another competitor offering a free IPhone/Ipod interface (RTM offers this only for paid accounts).

So I stumbled upon: Toodledo!

Important for me was, that adding a task was only a click and you do not have to rethink several options until you can press the ‘Add’ button.
Toodledo has both: you can add your tasks and refine the additional options later.

Toodledo let’s you add a Due-Date and a Priority to your tasks and takes this information to prioritize your tasks in a perfect way!

Features of Toodledo (… I am a fan of. There are several more…):

  • adding a due date
  • setting a priority
  • grouping into folders
  • setting the estimated time for a task
  • tracking the elapsed time
  • setting goals for a set of tasks
  • IPhone interface
  • GCal integration

There a a lot of other features that might fit your way of Getting Things Done.
Give Toodledo a try!!

viennastreetstyle.com

May 27th, 2008

ViennaStreetStyle

Some days ago my first Rails application went live:

ViennaStreetstyle.com - ViennaStreetStyle is a simple photo gallery showing people on the streets of Vienna, Austria presenting their own style of street fashion.

I developed this application for friends of mine who had the idea for ViennaStreetstyle.com.

Development was quite straight-forward without any kind of a big suprise by using the following plugins/libraries:

  • attachment_fu
    For uploading and handling the images
  • geokit
    for locating the shots on the map of Vienna
  • YM4R
    Greatest plugin for doing all the GoogleMaps stuff
  • prototip
    Javascript library for easy rendering of complex tooltips

The whole system is running on a busy 256 MB VPS under Mongrel with 2 server instances (so in best condition to get slashdotted or sth like that).
But it is somehow an experiment for me how far you can go with that low server specs.

NFT - NotForTourists travel guide

May 6th, 2008

NFT I somehow have to make the best out of it: I am back from my 2 weeks visit to ‘New York City’ …

And one of the best things that I can do now, is to give out a sincere recommendation for the book that helped us most in this jungle:

NFT - Not For Tourists guide to New York City

Even though, after I bought this book at Amazon and took at home a first look at it, I thought:

“Wueah, bad buy! This book is really nothing for tourists. Just much to much unstructured information - No way to filter the interesting stuff out”.

But standing somewhere in Manhattan this little black book showed it’s real power:

  • The map is just great! Much better than in any other travel guide I know. And for sure easier to handle than the big foldable ones.
  • Starving in Midtown, running from one $40+ restaurant to the next - Just take a look at NFT and you find your cheap bite in a great restaurant that looks like a hairdresser from the outside.
  • A lot of other addresses you will love if you want to leave the beaten tourist paths: bike rentals, transportation out of the city, not-so-known landmarks, ….

Further NFT guides are released for more U.S. cities. Hopefully this concept gets bigger and bigger and will swap over the oceans. It’s just a great book, for citizens and even for tourists.

mod_rails - the tryout - the failure (for my situation)

April 14th, 2008

Some days ago, I have introduced you to mod_rails. I totally freaked out by the idea to let RoR running inside of Apache. Just without using FCGI or proxying Mongrel.

Though, I had not much spare time this weekend, I just had to try it out!

First of all:
You guys rock!!! These guys just impressed me how well-thought a first release version can be.
The whole setup and Apache configuration is so damn easy - you can’t go wrong. The setup script even detects missing linux packages and tells you exactly what to do, depending on the hosting distribution.

So I switched one of my RoR applications to mod_rails …..

But after using it for some minutes I got heavely disappointed. It is just no good hosting option for my situation: [My server is a Debian VPS with 265MB-768MB burstable]

The memory consumption the machine went up from 280MB (wo/ mod_rails) to over 700MB. So all my applications started vomiting, because there was no memory left. Only killing apache2 processes helped me to solve the situation.

So I thought, I will be a good guy and RTFM. I stepped across this configuration parameter:

RailsMaxPoolSize <integer>

The manual recommended to set this parameter to “2″ for servers with small memory footprint.

So I did, but it was no help. Same memory consumption by all apache2 processes.

The next step was to not include the mod_rails module in apache. No help, either. So mod_rails wasn’t even running anymore and the memory consumtption was still beyond the pale!

So, the only reason I can imagine, is that one of the newly installed gems (axpr?) and not mod_rails directly is causing that big memory mayhem.

Huh, restoring a backup of my server was the only help to get rid of the situation!!!

What do you think? What might be the cause of my situation?

Phusion Passenger (a.k.a. mod_rails)

April 11th, 2008

As it seems a new star is born on the “Rails-How to-host” sky!
Phusion Passenger

After reading some posts, it seems to be a first rock-solid “mod_rails” implementation.
No Mongrel, no FCGI just a clever Apache module that hosts Rails directly out of your WebServer.

Just point your DocumentRoot to your public folder and there you go. Even restarting your application is damn easy:

touch /webapps/mycook/tmp/restart.txt

Even I can write a Capistrano recipe to do that!

And this statement is just the Killer for me:

Page caching is fully supported, without the need to configure mod_rewrite.

Unfortunately, I won’t be able to install it for the next 3 weeks, but I am looking forward to get this baby under test.

Don’t let anyone take over a user account!

March 21st, 2008

Some days ago I stepped across this must-read tutorial:

Use attr_protected or we will hack you

To be honest: I really do not use all of these tips - I MUST do so!!

While reading it, some other do’s and dont’s came to my mind:

  1. Users are only allowed to edit his/her ‘personal data’
  2. Do not provide ’sensitive data’ via your REST XML response

1. Users are only allowed to edit his/her ‘personal data’
Just imagine, you are a user of an app and your user id is: 5.
With the url ‘/users/5/edit’ you may edit your ‘personal settings’.

Now try the url ‘/users/6/edit’.
Gosh!! It’s so easy to hijack another profile!

This is just a solution for my application. But I’m shure you get a hint what’s the idea behind it.

Of course, this does in most cases not only apply for the users resource.
You have to apply this pattern for all resources that are explicitly editable by one (…) user(s).

 

2. Do not provide ’sensitive data’ via your REST XML response
Rails is so great! Just look at following scaffold code - You get a REST XML interface by doing nothing!

def index
@users = User.find(:all)
respond_to
do |format|
format.html
# index.html.erb
format.xml { render :xml => @users }
end

But what will happen if one calls ‘/users.xml’ now?
The response will be a REST XML response with all non-private and private user data! Cool a list of all passwords, emails and credit card numbers of all your users!!!

def to_xml(options = {})
default_only = [:id, :name, :email]
options[:only] = (options[:only] || []) + default_only
super(options)
end

With overriding your to_xml() you just exclude the private data from your xml output!
Actually, after applying this recipe to my application I found it in this great book: Advanced Rails Recipes. Go for it!

I’m quite shure, the above code can be done more general, or just ported to a plugin. It’s just an advice what you have to keep in mind!

Come on! Now it’s your turn!
Some more recipes that apply to this topic!

AJAX Rain - Javascript/DHTML repository

March 18th, 2008

AjaxRain

 

 

 

AJAX Rain - for me the first place to look at - if I want Javascript magic!

AJAX file uploads in Rails

March 14th, 2008

Ever tried to do a file upload in a remote_form_tag. I did! - And I failed.
Digged a little bit deeper what a XMLHttpRequest is allowed to do and then it was clear for me that it won’t work. But I didn’t wanted to let loose and then I found some ideas about “iframe remoting pattern” - This seems to sove the problem - But how to implement it in Rails?

This tutorial was great help! It explains how to do that stuff using attachment_fu and respond_to_parent.
It was just a walktrough!