On PHP with Postgres/MySQL and hosting

About a month ago I was trying to help a friend out by uploading one of our earlier made PHP/Postgres project to my server so she’d be able to get screenshots she needed. Seemed like a simple task given that my hosting provider supports Postgres, NOT!
It soon became obvious that something is entirely wrong with the combination of cPanel and Postgres working together. Firstly I couldn’t access phpPgAdmin at all. With MySQL you simply click phpMyAdmin link in cPanel and you’re taken to your databases. With Postgres I was shown login screen and neither my hosting account nor database user credentials worked.
At some point later I was creating a database in cPanel and it wouldn’t show up in cPanel after you navigated from successful creation message to database management area.
At all times I couldn’t access database tables with user having all database privileges. In the end any new database created in cPanel had tables in it. And data in tables as well. Just like the data I was managed to get inearlier, but before executing any data definition and insertion statements after creating new database!
I first created a ticket about the issue on December 11th. Last reply I got is from January 7th. I’m nearly 100% sure I replied to it, but it doesn’t show up in clients system and I haven’t received a reply. The issue itself is closed probably due to me not replying.
At this point I don’t really care whether I really failed replying in terms of writing reply and then not sending it or anything similar or they hushed it up. They still couldn’t solve my issue in nearly a month. It was a fairly simple issue in the end, I simply wanted to use Postgres the same way you use MySQL. They failed to set it up properly and even after having my login credentials asked ME to verify if things were working when they were not.
I haven’t had any other issues with them so I’ll probably stay with them until I need Postgres again.
At least something good have come out of it. I learned that MySQL has VIEWS and nearly everything else our project used. I’ve been under the impression that MySQL is less capable than it turned out to be. After converting sequences to auto_increments and removing some Postgres-specific? ::casts it could execute most of the queries without any problem. I’m too lazy to try fixing some of the more complicated views and checking out how many of application queries actually work without changes, but I probably won’t be needing Postgres any time soon knowing what MySQL is capable of.
And what about the screenshots, you ask? Set up Postgres locally and made some screencasts with Wink.

Running Intrepid on Thinkpad X60s a bit cooler

One of the areas where out of the box Windows Vista beats out of the box Ubuntu is handling temperature. As X60s has rather slim chassis then temperatures inside and on surfaces are quite similar. And this is not so convenient if you’re right-handed trackpad user as this is the exact warmest spot on top.

I’ve been using the following bash script recently to get temperatures down a bit:

echo 5 | sudo tee /sys/bus/pci/drivers/iwl3945/*/power_level
echo "auto" | sudo tee /sys/devices/pci0000:00/0000:00:1d.3/usb4/4-2/power/level
sudo iwconfig wlan0 power on
sudo iwconfig wlan0 txpower 12

First line seems to make the most difference.

When using the laptop after running the script I find that with light wireless activity Gkrellm reports following temperatures:

BAT1: 34 BAT2: 32 CPU: 50 GPU: 48 PCI: 46 THM0: 50 THM1:52

And after reverting changes it seems to stabilize with:

BAT1: 35 BAT2: 34 CPU: 50 GPU: 48 PCI: 51 THM0: 51 THM1:52

Unfortunately I’m afraid it has a price because occasionally my wireless connection seems to drop for no apparent reason and the only way to get it working again is to reboot. Not nice but could be due to something else.

For some further power usage cutdown – and mostly if it makes it cooler it also reduces power consumption – you could apply powertop suggestions:

echo 1500 | sudo tee /proc/sys/vm/dirty_writeback_centisecs
echo min_power | sudo tee /sys/class/scsi_host/host0/link_power_management_policy
echo 5 | sudo tee /proc/sys/vm/laptop_mode

Also without changes powertop reports 17.2W and after 13.7W, those are not absolute values as there was almost no wireless or CPU activity but they do highlight relative difference.

Last but not least, if you don’t use bluetooth you can switch it off using Fn+F5, but you knew that already, didn’t you?