Archive for November, 2011

Refresher and coffee machine a’la’Romania

This afternoon I took my car to a car wash. There is one place I really like, because they have a nice waiting room, where you can escape from the cold outside weather. When I opened the door, the first thing I noticed was two nice machines, one for coffee and the other for refresher… I saw them from their side, so when I got in from of them… Well, this is what I saw:

Angry birds

Took this picture in Targu Mures on a cloudy Sunday afternoon in November… Tthese pigeons are more like “hungry birds” than “angry birds”…

How to block keyboard keys in forms with javascript

A client asked me to block the ENTER key in a form I created for him. After some research, here is the piece of code you have to enter into the page, which will block the event:

<script type=”text/javascript”>
$(document).ready(function() {
document.onkeypress = stopRKey;
});
function stopRKey(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
if ((evt.keyCode == 13) && (node.type==”text”))  {return false;}
}
</script>
The 13 in the code above is the code for the ENTER key, replace that if you want to block an other keypress.

The plan is fulfilled

Skoda Fabia 1.4 16v 75hp hatchbackI forgot to post a very important info… THE PLAN GOT FULFILLED!

I have a beautiful Skoda Fabia hatchback, 1.4 16v 75HP… But what is more important: IT IS MINE! :)

Exactly 2 months passed since I bought it, and in this period I can say I got used to it, and… well, I love it! So I am a proud car owner!

How to secure your Apache web server

I have wamp installed on my local PC with static IP. As I use it for development, sometimes I am sending the customers links to applications, to check and feedback them.

A problem I experienced is that Google indexed 2 files on my PC. How he did that remains a mistery for me, but for sure this is a HUGE security problem, databases and important mails got public. So, how did I solve the problem? I created a .htaccess file like this:

Allow from xx.xxx.xxx.xxx
Deny from all
AuthUserFile c:\wamp\pwds\.htpasswd
AuthName “Members Only”
AuthType Basic
require valid-user
What the above means:
1. I am now filtering the visitors based on their IP address. Right now only my IP is enabled, the rest will get an Access Forbidden error message.
2. Secondly, for the IPs enabled, there is a username-password combination which needs to be known. They are set in the .htpasswd file, something like:
username:password