Stuff…

I know I will forget.

Stuff… header image 1

QR barcodes and Perl

February 25th, 2011 · No Comments

Creating QR Code with perl module Imager::QRCode

The following code generates this image:

Code:

#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
use Imager::QRCode;

my $MECARD=<<END;
MECARD:
N:co.uk,moe;
ADR:Address Field;
NOTE:Testing;
TEL:+440123456789;
EMAIL:spam\@moe.co.uk;
URL:http://www.moe.co.uk;;
END

$MECARD =~ s/\n//;

my %opts = (
o => ‘default.png’,         # Output filename
# e => ‘M’,                   # Error correction level
e => ‘H’,                   # Error correction level
s => ’5′,                   # Pixel size
);

getopt(‘o:e:s:’, \%opts);

my $qr = Imager::QRCode->new(
size =>  $opts{s},
level => $opts{e},
);

$qr->plot(“$MECARD”)->write( file => $opts{o} );

Another nice module is to make text versions of QR codes: Text::QRCode

Code:

#!/usr/bin/perl
use Text::QRCode;

my $arrayref = Text::QRCode->new()->plot(“http://www.moe.co.uk”);
print join “\n”, map { join ”, @$_ } @$arrayref;

print “\n”;

→ No CommentsTags: Coding · Linux · Protocols

HTTP accelerators/proxies

February 24th, 2011 · No Comments

There are a number of different light weight webservers that can proxy/accelerate performance of traditional webservers such as apache/iis.

Some of these are:

Have seen good performance increase with nginx infront of Apache for Magento eCommerce installations.

→ No CommentsTags: Linux · Networking · Operating System · Protocols

Google.com redirecting to google.de

February 19th, 2011 · No Comments

For some reason Firefox search bar was redirecting me to google.de search results.  Initially thinking it was something to do with firefox I tried changing the google.xml file in the searchplugins directory, however, that didn’t help.

Then, in firefox going to www.google.com the browser was redirected to www.google.de.  So, wasn’t the search box.

Had to goto URL: www.google.com/ncr

This then stopped google redirecting my browser to google.de.

→ No CommentsTags: Other

Plesk 9.5 doesn’t install on CentOS 5.5 if updated

February 18th, 2011 · No Comments

OS: CentOS 5.5
CP: Plesk 9.5.4
URL: http://download1.parallels.com/Plesk/PPP9/CentOS5/parallels_installer_v3.6.0_build100407.15_os_CentOS_5_i386

When installing CentOS 5.5 it has become a habit to immediately run “yum upgrade” to make sure all the patches/bug fixes are installed prior to doing anything else.

This, however, breaks the Plesk installation and has done for many years.

Ran the Plesk installer and selected Plesk 9.5.4 full install and received the following error:

2. (*) Full
Install all components.

Select an action [N]: n
Retrieving information about the installed packages…
File downloading PSA_9.5.4/dist-rpm-CentOS-5-i386/build-9.5.4-cos5-i386.hdr.gz: 10%..20%..30%..40%..50%..60%..70%..80%..90%..100% was finished.
File downloading PSA_9.5.4/update-rpm-CentOS-5-i386/update-9.5.4-cos5-i386.hdr.gz: 10%..20%..30%..40%..50%..60%..70%..80%..90%..100% was finished.
File downloading PSA_9.5.4/thirdparty-rpm-CentOS-5-i386/thirdparty-9.5.4-cos5-i386.hdr.gz: 11%..20%..32%..41%..52%..61%..70%..82%..91%..100% was finished.
Determining the packages that need to be installed.
ERROR: Unable to install the “psa-9.5.4-cos5.build95101209.05.i586″ package.
Not all packages were installed.
Please, contact product technical support.

Inspecting the /tmp/autoinstaller3.log log file we notice that:

The requested package “psa” could not be installed.
Searching problems for the “psa” package.
No suitable solutions were found for the “bind >= 9.2.1″ dependency.
The “bind-30:9.3.6-4.P1.el5_4.2.i386″ package resolves “bind >= 9.2.1″.
Could not add package bind-libs-30:9.3.6-4.P1.el5_5.3.i386to the list of required packages.Problem occured during searching directly resolved dependencies for ‘libbind9.so.0′ of package bind-30:9.3.6-4.P1.el5_4.2.i386 — Check for new version of PSA_9.5.4/plesk-9.5.4-cos5-i386.inf3

Then checking RPM database:

[root@host files]# rpm -qa | grep bind
ypbind-1.19-12.el5
bind-libs-9.3.6-4.P1.el5_5.3
bind-utils-9.3.6-4.P1.el5_5.3

So, it looks like Plesk doesn’t like the updated bind packages.  Remove them with:

[root@host files]# rpm -e bind-libs-9.3.6-4.P1.el5_5.3 bind-utils-9.3.6-4.P1.el5_5.3

Then Plesk will install.

Wrote about this previously:

→ No CommentsTags: Control Panels · Operating System

Plesk 9.5 Plesk bug The domain is still suspended for the following reason: Domain is expired.

February 17th, 2011 · No Comments

OS: CentOS 5.x
Plesk: 9.5.2

A domain went offline/suspended and when trying to unsuspend via the Plesk control panel the following error came up:

The domain is still suspended for the following reason: Domain is expired.

It turns out that the validity option in Plesk for the domain had been set to yesterdays date and the site went offline.

Steps to fix:

  • Login to Plesk CP
  • Navigate to Plesk Domain
  • Select “Resource Usage” and scroll to bottom of page
  • Check “Validity period:
  • Either change the date to future or set to “Never expires”

→ No CommentsTags: Control Panels · Linux · Operating System