All posts by Torleif

Excel time calculation and formatting

It’s actually really simple, but for some reason I just keep having to look up some of these… so… finally… note to self…

Calculations =X+Y
=X+N
=Y-X
Etc.
12:45 - 9:55 = 2:50
Time to decimal =X*24 2:50 * 24 = 2.83
Decimal to time =X/24 2,83 / 24 = 2:50
Days, hours, minutes d h:mm 11 19:20
Total hours and minutes [h]:mm 283:20
Total minutes [m] 17000

Regarding the formatting, without the brackets, it formats as regular time (total hours % 24). So, for example, 2 hours and 50 minutes multiplied by 100; with a regular time format (h:mm) it displays as 19:20; using brackets ([h]:mm) you get the correct 283:20, which is 11 days 19 hours and 20 minutes (hence the 19:20 from h:mm).

Excel screenshot

How to add certificates to the Windows certificate store

There’s a command-line tool called certutil one can use to add (among other things) certificates to the certificate store in windows.

Some examples:

REM Add pfx-file to Personal
certutil -ent -p pfxpassword -importpfx my some.pfx

REM Add pfx-file to Trusted Root Certification Authorities
certutil -ent -p pfxpassword -importpfx root some.pfx

REM Add cer-file to Trusted Root Certification Authorities
certutil -ent -addstore root some.cer

Manage saved windows passwords

Logged into a windows share via explorer and hit the Remember Password option. Even though the login was accepted (and saved) it turned out I had used the wrong ad domain name…

Couldn’t find where to reset/change/”logout” again, but eventually found there’s a built-in command-line tool one can use for managing these saved passwords. Think I’ve seen a control panel type thing to do this too in the past, but just couldn’t find it today… Anyways, command-line is nice, so, using imaginary share \\foobar.int, here’s some stuff one can do:

> cmdkey /list
> cmdkey /list:foobar.int

> cmdkey /delete:foobar.int

> cmdkey /add:foobar.int /user:domain\username /pass