Posts Tagged programming

Moving CVS repository

Recently had to move CVS repository to a new server, while I’m no CVS expert but in the land of the blind! Yadda, yadda, yadda… so down to me. A couple of googles later and with a sesnse of impending soom I did the following:

1. Stop the CVS service and Lock Service

2. Copy CVS Repo folder(s) to the new server

3. Install CVS on the new server – did full installation

4. Replicate the settings of the old server.

5. Add the folder as Repo location

I was able to add the repo location ok, but couldn’t connect :( and when I tried adding a new folder to the repo I got the following error:

cvs init: connect to 127.0.0.1(127.0.0.1):2403 failed: No connection could be made because the target machine actively refused it. cvs [init aborted]: Couldn’t connect to lock server

So the server couldn’t connect to it’s own lockserver? Hmm… maybe the LockServer service wasn’t running or firewall interference? I checked both of these but all good. I thought let’s try stopping the lock server service, that worked! which is weird and the error seemed to say wasn’t running. Anywho I tried the telnet command again and got the CVSLock 2.0 Ready message so all seemed ok :)

TIP: When on the server, you can check the lock server using telnet try doing a “telnet localhost 2403″ and see what you get.  It should respond with “CVSLock 2.0 Ready” if it’s working properly.

Note: I should say I was moving both new and old server were Windows 2003, the versions of CVSNT were the same and the new server had the same name as the old one.

Tags: , , ,

Gotta question? ask Stackoverflow.com

I’ve been a avid user of stackoverflow.com since I first heard of it a year or so ago. For the uninitialted it’s a place to ask development and programming related questions. The commuity is good and the idea of offering rep and badges to help others is great. Rep aint a new concept by any means but the way the stackoverflow team have implemented this simple idea is brill.

The new(ish) kid on the block is serverfault.com, which is aimed at sysadmins. A cool thing is you can link and import you profile from stackoverflow.

Also lats time I was on there i noticed the flair widget which allows you to embed your profile pic/rep/badge in any webpage.

Tags: , ,

Setting Proxy for java app

hi, was playing around trying to get a rest API call to work and keep getting connection and timeout issues. Released as I am doing a HTTP request it needed to be routed via the company proxy server, here’s how I set the proxy details.

System.setProperty(”http.proxySet”, “true”);
System.setProperty(”http.proxyHost”, “130.x.x.x”);
System.setProperty(”http.proxyPort”, “80″);
System.setProperty(”http.proxyUser”, “UsernameHere”);
System.setProperty(”http.Password”, “PAsswordHere”);

Note: This was just a proof of concept to test out consuming a rest webservice, I’m not advocating this as the best way to set the proxy details.

Tags: , ,

Passing client browser info to JSF via javascript

I wanted to get the clients browser info and screen resolution and pass in into to a contact form so I can tell a little bit about the client’s browser encase of unreproducible issues. Basically run a javascript function to collect the info from it’s implicit objects and write that to a hidden form element.

Had this working in JSP ok, and with a slight tweak to account for the : in the hidden field id (fromname:compnonentId) it works.
In JSF file…

function getClientInfo()
{
var clientinfo = “”
clientinfo+=”Browser:” + navigator.appName + “,”
var b_version=navigator.appVersion
clientinfo+=” Version: ” + b_version + “,”
clientinfo+=” Screensize: ” + screen.width +”x” + screen.height
(document.getElementById(’contactfrm:clientinfo’)).value = clientinfo;
}


‹h:form id=”contactfrm” styleClass=”form”>

In Backingbean the usual code to get a request param:

String clientInfo = getFacesContext().getExternalContext().getRequestParameterMap().get(”contactfrm:clientinfo”);

Or is there a better way of doing this? comments most welcome

Tags: , ,