søndag 6. november 2011

Fix OS X that won´t sleep

I had a problem with my iMac not going to sleep. It happened just the other day, I´ve never experienced anything like it before. I run OS X Lion. If I pressed Cmd + Option + Eject the screen went black, but the disk was still running.

I searched the internet and forums, and found all sorts of solutions. Finally, I found a posting by jcarpio on https://discussions.apple.com/thread/3190738?start=45&tstart=0.

His solution is to type in a couple of commands to actually pin down the cause of the non-sleep.

Open Terminal and type in:

pmset -g

You´ll get some output, and one of the lines would probably read something like:

sleep 0 (imposed by 18)

Sleep 0 tells us that sleep is disabled because of a process with id 18. It can be any number, if you´ll get 18 in your terminal, it´s a coincident.

The next step is to find out what number 18 really is. Type:

ps -ef | grep -e 18

The | is called a "pipe", and is written by Option + 7 on the small mac keyboards.

You´ll get some input on what is is. jcarpio´s problem was his printer being shared on the network, mine was that there was a document in the print spooler, and no printer connected. I opened the print spooler, and deleted the print job, and ta-da, the problem was solved!

onsdag 7. juli 2010

Verdien av tid

For å forstå verdien av ET ÅR, spør en student som strøk til eksamen.
For å forstå verdien av EN MÅNED, spør en mor som fødte et barn for tidlig.
For å forstå verdien av EN UKE, spør redaktøren av en ukeavis.
For å forstå verdien av EN TIME, spør de nyforelskede som venter på å møtes.
For å forstå verdien av ET MINUTT, spør han som kom for sent til flyet.
For å forstå verdien av ET SEKUND, spør en person som akkurat unngikk en ulykke på motorveien.
For å forstå verdien av ET MILLISEKUND, spør han som kom på annen plass i en OL-konkurranse.

onsdag 12. mai 2010

How to sign an IIS SSL certificate request with OpenSSL on Linux

http://www.ehow.com/how_4719978_ssl-certificate-request-openssl-linux.html has a how-to on this, but it has some inconsistencies with the file names. There is a comment stating this, but they have not updated it, therefore I've chosen to put a correct how-to here:

You would need access to a machine with OpenSSL on it

  1. Use IIS on your Windows machine to generate your IIS SSL certificate request file, which should be named certreq.txt by default.

  2. Transfer this file to your Linux machine using whatever method you like.

  3. First, we need to generate a private key to sign the certificate with. Lets generate one that's 2048 bits. You'll need to enter a pass phrase too:

    # openssl genrsa -des3 -out ca.key 2048

  4. Next, we'll need to create the CA certificate to sign with:

    # openssl req -new -key ca.key -x509 -days 9999 -out ca.cer

  5. Finally, we'll need to sign the IIS certificate with our new CA:

    # openssl x509 -req -days 9999 -in certreq.txt -CA ca.cer -CAkey ca.key -CAcreateserial -out iis.cer

  6. Your new, signed certificate is the file iis.cer. Transfer this file back to the windows machine, and load it up into IIS. It's good for 9999 days!
Please visit eHow to see some tips and warnings regarding this.