Consciousness

LASIK and Haze / Foggy / Cloudy Vision

Posted in LASIK by Personalife on the August 27th, 2009

So yesterday, I woke up to a major shift in the vision in my left eye – things were REALLY hazy like as if it was when I just came out of the operation. I knew that post-op you’re to expect shift in vision quality, but this was a major negative shift. I had six hours of sleep, and I always put lube drops in my eyes prior to sleep. I called my doc to ask what’s going on, and she asked me what I was doing prior (sleep), and if I might have rubbed my eyes (only thing I can think of is I sometimes sleep face down on the pillow, which puts pressure on the eye).

Anyways, she thinks it was just major dry eyes, and told me to put drops in my eyes every 30 mins (I usually do every 2-3 hours), and told me that as long as I’m not feeling any pain (I was not), I should be fine. She also scheduled an appointment to see her today if it was necessary.

Gradually through yesterday, my sight improved again, and this morning, it’s back to normal.

I made this post as a general FYI to those who experience this to not freak out completely. If it persists for more than one day, then see a doctor.

But man, that was sorta scary.

How To Implement and Set Up DomainKeys Identified Mail (DKIM) on hMail Server

Posted in email by Personalife on the August 20th, 2009

We recently moved from using Magic Winmail as our mail server to hMailServer since it was more cost effective (as in free) and had more features. One of these features is DKIM, or DomainKeys Identified Mail, which if enabled, would improve deliverability of our e-mails. Here’s how I set mine up:

1. Generate the public and private keys. You need OpenSSL to do this.

> openssl genrsa -out private.key 1024
> openssl rsa -in private.key -pubout -out public.key

2. Enter the corresponding TXT records into your DNS for your domain. For example, my domain is journal.suteki.nu. I would do the following in my DNS:

_domainkey.journal.suteki.nu  IN TXT  t=y; o=-;
_adsp._domainkey.journal.suteki.nu  IN TXT dkim=all
[selector]._domainkey.journal.suteki.nu  IN TXT  g=*; k=rsa; p=[public_key]

Where [selector] is the name of your selector (eg ‘mail’), and [public_key] is your key from your public.key file generated from #1. Just make up something for [selector] and keep note of it.

An example would be

_domainkey.journal.suteki.nu  IN TXT  t=y; o=-;
_adsp._domainkey.journal.suteki.nu  IN TXT dkim=all
mail._domainkey.journal.suteki.nu  IN TXT  g=*; k=rsa; p=bNJOPhYuAAxTdO0PNGiKSL9rLLdDBuj3q0Rpa3pg2r/oNTONqGSIb3DQ8mz16NbSSSs5YcBkKTRDunxOFP0UtEmZJMQk0yERL1jEg86l8ZDmOckldH5EWIhsnbDjGh1fxT5ku7cXjtKwIDAQABMIGfMA0GCSqADCBaku0mO6bbcm/mEfnBKov3otig6iPXiQKBgQDxdpMEBAQUAA4GNEdKCn

(
Note: That’s a made up public key :P
Notex2: The t=y is a testing flag. You will want to remove this once you’ve verified your keys work.
Notex3: It will take up to one day for your DNS records to propagate. Do not be frustrated if the tests come up negative within the first 10 minutes of filling in the records!
)

3. Set up DKIM in hMailServer for a domain.

Open up your hMailServer administrator and go to the domain you want to enable DKIM in. For the private key file, select the private.key you generated from #1. In selector, type in the [selector] you selected.

For signing algorithm, choose either SHA1 or SHA256. I went with SHA1 so our server resources do not get consumed as much when signing the e-mails. The config should look something like this:

DKIM configuration

Save the config. Your domain is now set up for DKIM.

4. Send a test e-mail from one of your accounts in the domain.

I sent a test-email from an account I created, test@journal.suteki.nu, to one of my accounts on gmail. When it arrived in gmail, I checked the headers:

Show headers

What you want to check for is the dkim-signature block in the headers:

A successful one looks like this:

