jump to navigation

Maven POM May 31, 2006

Posted by maxmil in : Java, Maven , add a comment

A usefull article….

http://www.javaworld.com/javaworld/jw-05-2006/jw-0529-maven.html

Dual Boot System and Setting hwclock to local time

Posted by maxmil in : Debian , 1 comment so far

On my dual boot system with Windows a Debian i’ve been having problems syncronizing the clock. This started when we changed to BST. It turns out that the problem is that Windows changed the BIOS clock rather than making this change in its software clock (don’t know if it has one) which confused linux.

From what i’ve read the anwser is to set Linux to localtime rather than UTC time. To do this

apt get package information May 25, 2006

Posted by maxmil in : Debian , add a comment

To get the information on a package from the apt-cache…

apt-cache showpkg

ifscheme – configuring multiple wireless interfaces on debian sarge

Posted by maxmil in : Debian, Networking , 1 comment so far

I was having the annoying problem that my wlan0 configuration in /etc/network/interfaces was different at home and at work. This is quite normal really, the essid and the key are expected to be different. The problem was that every time i changed location i had to redit my /etc/network/interfaces file and ifdown wlano, ifup wlan0 in order to connect to the new network.

I now have a solution: ifscheme

I configured it with apt. The versión that i got at the time of writing was 1.3-3.

How to use it 

/etc/network/interfaces

First add a mapping to allow ifscheme to control the interfaces

# Wireless interfaces controlled by ifscheme
mapping wlan0
        script ifscheme-mapping

Then define the interfaces as…

# Home wireless inteface
iface wlan0-home inet dhcp
        wireless-essid ESSIDID
        wireless-mode Managed
        wireless-keymode open
        wireless-key1 xxxx-xxx…
        wireless-defaultkey 1
        name Home wireless 

 # Work wireless inteface
iface wlan0-home inet dhcp
        wireless-essid WORKESSIDID
        wireless-mode Managed
        wireless-keymode open
        wireless-key1 xxxx-xxx…
        wireless-defaultkey 1
        name Home wireless

Thats it! 

Regular Expressions quick start May 24, 2006

Posted by maxmil in : Utils , add a comment

Check out this page for a quick start and reference:

 http://www.regular-expressions.info/quickstart.html

Drunk on Wine with Debian Sarge May 17, 2006

Posted by maxmil in : Debian , add a comment

An afternoon spent flighting with wine on debian just because i need IExplorer 6…

