Tuesday, 25 February 2014

htaccess authentication and cancel

It was driving me nuts.

I have this one website I'm working on now and I wanted to protect it from the unwanted eyes.
I still wanted my admin and tester to be able to look at it, and that was easy. There a plenty tutorials out there which help you set up .htaccess file, create the passwords and so on. Just look at the Apache one.

But what was happening when someone just clicked cancel? They could still see most of the page content!

So instead of protecting my development I was making it more interesting for spying eyes.

None of the tutorials tell you how to disallow access to the website when someone clicks "cancel" instead of entering password.

And it actually is quite simple.

Instead of using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
Require valid-user

You should be using this:
AuthType Basic
AuthUserFile /your_location_of_password/file
AuthName "Restricted Access - or some other title you want to show to people who try to login"
<files '*'>
Require valid-user
</files>

Thank you Apache for NOT making it obvious.

Thursday, 20 February 2014

LX1 graceful retirement

OK, the time came when I have actually decided my little LX1 should retire.
But as I'm still quite attached to it I do not just want to bin it, that feels wrong.

I've decided to:

Use it as my home server / development box

With so many free cloud-based free solutions it might seem and overkill, but it was actually quite useful.
It's much easier for me to set up a VM and test certain setups in a non-state-of-art environment (much more life-like than most professional tools). After all it's easier to emulate network connectivity problems at home, or even DDoS your own computer to see how it behaves.   

Expose it to the world so that I can have insight into what's happening at my home (though it's really hard to get this little processor to stream live camera images, but work is ongoing)

I have always liked the idea of being able to just switch on browser (or in this case my mobile) anywhere and see, how the weather looks like at home, or if my cats are behaving ;)

Keep it in the kitchen so it works as a clock/calender/task manager - so far the most useful and appreciated function. Everyone loves it ;) I will share the application when I tidy it up.

I had several wall clocks failing during the year. And for me it's crucial that I have a clock and ideally a digital timer in my kitchen! So I've invented (quickly, so the code is not worth sharing yet) a sort of a proof of concept application showing current time (big enough so that I can see it from the living room, and because of the simple fact that it's a lit monitor it also works at night), date, weather information, my appointments, tasks and friends' birthdays from Google calendar and on top of that sun rise and sunset times and moon phase just for fun.

Check the screenshot. I think it's quite neat with Google fonts and HTML5 extras Do you like it?


Real Time Web Analytics