Posts Tagged ‘jsp’

I love VPS.net!

Monday, March 1st, 2010

I recently moved all my php sites to a new server, about a month ago, and had previously used VPS.net for my jsp/svn/etc.. server for quite a few months.

Running tomcat and sql + a few other things have used up almost all the memory on my java server, so I was thrilled to find a mail from vps.net in my inbox today, stating that they will upgrade all nodes from 256 mb ram to 375, and add 200 mhz cpu :D

on VPS.net you create your own virtual server which is made up of 1-18 nodes (1 node = 256 mb ram, 400 mhz cpu, 10 gb disk). So it’s very easy to make new machines, or upgrade an existing one by adding more nodes (then just restart the virtual server).

The server has been extremely stable, fast (the site your on now runs on a single node) and only restarted once, the website it runs is being monitored and have not had any downtime. This is by FAR the best virtual (or even dedicated!) server solution I’ve ever tried, and I would absolutely recommend it for anyone who needs a virtual or dedicated server. 1 node is just 20$ per month, there are no sign up fees and you can cancel at any time (1 node will be able to host a good amount of http/php/mysql content).

And if anyone wonders, no I’m not getting paid by VPS to advertise for them :) They’re just so awesome that I HAD to mention it, there are so many crappy hosting / virtual server companies but these guys really are awesome :)

Resetting password in JSPWiki

Thursday, October 22nd, 2009

The Trekwar Wiki runs on JSPWiki 2.8.1 (which is pretty awesome BTW).

I just reinstalled my OS and had lost the password, and the Wiki is not set up to use email, so I could not reset it by web.

So I had to find a way to do it by console, and a google search did not provide a complete solution, so here it is:

  1. Log into the server where the Wiki is hosted
  2. generate your new password (the password in this example is “password” and it’s hash is the green text below, you can use this if you want)
    echo -n password | sha1sum
  3. The command above gives you a “encrypted” password: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
  4. The user database in JSPWiki is a xml file that resides in the WEB-APP directory and is called userdatabase.xml
  5. This file has a simple format, each user has a <user> tag. So just find the user you want to reset the password for
  6. The user tag has a password filed that looks something like this:
    password="{SSHA}XXXXXXXXXXXXXXXXXXXXXXXXX"

    Change this to: (remember to use your own password hash if you made one, or use the green one above):
    password="{SHA}YYYYYYYYYYYYYYYYYYYYYYYYYY"
  7. NOTE: changing from SSHA to SHA
  8. Log in with your new password (or “password” if you used the green hash above)
  9. Change your password!

hiding svn directory in resin

Thursday, February 12th, 2009

I got all my websites checked into Subversion (SVN), and usually scp them from my desktop to the webserver. But sometimes I edit the pages directly on the server.
So to keep changes from being lost, I decided to just have a checked out version of the page (svn) on the server as well.. To keep things in sync :)

But for some reason I don’t want people to snoop in my .svn directory. I googled but did not find any immediate solution, so here it is, a quick fix for anyone who might have the same “problem”.

Hide .svn directory in resin webserver
(also works for cvs or anything else you don’t want resin to give those greedy users)

just add a rewrite rule for the host in the resin configuration file (resin.conf), this prevents the webserver from letting anyone into the directory (or viewing svn/cvs files).

Here is my config file:

<host id="www.trekwar.org" root-directory=".">
<host-alias>trekwar.org</host-alias>
<web-app id="/">
<document-directory>webapps/trekwar.org</document-directory>
</web-app>
<rewrite-dispatch>
<redirect regexp="\.svn" target="index.jsp?msg=keep+away+from+my+svn+directory"/>
</rewrite-dispatch>
</host>

Long weekend, of debugging..

Monday, May 12th, 2008

The last week I have been finishing up the online registration system for Nidarosilder, a local ferret show here in Trondheim that we are attending  in early September.


The system runs on jsp and postgresql and allows user to register, then they receive a password they use to log in. When logged in they enter their name and other info, and can add up to 20 ferrets. Also my friend Anne who organizes the show has a admin page where she can see all users/ferrets, and sorted displays to make it easier to set up the different classes for the show.

Seeing that the ferret system was ready thursday, I got to spend most of this long weekend (Dont have to work monday 12th because of some religion thingy) on my Startrek game.

I debugged the Research system, and had some problems with the object serialization between the server and the client (ObjectOutputStream.writeUnshared() only writes the ROOT object unshared.. I learned that the hard way). I also made the client show a counter that counts to next game turn, a animation that shows while downloading map data, I implemented the Order system, and now it is possible to move a starship.
Below you can see a federation fleet moving to sector 3:7 (the yellow dots show the path) :)

Thursday 22. I will be going to Austria with the people from work, so maybe then I will have the time to implement the build system when there =)