Archive for the 'IT' Category

Twitter Tools: Call to undefined function curl_init()

Changes to the requirements for apps connecting to Twitter have resulted in the update of the Twitter Tools plugin used in this and many other blogs to provide a twitter feed in the sidebar.  There is now a requirement for a a sequence of keys to authorize access to your twitter account.

Unfortunately, when I updated and configure the new version of Twitter Tools, it would not connect to Twitter, instead giving a

Call to undefined function curl_init()……….

error.  This is because php was not configured with curl support.  To fix this on a Debian-based system, do the following:

sudo apt-get install php5-curl

then add the following line to your /etc/php5/apache2/php.ini file:

extension=curl.so

finally, restart Apache:

/etc/init.d/apache2 restart

Twitter Tools (and any other php Twitter app) should connect to your Twitter account correctly.

MySQL Corrupt But Won’t Repair

I had a problem this week installing a second copy of WordPress on my server from which to run a personal blog.  The installation kept failing to access the database, pointing to a permissions problem.  Running a GRANT statement to give the correct privileges to the new database gave no error but on checking the mysql.users table I discovered that no changes were actually being written to the permissions!

check table user

returned an error:

Table ‘.mysql.user’ is marked as crashed and should be repaired.

repair table user

returned

Table is already up to date

and the circle continued……..

So I had a corrupt user table which wouldn’t let me repair it.  However, there is another repair utility which is used on upgraded tables from MySQL 4.x which will repair tables in these circumstances.  To use it, just navigate to your MySQL data directory and run:

myisamchk -r *.MYI

This will check and repair all tables in the directory.  Of course you can repair just a single table by replacing * with the table name.

Am I no Longer a Geek?

I have just specced a new desktop for my desk at work and, for the first time in 20 years, I will be using a computer at home or work which I haven’t built with my own hands.  I bought an off-the-shelf Acer Veriton and all I need to do is put a dual-head graphics card into it and it’s ready to go.

Does this mean I’ve lost my geek credentials?  I certainly don’t have the old passion for tinkering I used to have and I bought this PC because I simply couldn’t be bothered to research the component specifications to assemble a new one by hand.  The processor market for one is an utter mess where model numbers mean nothing.  At least under the old CPU MHz ratings you had some, admittedly inaccurate, sense of where the CPU sat in the speed stakes.  Maybe the technology is passing me by and I can’t be bothered to keep up with hardware I don’t need to use.  I’ve gone from geek to informed consumer.  As a geek I would have spent hours and £800 putting together a finely tuned PC to match all my needs whereas as an informed consumer, I spent 10 minutes and £450 to get a machine that gets 98% of the way there and the other 2% I don’t really need anyway.

People I know will still call me a geek and it is still a badge worn with at least a little pride, although it seems to get more tarnished as the years pass. :)

SQL Server 2005: Missing Login Names After Restore

As mentioned in earlier posts, as time permits I’m migrating an old SQL Server 7 installation over to a new SQL Server 2005 installation.  One of the things I came across was that even though I had Users, Roles and Permissions set up an looking OK, I was unable to run even a simple SELECT query against the database without an error stating that the user didn’t have permission.  After checking all of the users/roles/permissions for the database and its tables and finding nothing wrong, I noticed that the properties for the user did not show a login name and any attempt to change the properties would demand a valid login name even though the field was greyed out and not editable!

The problem appears to be that when restoring an older database into SQL Server 2005, the login name can be assigned a blank entry.  The easy fix if your user names map to logins of the same name, i.e. login user1 maps to user user1, is to run the following query for each database user:

USE [database_name];
GO
EXEC sp_change_users_login ‘Auto_Fix’, ‘Username’;
GO

You should get the following response:

The row for user ‘Username’ will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.

More info can be found here.

VirtualBox – Guest Additions

I wanted to take a quick look at Ubuntu 10.04 so I downloaded the latest VirtualBox VM software and grabbed the Ubuntu ISO so that I could just run a test on my local PC inside a virtual machine so I could play with it while doing other things.  I haven’t used VirtualBox for a while and while the guest OS install went fine, I couldn’t get the screen resolution to increase so my Ubuntu desktop was fixed at 640 x 480, even in full screen mode.  It turns out the additional functionality is available through installing Guest Additions.  I’m not going to go into the details of how to do it because there’s several straight-forward How-To’s on the web, for example here.

Google Maps Inaccuracy

I produced a basic website for a group company and included a Google Map on the contact page.  It was reported to me this morning that the map points to the wrong area.  I obviously thought I’d made a mistake so went to correct it.  However, the fault seems to lie with Google Maps embedding of it’s own maps.  In this case I wanted a map for post code OL10 4HP in Lancashire and on Google Maps website it gives me the correct location.  However if I then click ‘Link’ then ‘Customize and preview embedded map’ it changes it’s location to over a mile away.  Now I’m sure it’s possible to somehow manually edit the embedded code to give me the original and correct map, but it’s a strange error on Google’s part.

