Latest Entries »

If you learn one piece of ruby today make sure it is multithreading. This basic command speeded up my script six fold. Amazing.

Basics:
while 1 >= 0
Thread.new {
puts ‘hello world’
}
end

That is pretty self explanatory I hope

I moved an application I have been working on for a while from my local linux box to my VPS and ran into a few problems. The app runs on php and ruby for some backend stuff.

The first problem I encountered was that htmldoc wasn’t loaded. A simple apt-get install htmldoc sorted this. Then I found out ruby’s mysql gem wasn’t there.

gem list

returned not a lot

gem install mysql

crashed like a …

Anyway after much faffing with gems I ran a

apt-get install libmysql-ruby

which does the same thing apparently.

Ok all up and running apart from I had to chmod 777 *.rb which was a pain and needs automating in future.  And a few dirs needed chmoding as well.

Next problem I ran into was a ruby thing. In my local dev situation I use array.count a lot in scenarios like:

good = ['great', 'fab']

goodword = good[rand(good.count)]

Only thing was .count is not supported by my production environment so grep out a whole lot of .counts and replace them with .lengths

Finaly everything was up and running and I have a powerful new bit of web development kit under my belt. Cashing in for Xmas.

Since managing to apt-get wipe my last VPS we now have the blog reinstalled and up and running but do photos work…?

Yep but to start with I got this error message:

Unable to create directory /var/www/vhosts/*/httpdocs/blog/wp-content/uploads/ Is its parent directory writable by the server?

How to fix

Log in to your favourite ftp browser.

Go into httpdocs or whatever your root folder is

find the wp-content folder

make another folder insider wp-content called uploads

chmod the wp-content folder to 777

Retry uploading the photo and it should work.

Done!

PHPBB forum has been added to the site. There’s an ‘interesting’ feature in which every time you update a page you have to log into the admin panel and purge the cache before any changes will be shown on the site.

The main file to edit is in /forum/styles/whichever/tempate/overall_header

This lets you make the basic changes to the top part of the site. I took out the php generated logo and stuck my own in because it wouldn’t resize correctly.  So changing site_logo.gif wouldn’t work by itself.

Once the overall_header.html file has had the necessary adjustments. Log into your admin control panel /forum/adm and click purge cache under Resynchronise or reset statistics.

Check the site and it should show the modified content.

For those of us who don’t have the luxury of an A1 printer we offer the following solution to scaling from A4.

Make sure the CAD drawing is printed on A4

Make sure the scale is 1:100 @ A1

Take a measurement and multiply it by 283.5

This will give you the actual scale. Or as I prefer to do take a measurement in cm and multiply by 2.835 to get the actual size in meters.

This is an easy way to work with CAD drawings when quoting and tendering etc.

Don’t get me wrong I wouldn’t build a house with this but as a rough guide to do an estimate or calculate costs for budget purposes this formula works well.

Recently upgraded to Ubutu 10.04 and the keyboard wouldn’t work when trying to login.

The quick fix is to click on the little man in the circle down the bottom of the screen and select virtual on screen keyboard. Nothing happens. Reboot do the same nothing happens. Reboot and a virtual keyboard appears meaning you can login. Love linux :)

Once logged in edit /etc/default/console-setup and change the following. Note you will need to be root.
XKBMODEL=”SKIP”
XKBLAYOUT=”us”
XKBVARIANT=”U.S. English”

to this…

XKBMODEL=”pc105″
XKBLAYOUT=”us”
XKBVARIANT=””

Reboot and it will work. Happy days.

I’ve noticed that new VPS accounts from web fusion come with an application vault which allows you to install common web apps such as wordpress and phpbb3 at the click of a button. It is part of the parallels plesk package.

My question was how to update an old plesk account?

When I tried to install new applications I get the following error:

Operation remove with the Env(s) “lvps212-67-218-230.vps.webfusion.co.uk” is finished with errors: Can not remove packages: exec failed: E: dpkg was interrupted, you must manually run ‘dpkg –configure -a’ to correct the problem. Error: /usr/bin/apt-get failed, exitcode=100 .

So login to your SSH connection and from the /root directory run the command

dpkg –configure -a

Then go back into the plesk updater and it’ll work.

Update anything required in Plesk 8.6.0 which should be the bottom update.

Then once thats done you need to reboot the server.

If you don’t reboot you’ll get the following message:

ERROR: Failed to check whether a new license key is available.

Once rebooted install the update to 9.0.0

You’ll then get this error message:

Error: The license key is invalid. In order to use the Parallels Plesk Panel, please obtain and install a new functioning license key.
The amount of currently used resources overrides the limits defined by your license.
The number of web sites hosted on the server exceeds the limits defined by your license. You have 5 sites hosted; your license allows hosting only 1 sites.
The number of served e-mail accounts exceeds the limits defined by your license. You have 2 e-mail accounts currently served; your license allows serving only 1 e-mail accounts.

Visit https://register.parallels.com/key_upgrade/ to get a new key or ring Webfusion.

Done.

Painful and hard work but we got there in the end.

Blog by SanNeo