Thursday, 22 January 2015

SQL Server Express 2014 for local connections

Amazingly, the default configuration for SQLServer Express does not enable local connections. To enable them:
  1. Open the Sql Server Configuration Manager. Available at All Programs > Microsoft SQL Server ... > Configuration Tools
  2. Under SQL Server Network Configuration > Protocols for SQLEXPRESS, enable Named Pipes and TCP/IP as needed.

Oh well.

Wednesday, 10 December 2014

Installing PortaShop locally on ubuntu 14.04

These are the steps I took:
  1. Install apache2, mysql, php5 and other requirements: php5-mysql, php5-mcrypt, and php5-gd.
  2. Create a database called "prestashop" and a database user qith all permissions on it.
  3. Download the site files at: http://www.prestashop.com/en/download. Mine were "prestashop_1.6.0.9.zip"
  4. Uncompress it and copy the top directory called "prestashop" to where the web application will be stored. I'll use "/path/to/prestashop" from now on.
  5. Make sure the permissions in the directory allow the web server user "www-data" to have full access to it. As root run:
    1. chgrp -R www-data /path/to/prestashop
    2. chmod -R g+rwx /path/to/prestashop
  6. Create a new virtual host with the name "dev.prestashop.local"
    1. Add the new host name to the hosts file, adding the line "127.0.0.1  dev.prestashop.local"
    2. Copy the file /etc/apache2/sites-available/000-default.conf to /etc/apache2/sites-available/prestashop.conf
    3. Modify its content to:
    4. <VirtualHost *:80>
      
       ServerName dev.prestashop.local
      
       DocumentRoot /path/to/prestashop
      
        <Directory /path/to/prestashop >
      
         Options Indexes FollowSymLinks MultiViews
      
         AllowOverride all
      
         Require all granted
      
        </Directory>
      
        ...
      
      </VirtualHost>
      
      
  7. Reload apache, running as root: service apache2 reload
When you browse to dev.prestashop.local you should be able to pass all the compatibility tests:

PrestaShop compatibility test passed

Saturday, 15 June 2013

Java: chocking on unexpected BOM

I found myself needing to run a java application that reads its configuration from a properties file. This app extracts data from a database. From the configuration file it's supposed to read the url to connect to the database, username and password... amazingly, it would complain with a very cryptic error message:

ERROR: conect Database
java.sql.SQLException: No suitable driver found for
    at java.sql.DriverManager.getConnection(DriverManager.java:602)
    at java.sql.DriverManager.getConnection(DriverManager.java:185)


What? no driver for ""... but the url is perfectly fine in the config file:
url=jdbc:oracle:thin://@localhost:1521/xe

After modifying the sources, recompiling the package, and running the new code to get the same error message... with extra debugging data I found out the source of the problem: JAVA!!!

Amazingly, if you edit the properties file in windows with the infamous notepad++, by default, it adds a useless and unnecessary BOM that makes java choke running the application or compiling the sources.

To be fair, adding a BOM to a UTF-8 encoded file is not necessary and not recommended by the standard, but I'd expect java to be more robust...

Friday, 26 October 2012

How to integrate eclipse with Weblogic 11gR1 10.3.5

Requisites

  • Weblogic 11gR1 installed and configured.
  • Eclipse indigo javaEE
1. Add Weblogic server adapter
In eclipse, preferences > Server > Runtime Environments click on Add... a window opens with the available adapters. If Oracle > Weblogic is not available, click on "Download additional server adapters" and install "Oracle Weblogic"

2. Once the adapter is installed, "Oracle Weblogic Server 11gR1 (10.3.5)" should appear in the list of available types in the previous window (Add a Runtime Environment). Select and click Next

3. Important, the "Weblogic home" entry should point to the "wlserver_10.3" directory where the server was installed. Any other directory will not be valid. Once properly selected, the next entry (Java home) should be filled automatically.

Tuesday, 27 March 2012

How to recover the Numeric keypad in Ubuntu 10.04

I have a laptop Samsung R540, running Ubuntu 10.04. The numeric keypad stopped working
When you BlockNum key does not work to enable your numeric keypad, try:
  1. Try with Shift+BlockNum first.
  2. If that doesn't work. Try menu System-> Keyboard.
  3. The Keyboard Preferences opens. On the Layout tab, make sure you have a compatible Keyboard model with numeric keypad. If in doubt, any "Generic 105-key" will do.
  4. On the Mouse Keys tab, the Pointer can be controlled using keypad option should be unchecked.
  5. If the keypad is still not working, go back to the Layouts tab, and click on the "Options..." button.
  6. Among the Miscellaneous compatibility options you'll find "Default numeric keypad keys" which should be checked.
HTH.