Anyone else had this problem?

SQL Server 2005 Remote Connections

Yes, I know I’m way behind the curve here but I don’t normally used SQL Server as wherever possible I use MySQL instead.  However, we have one application which uses an old SQL Server 7.0 installation which is installed on a slowly failing server.  Since this application has become low traffic, I’m being tight and setting up a new server on a basic HP ML115 with SQL Server 2005 Express as it suits these specific demands easily and cheaply.

Anyway, I was having trouble connecting to the SQL Server 2005 service from a client machine and couldn’t see a reason.  No log files were being created on the server so I did a bit of research.  I came across Rick Strahl’s blog entry from 2006 (I did say I was working well behind the curve!) which explains that by default, SQL Server 2005 does not allow remote connections, which is fine if the setting is easy to find.  Unfortunately it’s in a completely different application called the SQL Server Surface Area Configuration Tool (what a great name, very intuitive). Activate remote connections and away you go.

In my case, no actually.  I still couldn’t connect remotely and, as it turned out, I couldn’t connect through ODBC on the server either.  Finally, I discovered the solution which was to set the connection to server_name\sql_instance_name not just the server_name.  For example, whereas on SQL Server 7 you can just connect to SERVER1, using SQL Server 2005 Express you need to connect to SERVER1\SQLEXPRESS because SQLEXPRESS is the default instance created during installation.  A simple difference but confusing at first!

IT is dead.

OK, that’s an OTT headline and it comes a day after me spending a stupid amount of time getting a friends iPod Touch to accept some video files which it wouldn’t because the piece of crap can only play a miniscule amount of file formats which most computers take in their stride, and not helped by iTunes trashing my secondary Atom-based PC in the living room which happily manages to do everything else I need but now, thanks to iTunes won’t even open Windows Explorer to browse files!

However, on top of my growing feeling that nothing really works the way it’s supposed to, from Phones to iPods to software to Sky+, the latest edition of PC Pro landed on my desk this morning, which I’ve subscribed to for years and for the first time I skimmed through it in two minutes and it went in the bin.  There’s just nothing really new any more, new laptops and desktops and monitors and digital cameras are ten a penny and Office 2010 looks again like Office 2007 with a couple of bells and whistles bolted on.  I’m supposed to get excited about this stuff?

It seems these days that the media only get excited about new Apple products which are produced for and bought by those for who eye candy is the most important thing.  These people would rather have a 5 carat cubic Zirconia than a 1/2 carat diamond.  Just give me stuff that works please and works the way I want it to instead of making me a slave to the manufacturer, and don’t tell me you’ll fix it in in the next model because you told me that three models ago and it still doesn’t work!

That’s my Monday morning moan finished with, better get some work done I suppose!

Fix Something, Break Something Else.

Why is it that whenever we try to fix something, we always break at least one other? I setup a DMZ on my Netgear FVX538 Firewall at home to put my PS3 into so that I could reduce lag as much as possible by opening the NAT to it.  No problem, configured the PS3, configured the DMZ, activated it, checked that web and email incoming were still working. Great.

Errrr, yeah, except that I get to work this morning and the VPN from my desk via the work FVX538 to home isn’t working.  I suspect that the VPN requires some WAN-LAN rules setting up so that it knows that the VPN needs routing to the LAN, instead of the DMZ becoming the default.  I think I need to open UDP port 500 for the Internet Key Exchange (IKE) traffic and UDP port 1701 for L2TP traffic (not sure if I need that one).  Question is, what address do I forward them to?  The router itself?

Of course, I could configure this and test it from work, except that my VPN is working and remote access to the router isn’t working either, so it’ll have to wait until tonight.

All this just so I don’t suck quite as much at COD: MW2!

Update 29/04/10 09:52

Not so easy, it seems.  Setting up forwarding for the VPN ports gave me a connection which showed as connected at both ends but unable to route any traffic through at all.  Traceroute from either end only got as far the local firewall.  I have the inbound VPN ports forwarded to the firewall LAN address, maybe it has to be forwarded to somewhere else?  For now, I’ll have to undo the DMZ configuration to get my VPN working again for now and play with it some more when I have more time.

AMindLost on Twitter

I’ve always taken issue with “social networking” sites such as Twitter and Facebook.  Twitter seems to be full of useless posts about people taking their dogs for a walk or telling us what they had for dinner and Facebook is for people desperate to be in a group of any kind and is mostly used for self-promotion and ego-stroking.

Whilst I maintain my stance that I will never have a facebook account, I have decided to dabble with Twitter a little to see if I can make any use out of it at all. You can see my latest tweets at the bottom of the right-hand sidebar or on twitter under the name AMindLost.  It may be a short-lived experiment and be either deleted or left to slowly rot into oblivion but I’ll try to post some meaningful content to it which is not substantial enough to warrant a full blog post.

We will see…… :)