Posts Tagged ‘database’

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!

The server

Friday, February 27th, 2009

My cute little server Defiant, where I run my webserver, database and trekwar server tests, deserves some recognition:

The server itself is a little aopen cube shuttle pc running fedora linux :)

defiant

The server is of course covered with Star Trek ships, a Robotech VF-1, oldschool Batman and a badger for good luck. The server is starting to get old 4-5 years, and if it where not for backups, I would frequently worry about hard drive failure. Before that happens, I hope it will reach the 1000 day uptime :)

Defiant uptime

Mozy

Monday, October 20th, 2008

I’ve been trying out Mozy for backup for a while (the free version limited to 2GB of storage).

I recently upgraded to the mozyhome edition, it’s only 5$ each month for unlimited storage, but only for ONE computer.. And since I’m cheap and there is no Linux client, I just mirror the things from the server I have to back up in a directory on my windows PC (SVN repository, postgres database, web server config/logs/etc).

Uploading the initial data (22 GB) took around 3 days, but the incremental backups are much quicker.

I like that Mozy stores several versions of the file, so I can roll back to a specific date. They only save the different snapshots of files for a month, but for the important stuff I have SVN which lets me do unlimited rollbacks anyway.

update April 27th 2009
I recently managed to corrupt a 30 MB file and had to restore it. unlike the upload of the data, restoring it (downloading) was extremely fast, got around 6 MB/s download speed :)

update April June 6th 2011
Mozy stopped with the unlimited plans, making me get a 125gb plan at twice of what I paid before. So obviously I’m switching to CrashPlan when my mozy account expires. The Crashplan client is much better (allows it to also back up to a local drive, or at a friends computer), and they offer unlimited upload at the same price as mozy 50 GB.. They also have a family option that includes up to 10 computers. It also seems like you can install mozy on both your stationary computer and laptop, and have the laptop backup stuff to your stationary computer, which then backs up to the crashplan servers. Also Crashplan supports linux :)

Bye bye tomcat

Tuesday, April 8th, 2008

I’ve been using tomcat for quite a couple of years now..

But when making working on a registration page for a “ferret show“, I got so goddamn fed up with two things:

1) Each time I recompiled some of the background Java stuff (beans + database manager) I had to restart the server after recompiling

2) OFTEN after recompiling, for no frakking reason whatsoever. Tomcat would bitch about being unable to find the postgresql driver, even though it was in the common/lib as well as the webapps lib directory..

The second issue would sometimes take 5-10 minutes of removing the file, moving it back, restarting the server, removing work/tmp dirs, before it suddenly and miraculously worked again.. So I finally had it, and downloaded Resin and had it up and running in a few minutes.. Copied over the webapps, and now everything works nicely, and I never have to restart the webserver.

I’ve had some experience with Resin from my previous workplace, using the java php implementation and the JMS system. And Resin seems to be pretty nice, and switching from Tomcat to Resin only took a few minutes.. Did not tweak the config much and set up SSH, that will have to wait for the weekend :)

The best passwords

Wednesday, February 21st, 2007

I’m now deleting the database over the 200 students who took the programming class at NTNU some time ago.
In honor of their achievements I thought I might share with everyone, some of their creative passwords:

  • 3 people used their first name as password
  • 11 people used their first name as the main part of their password
  • 13 people used a names from the opposite sex as passwords
  • 3 persons used their student id numbers as passwords
  • 1 person used a phone number as a password
  • 1 person used their favorite soccer team as password
  • 1 person used the numbers 1 to 9 as their password
  • 3 people used the name of the course itself as password
  • 1 person used the word password as password