Authentication-Results: mx.google.com; dkim=pass header.i=@journal.suteki.nu
dkim-signature: v=1; a=rsa-sha1; d=journal.suteki.nu; s=mail;
	c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=/edzoYuyn17WXm8KeqcX/R+khdQ=;	b=0cnc21MgZMy9suqAgFPlA5OqD5fpFmuGoK+UYlf9zvqPwRgRgjb6OP+VwjwYE2AVxhdVRdX8nEdQ0XnUht45SQHKh78dCXK+UiS7x6qE2haLrZi7CHvs6qp8otQdkcLBrYF0Z95Blp1Vh9BHvQFodNdwJUhgp9u/BoZH/Gq8xx0=

While an unsuccessful one might (might as in I haven’t determined if this is considered invalid, but this is what it first looked like for me) look like:

Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@journal.suteki.nu
dkim-signature: v=1; a=rsa-sha1; d=journal.suteki.nu; s=mail;
	c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=/edzoYuyn17WXm8KeqcX/R+khdQ=;	b=h9BHvQFodNdw0cnc21MgZMy9suqAgFPlA5OqD5fpFmuGoK+UYlf9zvqPwRgRgjb6OP+VwjwYE2AVxhdVRdX8nEdQ0XnUht45SQHKh78dCXK+UiSp8otQdkcLBrYF0Z95Blp1V7x6qE2haLrZi7CHvs6qJUhgp9u/BoZH/Gq8xx0=

Hope that helps! See the links below for more information and a way to test and fine-tune your configuration.

Links:
Domainkeys for Postfix – Started with this guide
DKIM flags – understand what the flags are that we used above.
DKIM generator – Generates your private/public key and gives you the DNS info necessary to make DKIM work! You can skip Step #1 with this.
DKIM Tools – Verify your DNS DKIM records.
Author Domain Signing Practices (ADSP) – Understand what the _adsp record is for.

Native Compile for PL/SQL on Windows Oracle 10g R2 x64

Posted in Oracle by Personalife on the August 14th, 2009

I couldn’t find any definitive guides on how to compile PL/SQL natively on Windows, so after reading lots of documentation, I finally managed to figure it out. You will need the following:

- Visual Studio .NET 2003. .NET 2005 does not work (at least from what I’ve read), and if you use the x64 version of Oracle, MinGW will not work either. It’s gotta be Visual Studio .NET 2003 with the C++ component installed (ALL components, including the unchecked win platform one)
- Microsoft SDK for Windows. Our boxes are Windows Server 2003 R2, so I downloaded the corresponding SDK for it.

- Important: Make sure when you install the Microsoft SDK, you install it into a directory called ‘C:\Program Files\Microsoft Platform SDK’. The default will be something like ‘C:\Program Files\Microsoft Platform SDK for Windows Sever 2003 R2′; you do not want this! Oracle will look specifically for the directory named ‘C:\Program Files\Microsoft Platform SDK’.

- Important: Make sure you have enough RAM to increase your SGA and PGA memory size. I’ve had cases where I’ve used native compilation only to find that the native version runs slower than the interpreted complation! Or worse, your programs will just crash.

Install both, and open up a sqlplus session (probably under the ’system’ user), and run the following:


   alter system set plsql_native_library_dir='C:\oracle\db10g\native' scope=both;
   alter system set plsql_native_library_subdir_count=5 scope=both;
   alter system set plsql_code_type='NATIVE';

- plsql_native_library_dir should be pointing to a directory you specify. I created a ‘native’ directory in my Oracle installation and pointed it there. All the compiled PL/SQL will go into that directory.
- plsql_native_library_subdir_count determines how many directories to use when generating the compiled objects. The reason why this exists is if you have a large amount of procedures / packages to be compiled (large as in > 10,000), there will be I/O issues if you store all the compiled items in one directory. If you specify the count to be more than one, then each compiled item will be put in a subdirectory, round-robin style.
- Since plsql_native_library_subdir_count=5 in the example above, you need to manually create 5 directories in the ‘native’ directory created, called dn (where n is a number starting with 0 to subdir_count) ie:

C:\Oracle\db10g\native\d0
C:\Oracle\db10g\native\d1

C:\Oracle\db10g\native\d4

At this point, try compiling your PL/SQL packages or procedures. You can check your subdirectories to see that things are being compiled.

Congrats! You should now have a (slightly) speedier Oracle system. Unfortunately, there are no speed improvements using native compilation for SQL statements. Instead, you need to do your standard optimization techniques for your schemas, such as creating proper indexes, partitions, etc. If you use heavy algorithms PL/SQL, native compilation will benefit this most.

