Command-line installation of OpenVPN

OpenVPN’s installer allows for command-line based (silent) installation, but this feature is not actually documented explicitly anywhere. Here’s all I could find – hope this list will help someone in the same situation I was in.

Continue reading

Turn Your Box into a Dev Web Server

To turn your box into a dev web server is pretty simple, yet I’ve seen people struggling with this over and over again, so here’s a simple TODO list.

I won’t go over the likes of Apache installation, VirtualHost setup, .htaccess settings, etc. as you can find these online very easily, and might be specific to the needs of your project.

Most of the time I see people using localhost:8080 and a myriad of other ports to work on several sites locally; but you might as well work on http://www.myproject.com locally in just 2 simple steps:

  • Create a VirtualHost in Apache which goes by “the name” http://www.myproject.com, by including the following within the definition:
    <VirtualHost *:80>
        ServerName www.myproject.com
        DocumentRoot /var/www/myproject/
        # all the other options and definitions ...
    </VirtualHost>
  • “Register” the domain name locally – simply add the following line to your /etc/hosts file (on Windows, this file is typically located under [Windows]/System32/Drivers/etc):
    127.0.0.1    www.myproject.com

Now enable the VHost in Apache, restart Apache, and open http://www.myproject.com in the browser, and you’re ready to code off!

Note: The VHost name need not be a valid domain name – feel free to use myproject as ServerName and in /etc/hosts; just beware that some browsers will try to search for “myproject” instead of opening the local site. In such case, type in the whole http://myproject.

IE Certificate Error with Signed Certificate

So, you’ve got your shiny new certificate, and your good old server. You’ve installed the certificate, chain or intermediate certificate, and all is nice and clean in FireFox, Chrome, Chromium, etc.

Then, your boss opens up his IE, and gets Certificate Error – “not issued by trusted certificate authority” and/or “issued for a different website’s address”. Of course, that’s a major pain, as IE – however bad, buggy and crappy it is – still holds majority of browsers market, as most computer users are incapable of installing a better browser.
Continue reading

How to change line height in NetBeans’ editor

After changing font size in editor in NetBeans 6.5, the line height (line spacing) all of a sudden grew to about 2 “normal lines”, and didn’t change back even when I returned to the original font size.

The only work-around I found was to edit manually the editor’s configuration file (since this option is not available via GUI).
The file org-netbeans-modules-editor-settings-CustomPreferences.xml can be found in ~/.netbeans/6.5/config/Editors/Preferences (on Windows, it’s in {install_dir}\ide10\config\Modules ). If it’s not there, change any editor settings in NetBeans IDE, and it’ll create it.

Open this file in your favourite text editor, and add the following code right before the last line (right before the </editor-preferences> tag):

<entry javaType="java.lang.Float" name="line-height-correction" xml:space="preserve">
    <value><![CDATA[0.7]]></value>
</entry>

And that’s it! Restart the NetBeans IDE, and all should look much better. Happy coding!

Another solution, thanks to Mark :

  1. Install sun-java6-jdk
  2. Uninstall open-jdk
  3. Reinstall NetBeans