Friday, September 28, 2012

Lenovo G 580

Recently I purchased a Lenovo G580. It cost me INR 25000 after INR 1000 discount. The configuration is as follows: Pentium B950 @2.1GHz. Its a Sandy Bridge core which translates to cooler temps. We have 2GB RAM here. Added to it is a 500GB Seagate HDD, A DVD Burner, 3 USB ports out of which one is USB3.0. We have Gigabit Ethernet, WiFi, 1.3M webcam, Synaptics touchpad which is embedded in the body. We have both VGA Out as well as HDMI Out and I think that's a neat feature since finding HDMI projector around is still kind of difficult. Sure you can use an adapter but that's another piece of hardware you need with yourself.

The chassis is solid, the display has barely any flex. The hinges are not as stiff as I would like - my emachines e727 has really stiff hinges, you feel like trying to pry a ball from a German Mastiff's mouth, but maybe that's why it's still alive and kicking some major dust. On sound front it has stereo speakers which sound a bit better than average laptop speakers, they are located on the front downside. The 3 status LED's Power, Charging and Caps Lock are on front face right below the touchpad. The touchpad is aligned to center of keyboard and is comfortable to use. The keyboard is excellent. It doesnt have asmuch travel as my emachines but still it's nice and the keys are lot sturdier. They feel much better to fingers and felt comfortable to type on this. The keys are island type and Lenovo calls it AccuType keyboard. I don't know how much accutype this is, since I'm not a touch type guy. But it sure feels like a quality keyboard. The touchpad has separate left and right click keys and they are a bit hard clicking. On the other hand the keyboard has full numpad and full size arrow keys which I really love.

It has a Power button on upper left corner and a small Lenovo One Touch recovery button right next to it. The webcam is centered on top bezel edge of display and it has a white LED that glows when it's on. The 15.6" LCD is just average. It has decent brightness but the viewing angles - especially vertical - suck really bad. They almost match that of my emachines. The notebook is available in Navy Blue, Dark Brown and Dark Gray color. I went with Navy Blue since I wanted it to look catchy.

Performance wise the sandy bridge Pentium B950 is more than enough for almost every everyday task. Also since the target audience - My Sister - is not going to use it for any intensive task I'm not worried about performance. I have partitioned the HDD into 4 partitions.I used two of them for Linux - one swap and one root partition, the remaining two went to windows 7 and Data. I encountered one small problem with this and that was Windows 7 was unable to create any extended partitions on this and it was unable to read the extended partitions by Linux. I didn't think of this before but it came with DOS by default and I didn't wipe out the existing partition table. I did delete the partitions but I should have wiped out the partition table too.

Anyway I have the system working fine right now so I'm not going to worry about anything. Overall it's a really nice machine with great VFM and good hardware quality.

Wednesday, September 5, 2012

A tryst with mail in PHP and the newbie

The problem with newbies is that they haven't the experience. Okay, sounds a but lame but the thing is they haven't seen as much crap as an experienced guy and for my 2 and half years I've seen some interesting crap.

Anyway, to the story the task was to send a mail from PHP. The guy was a newbie. The problem was the guy wasn't familiar with PHP. He didn't track the changes and effects that change brought. There is a way to solve any problem. If you know the root cause of any problem you hit that and then you solve it. But when you don't know the exact cause you got to research on the internet. And usually you end up with a number of things that comprise of a potential solution. And in these situations you have to keep track of every change you are doing to the system. Because unless you track everything and didn't check if every small change then you end up missing the solution.
I'm watching a lot of Dr House these days so I'll compare it to a diagnosis. You can't just use broad spectrum antibiotics for everything because they work on only a handful of cases.
So back to the problem, I let him wrestle with the problem for a week and by that time he ended up with a mess that would scare anybody.
First you find the cracks in the reality - I.e. The girl in red dress. Here it means you need to discover potential areas causing problems. They can be configs, switches to various programs involved, environment variables... In short anything. But you have to try and discover as much as possible. And once you have done that you have to make sure that they all are healthy. The configs are right and the logic super sane. You are doing what's possible to do and not trying to fly superman.
The guy had messed up so bad. He had modified php's mail settings. And sendmail settings. And apache settings. And god knows what else.
I was thinking all possible areas where the problem might be. So this evening I went by his cubicle and told him that we are either going to solve it now or we are going to leave it alone till deployment.
First thing I checked was php's ini file. The SMTP mail server settings are present there but they are needed on windows only. So I disabled them. I also disabled the SMTP port. Then I checked if send.ail was available for PHP. Since it was I left that setting alone otherwise we can specify sendmail binary path.
So here I ensured that PHP's side was okay. Next I checked sendmail settings. I used google with a targeted query to find resources which would explain send mail options and configurations. There I discovered the second problem we had. The send.ail settings sere a total mess. So I cleaned them up. This involved setting proper user name, proper hostname and disabling tls since the mail server connection is unencrypted. I can understand tls thing, but newbie guy messed up hostname and username. That's real shame.
Then I went through the mail sender PHP page's code. There also I found couple of problems, one was the variable names were all messed up. I cleared it up and one the web pages said about setting up an init parameter.
After doing this all I used php to send a mail and voila! The mail was sent.
Lesson: Being ignorant or inexperienced is not something you should be ashamed of but being stupid... God save you!

Sent from my Windows Phone