And, if in the event you want to switch out of native compilation, use the following:

ALTER SYSTEM SET plsql_compiler_flags = 'INTERPRETED';
ALTER SYSTEM set plsql_code_type='INTERPRETED';

For more information, see the Oracle PL/SQL NComp document.

So I got LASIK Surgery

Posted in LASIK, Stories by Personalife on the August 14th, 2009

After evaluating the real estate listings my agent has been sending me for the past few months, I’ve decided that I did not want to live in the back parts of San Jose since it was the only thing I can afford with only $50k saved up. Instead, I’ve decided to move my housing goals to next year so I can save even more money for a larger down payment.

With that said, I also decided to shift my goals a bit. Since I was moving housing to next year, I took one of my next year’s goals to this year: get LASIK surgery on my eyes so I don’t have to wear glasses anymore.

I started to do my research on LASIK two months ago, understanding all the risks and complications, and stories that were positive and negative about it; in the end, I decided it was something I wanted to do.

How I chose my doctor was actually through a radio commercial. Energy 92.7 has commercials about a LASIK doctor named Dr. Hyver, who did LASIK surgeries for the San Francisco 49ers (a NFL football team). I figured that he must be extremely experienced to have radio commercials, and looking at the reviews on Yelp also helped the case.

I scheduled my appointment at his Daly City office during the last week of July; the evaluation session lasted two hours where my eyes were put through a battery of tests (including a general eye exam) to see if I was qualified for LASIK – which to my excitement that I was. The staff were nice people, and Dr. Hyver handled some of the questions I had that I couldn’t find answers for during my research.

Next came the pricing. My eyesight was around -4.75 to -5.00, and I think the worser your eyes, the higher the price. I was surprised to find my vision health insurance covered LASIK, so $1.3k was dropped from the price, and it came out to exactly $5k for the procedure to be performed on both my eyes. My operation date was Aug 13, or yesterday. Eyedrop antibiotics was prescribed to me, where I would put them in my eyes 24 hours prior to the surgery.

The operation went completely smoothly; the operation area looked like something out of a sci-fi movie, where aliens abduct you and you’re put under all these bright lights (and a few lasers pointing at you). The entire procedure was completely painless, aside from 20 seconds of discomfort from the pressure where an ocular microscope was pressed against my eyes for analysis. Anesthesia was applied to my eyes prior to beginning the operation, so there was completely no pain at all. You do not actually see the lasers beam down to your eye, but you know they’ve touched your eye from a slight burning smell. My favorite part of the surgery was seeing what I called, seeing the light, where right before the laser starts to strike, you see only darkness with this brilliant mix of red and oranges:

thelight

(The image shows only reds, but mix that with some orange, and you’re golden.)

I also liked how Dr. Hyver would tell me what he was doing to me before doing it to my eyes, so I knew exactly what was going on during the procedure – no surprises.

After the surgery, my eyes really wanted to stay close, and it was recommended that I keep my eyes closed for four hours. I was able to see, but not completely clearly right after; there was also slight burning and sinus pressure around my eyes. However, after just going to sleep, I’ve woken to see that my sight has completely cleared up, as in I CAN SEE! My night vision seems fine at the moment, and I’m not experiencing some dry eyes, but no irritation for now, or any pain. There are some halos for certain LEDs in my room, however, but I’m told that it should clear up as my eyes begin to heal.

I think that my sight is a little worse than 20/20 at the moment, but I definitely can see everything, and I know that my vision will gradually hit 20/20 or better during months of healing. They estimate that my vision will hit 15/15 or 15/20.

Overall, I’m hugely satisfied with the results so far, but I’ll need more time before I’m completely satisfied to see how my vision changes with the months.

I’ll be able to go into work today without any trouble, and first on my agenda? Lock away my glasses, and don some nice sunglasses that my brother got for me for after when I had the surgery.

So, I guess I can say that I’ve accomplished another one of my goals this year :)

Edit: For those curious about the equipment used, you can find more info here. The procedure I had was All laser-LASIK Wavefront, meaning that the entire procedure involves all lasers. Some doctors do not use lasers to cut the flap, but use what’s called a microkeratome.

Powered by WordPress .::. Designed by SiteGround Web Hosting