topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 4:56 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: IDEA: Simple PC Usage Timer  (Read 33626 times)

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #25 on: November 28, 2006, 09:26 AM »
How we doin?

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #26 on: November 29, 2006, 12:16 AM »
Today I’m gonna work on it further. I haven’t had time in the past days, sorry ‘bout that.
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #27 on: November 29, 2006, 07:54 AM »
No probs. Thought you'd lost interest!

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #28 on: November 30, 2006, 01:35 AM »
Okay I made some progress. I’m still have to find a way to intercept the Windows key to prevent access to the start menu though.

Some instructions for this version:

After installation is complete go to the installation folder and edit the file ‘info.rtf’ with MS Word or Windows Wordpad to suit your needs. This is the text displayed on the start page.

There is also a file called ‘pw.file’. You can open this with Notepad or any other plain text editor. This file contains the MD5 hash for the shutdown password. You can generate a valid hash for your password on http://www.allhype.co.uk/tools/md5/. Just type your password and click button to generate the hash. Copy the result into the file on the first line (!) and save it. This is the best security I can offer in this short period of time :) Cracking an MD5 hash is not easy though and one has to resort to brute forcing so I guess it will suffice for this purpose.

Please try it out so far and let me know what you think.

Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #29 on: November 30, 2006, 04:40 AM »
Absolutely fantastic. Encrypted passwords? Formatted text? You've outdone both yourself and my expectations. Now all I need is for it to make my coffee in the morning :)

I mentioned back in my first post that I'd like to integrate it with a sql db on my network. I'm not asking for you to do this, but what would the best way to go about it? All I'd need to have it do is change a number in one table field eg 0 for stopped, 1 for paused, 2 for started

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #30 on: November 30, 2006, 04:50 AM »
Using an SQL DB along with it is quite easy to implement. What I can do is expand the program to read some data about the server from another textfile or hardcode it. The program can then connect to the DB and set the field accordingly. I prefer the method of reading critical server data from a text file so that you can change these settings yourself in case you ever change the server or something. All the program needs to know is the server name, database name, table name and field name. I don’t need to know these things, you can enter them yourselves, but I do need to know whether I can use a trusted connection or a username/password combination?
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #31 on: November 30, 2006, 04:59 AM »
That's excellent. My current db uses a username/pw. The external file would be ideal.

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #32 on: November 30, 2006, 05:01 AM »
On another note: the password which I used in the example is ‘john’ without quotes, just in case you can’t exit the program anymore :P

Another question about the SQL part: I assume you have multiple PC’s running, so what is the key in identifying the correct row in the table? Do you use the computername or some other ID I could get in the program?
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #33 on: November 30, 2006, 05:34 AM »
Thanks. I did have a little trouble :)

I have four pcs called feale1, feale2 etc as their computer names.

But if I can specify the table/field name in sql, can't I just point each system to a different field?

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #34 on: November 30, 2006, 05:44 AM »
Yes you can, you can edit the text file on each PC and name the field differently. But for the SQL Update command I need to specify a WHERE clause, identifying the row to use. If the table has only one row then that’s not a problem though.
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #35 on: December 14, 2006, 10:33 AM »
Hey Ruffnekk.

That's working perfectly for me. I've had it on my client machines for just over a week now and it's making my life a lot simpler!

How're you coming with the mySQL connection?



Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #36 on: December 14, 2006, 12:20 PM »
Well, I was actually waiting for you LOL I really need some more information for that. Can you describe the structure of the table?

I'm happy to hear it's working though :)
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #37 on: December 15, 2006, 05:30 AM »
Sorry about that!

I can set up the table however it needs to be set up. I have a mySQL server running some other software on the network and I can add the stuff that the usage monitor needs to that.

I suppose all it'd need would be a two field table for Computer Name and Usage Monitor State. Then the prog could write say a 1 for inactive, a 2 for active and a 3 for paused?

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #38 on: December 15, 2006, 06:17 AM »
Yes that's alright. I'll try to make it so that you have to configure these things in an ini file. You have set the server name, table name and computer name there. I think I can then handle it from within the app. Please allow a fews days because it's kind of busy at work today  :-\
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #39 on: December 15, 2006, 06:24 AM »
Excellent. No rush. Like I say it's working away fine at the moment.

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #40 on: December 19, 2006, 03:11 AM »
Okay Fealit, I made some changes you should test to see if the SQL Server part is working correctly or not.

I added a file called 'sqldb.data' to the installation. You can edit it with notepad.

The current contents of the file are:

Server=YourServerName
Database=TheDatabaseName
Table=TheTableName
StatusField=TheFieldnameContainingTheStatusCode
IDField=TheFieldnameContainingTheComputerName
User=YourSQLServerUsername
Password=TheMD5HashForYourSQLPassword
/* Please do not change the order of the above parameters */
/* Do not insert spaces before or after the '=' sign */
/* You don't have to use quotes if a value contains spaces */

I hope it is self-explanatory. If you have questions, contact me!

I couldn't test it at all since my PC at work doesn't have SQL Server, but I think it should work if you set the parameters correctly. I hope to hear from you soon about it :D
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #41 on: December 19, 2006, 05:17 AM »
I'll give it a go this afternoon and let you know.

Cheers

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #42 on: December 20, 2006, 09:41 AM »
When it asks me for the database password when I start the app, do I use plain text or the md5 hash?

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #43 on: December 20, 2006, 02:19 PM »
I don't have the source code here at home, but I think you should give the real password so it can be compared to the hash in the sqldb.data file. (I'm working on a lot of projects for work and personal use so I can't remember every detail lol, sorry 'bout that)
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #44 on: December 21, 2006, 04:20 AM »
I'll try both. Cheers

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #45 on: January 05, 2007, 09:34 AM »
Still struggling to get it to connect to the mysql server. I've installed the ODBC driver and I'm trying to get it to work through that.

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #46 on: January 08, 2007, 12:17 AM »
Hi fealit, can you tell me what the problem is? Any error codes or messages?
Regards,
RuffNekk

Programming is an art form that fights back.

fealeit

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 25
    • View Profile
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #47 on: January 08, 2007, 03:03 AM »
Just says "SQL Server does not exist or access denied"

I'm using the ODBC connector in win 2k and the test there says connected ok.

One thing, the db is MySQL, not SQL. Not sure if that makes a difference.

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #48 on: January 08, 2007, 04:49 AM »
Yes that makes a difference! I thought it was SQL Server :) I'll try to modify some things today for you.
Regards,
RuffNekk

Programming is an art form that fights back.

Ruffnekk

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 332
  • Uhm yeah...
    • View Profile
    • RuffNekk's Crypto Pages
    • Donate to Member
Re: IDEA: Simple PC Usage Timer
« Reply #49 on: January 08, 2007, 05:00 AM »
Okay, could you try to install this new version. You may want to back up your files info.rtf, pw.file and sqldb.data or they might be overwritten by the setup.
Regards,
RuffNekk

Programming is an art form that fights back.