The version of wine that is in the stable package of debian sarge is VERY VERY old, it installed fine and succesfully opened a flash standalone app with no probs. However installing IExplorer was another story. After reading different threads i set about installing IExplorer. Fist i installed dcom98 (changed a couple of dll's in .wine/conf but nothing too complicated) and then tried to run the iesetup.exe. Impossible!! Playing with DllOverides in .wine/conf i eventually got it to install but then it wouldn't start.

In the end i gave up and decided to use a more recent version of wine. I added debian backports  to my apt sources:

deb http://www.backports.org/debian/ sarge-backports main

And added this to /etc/apt/preferences (by default the file did not exist)

Package: *
Pin: release a=sarge-backports
Pin-Priority: 200

Package: wine
Pin: release a=sarge-backports
Pin-Priority: 999

Package: libwine
Pin: release a=sarge-backports
Pin-Priority: 999

Package: wine-utils
Pin: release a=sarge-backports
Pin-Priority: 999

Basically this makes apt only use the backport versions in the case of the three packages wine, libwine and wine-utils.

Then i successfully installed wine, libwine and wine-utils. All version: 0.9.7-0bpo1.

NOTE: Once wine is installed i had to run wine with no arguments and chose the option "config" before continuing.

Now comes the best bit.

winetools: What a godsend, i take my hat off to the people who made it.

I downloaded the latest version in a tar.gz
I unpacked it
I ran ./install from the directory it created AS ROOT
I opened the program and followed the instructions.

NOTE: It wasn't necessary to install the flash plugins for IExplorer as the program was able to do it itself the first time it found a flash object on a page.

And thats it. I'm happy. My advice is – backport to get  latest version and winetools.

To open iexplorer:

/usr/loca/winetools/scripts/ie6

Define function in jsp May 11, 2006

Posted by maxmil in : Java, jsp , add a comment

Been working with some very long messy jsp's. In this environment using servlets or external classes was not an option but the least i could do was to try to extract methods from the mess… Heres how to define a method in a jsp. Include it at the bottom.

<%!
  public void btn_AddUpdate(HttpServletRequest request, JspWriter out)  throws java.io.IOException {
    //do your stuff here, normally involves out.print(…) 
  }
%>

Increase VM memory for eclipse May 9, 2006

Posted by maxmil in : Java, eclipse, tomcat , 1 comment so far

Sometimes when running tomcat inside eclipse i've been getting VM out of memory errors.

To solve this problem..

Go to window->preferences->java-installed jre's->edit

and add the values:

-Xms512m -Xmx512m -Xss256k (or the amount of memory you want)

eclipse starts tomcat with those values.

Configure jndi datasource May 5, 2006

Posted by maxmil in : websphere , add a comment

**NOTE: MUY IMPORTANTE REINICIAR SERVIDOR 

From the admin console

Create the JDBC provider

The following procedure describes how to create the JDBC provider.

1. Select Resources icon: forward arrow JDBC Providers.
2. Click New.
3. For JDBC Providers, select Oracle JDBC Driver from the drop-down list.
4. Click OK and enter values in the Configuration tab.
* Name (for example, mcsJDBC) If you use a name other than mcsJDBC, use your JDBC provider name in place of mcsJDBC later in this procedure.
* Description (for example, JDBC provider for Multi-Channel Server database).
* Classpath /classes12.zip where is the directory path to classes12.zip on your WebSphere Portal server.
Note: ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip is the default value for the Classpath property. Either replace this value with /classes12.zip or Use Enviroment icon: forward arrow Manage WebSphere Variables to set the ORACLE_JDBC_DRIVER_PATH variable if it is not already set. If a value is not specified for the ORACLE_JDBC_DRIVER_PATH variable, set it to . The variable name represents the directory path to classes12.zip on your WebSphere Portal server.
5. Click OK.
6. Select the JDBC provider that you just created (for example, mcsJDBC).
7. Click Data Sources (under Additional Properties).
8. Click New and enter values in the Configuration tab.
* Name (for example, mcsDS) If you use a name other than mcsDS, use your datasource name in place of mcsDS later in this procedure.
* JNDI Name jdbc/mcsDS (Start the JNDI name with jdbc/.) If you use a JNDI name other than jdbc/mcsDS, use your JNDI name in place of jdbc/mcsDS later in this procedure.
* Description (for example, Multi-Channel Server data source)
9. Select the previously created J2C entry from the Component-managed Authentication Alias drop-down list (for example, mcsDBauth).
10. Click OK.
11. Select the data source you just created (for example, mcsDS).
12. Click Custom Properties (under Additional Properties).
13. Click the URL link.
14. In the Value field, enter the path to the Multi-Channel Server database

jdbc:oracle:thin:@:1521:

where is the Oracle SID you created for the Multi-Channel Server database (for example, mcs).
15. Click OK.
16. Save the configuration.
17. Use the following commands to restart the server1 application server:

/bin/stopServer.sh server1
/bin/startServer.sh server1

Note: For information regarding directory path variables, refer to Variable names used in the Information Center for user supplied information.
18. Log in to the WebSphere Administrative Console.
19. Select Resources icon: forward arrow JDBC Providers icon: forward arrow mcsJDBC icon: forward arrow Data Sources.
20. Select the mcsDS check box and click Test Connection.
Note: If the test connection fails and you modify the configuration, you must restart the server1 application server before testing the connection again.

From the application code 

Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/mcsDSC");
conn = ds.getConnection("user", "password");

Note: 

This leaves messages in the log. To avoid this an alias must be defined: http://www.webspherepower.com/issues/issue200410/00001357002.html