Handy Linux Commands

Some handy linux commands I use from time to time.

I’m posting this mostly for my own reference, but they might be of use to others.

Clearing a file
A quick and easy way to empty a large file, such as say, a log file, is the following:
cat > filename
-> then hit ctrl + d

Finding a recently modified file
The below command will find any files modified or created within the past three days.

find . -mtime -3

Number of files in a directory
You would be amazed how many times I wonder exactly how many files there are in a directory (and subdirectories) of say uploaded images (it was 5,843).

ls -1R | wc -l

Directory Size
Sometimes you need to know the size of the current folder’s sub directories.

du -h --max-depth=1

Comments (1)

Why Captcha is bad

People seem obsessed with captcha these days.

Small web sites that I know couldn’t possibly get more than a few enquiry form submissions a week come looking for it.

I, with 13 years experience of the Internet and decent eyesight have to repeatedly re-attempt registration on websites where I want to do scary things like buy products.

Try signing up for a windows live account. Only a blind person can do it at the first attempt. Not because they can hear the audio (their hearing is many factors better than the sighted, but not that good), no, they can deal with captcha easily because any Internet literate person with sight difficulties are aware of all the tools and plugins that can defeat captcha easily.

In no particular order, these are the reasons I really, really do not want to put captcha on your website:

  • You don’t need it. Have you had more than 1 spam submission in the last 2 weeks? Oh I see, all the OTHER sites have it. Like what, Google? Microsoft? Ebay? I admire your self confidence, but I’m not sure your site or service is quite there yet.
  • How dare you put the onus on the person you want most to interact with you: a potential customer, collaborator or Internet stalker, and make them jump through an extra hoop simply to register or contact you. Do shops take fingerprints at their doors lest a shoplifter gain entry?
  • It is lazy to use captcha. If you really have a problem with spammy signups, contact form submissions etc, a bit of imagination on the part of you and your developer can solve this problem without sticking it to the visitor. Email verification. Spam Filtering. Bad Behaviour. Akismet. It is your problem, so put a bit of effort in.

Comments

Why I don’t use Media Temple anymore

Over the past year my impression of Media Temple has gone from a pedastal atop other hosting companies to a half-reliable also-ran whose tech support I dread to contact because I know if my question is in any way complex, and mine invariably are, I just get copy and paste answers asking for more info. Like the intermittent fault where uploads were not saved or the site whose files go missing for 5 minute spells and then reappear again, while working fine on other hosting providers.

The final straw showed up in a support ticket today (after several responses in the same support ticket) while working on a project with a company whose sites are still with Media Temple:

support_ticket

By the way, the clause they refer to isn’t on the page they refer to – you have to click on a link to a sub page and read through about 5 paragraphs before you actually find the clause I think they are referring to.

So the work I was meant to complete today is held up until the director gets back from her weekend away to fax a copy of her passport to them.

Thanks Media Temple, you were ok before you got too many customers.

Where have I heard that before?

Comments

Payment Processing in New Zealand

I have recently been looking at the payment processing options for two projects which will be based in New Zealand.

In both cases, the client will be organising a merchant account with a bank, so it is a matter of connecting those up with an online payment processing service. Here are the ones I have been actively considering:

SecurePayTech

SecurePayTech seems a relatively well established service. I created a Silverstripe payment module for it last year without any issues and has a decent API which allows for integration via SOAP or HTTPS post. SecurePayTech is also a wholly owned subsidiary of Digiweb. I guess that means they are a bit more established then…

www.securepaytech.com

Pricing:

Set-up fee: $30.00 + GST

Monthly Fee: Transactions per Month: Per Transaction Cost:
$10 0-20 $0.50
$20 21-50 $0.40
$30 51-100 $0.30
$50 101-250 $0.20
$80 251-500 $0.16
$150 501-1000 $0.15
$300 1001-3000 $0.10

Black Marks:

  • No multi-currency processing (NZD only)

PayStation

PayStation seems like a decent option. Their website has plenty of detailed information on their service and what is needed to get set up etc. Their pricing is quite competitive and is kind to businesses with low transaction volumes but with a very competitive per transaction cost. Good code examples and documentation also.

www.paystation.co.nz

Pricing:

Set-up fee: $200.00 + GST

Monthly Fee: Transactions per Month: Per Transaction Cost:
$15 (minimum) 150+ $0.10

Black Marks:

  • Haven’t had fantastic responses to my queries with them, concerned just how well established they are

Payment Express (DPS)

The DPS service from Payments Express seems to be the most well known Kiwi payments processing solution and is in use on a lot of high profile websites. There is plenty of supporting documentation, test accounts are available etc. As it is the most established, there are also lots of existing payments modules for shopping carts etc.

www.paymentexpress.com

Pricing:

Set-up fee: see table

Price plan
Monthly service fee
Included transactions
Overage fee
Setup fee
Starter
$ 50
100
$ 0.50
$150
Business
$ 150
500
$ 0.45
$150
Business A
$ 250
1,000
$ 0.42
$200
Business B
$ 480
2,000
$ 0.41
$200
Business C
$ 690
3,000
$ 0.40
$200
Business D
$ 880
4,000
$ 0.39
$200
Enterprise
$ 1,000
5,000
$ 0.38
$500
Enterprise A
$ 1,800
10,000
$ 0.35
$500
Enterprise B
$ 2,250
15,000
$ 0.32
$500
Enterprise C
$ 2,500
20,000
$ 0.30
$500
Enterprise D
$ 3,000
25,000
$ 0.28
$500
Transaction
$ 3,500
30,000
$ 0.25
POA
Transaction A
$ 4,000
35,000
$ 0.22
POA
Transaction B
$ 4,500
40,000
$ 0.20
POA
Transaction C
$ 4,750
45,000
$ 0.15
POA
Transaction D
$ 5,000
50,000
$ 0.10
POA

Black Marks:

  • A lot more expensive than the others at lower volumes
  • Higest setup fees

Honourable Mentions

Paymex

Paymex is a slightly different animal in it as a payment processing service and combined Merchant account.

www.paymex.co.nz

Pricing:

Set-up fee: free

Monthly Fee: Transactions per Month: Per Transaction Cost:
$0 0-unlimited 3.25% + $0.55

Black Marks:

  • No multi-currency processing (NZD only)
  • Per transaction and monthly transaction limits
  • Charges appear on customer statements as “Paymex Ltd” – could cause confusion
  • Hosted integration method only

Comments

iPhone Testing on a Windows PC

Recently I have been working on a project, the final output of which, is an iPhone application that displays content in html. 

Of course to do any actual application development, you are going to need a Mac and the iPhone SDK, but in my case I am simply developing a web based system that is creating and editing the content that is then fed into the iPhone application.

My challenge though, was previewing the content before it went to the app – so I could check the layout etc on either my Windows pc or online within the content management system I was building.

My first goal was to find something for my Windows PC – once I had that available to me, and I was happy that it was displaying content roughly the same as on the iPhone application, I could use that as my baseline for testing and build out an online version within the CMS for a live preview function.

Well the options seem pretty few and far between! The two viable options I could find are:

  1. Firefox iPhone Emulator
    This is a Firefox add-on that emulates the iPhone. It looks interesting, however, it requires installation of Netbeans, which is a bit heavy I felt, so I haven’t tried this one. 
     
  2. iBBDemo
    This is a nice little emulator from Shaun Sullivan at Blackbaud. I’m pretty happy with how it functions and it uses Webkit, just like the iPhone application does, to display the html. Be warned though: the instructions state you need to download and install the latest version of Safari – don’t! This does not work with Safari 4.0 – in order to get it to work you will need to download Safari 3.2. I found it here. Aside from that, it looks pretty good! Given that it does not work with Safari 4.0, my concern is that it will become out of date as changes are made to Webkit which are contained is newer versions of Safari.

And now the online versions….

So there are two that I found worthy of praise: 

  1. TestiPhone
     Of all, I found this the best mix of convenience and accuracy, particularly when viewed in Safari. What impressed me most was that when compared to the same content on an iPhone, though the display was larger, the text spacing, layout etc was very accurate: lines ended almost exactly the same.   

    The major disadvantage I found was that the pages I was testing required vertical scrolling: when viewed in Firefox, the scroll bar was show, which reduced the width of the page, this messing up layout. On other browser types, no scrolling was possible, which was even worse. I solved this by rewriting the emulator in my own test page with some Javascript to scroll down the page, thus maintaining correct width, but allowing scroll, just as in the iPhone. Let me know if you would like the code…
     

  2. iPhone Tester
     In many ways, I should applaud this one for being more honest – when not being viewed in Safari, it gives a warning saying it is best viewed in this browser. Practical advice given you are testing an iPhone page – Safari is the best place to do this.   

    In terms of layout and function, it was very close to the TestiPhone site above, but lost points for: showing a scroll bar automatically, thus breaking layouts, and having messed up navigation: every time I entered a url and hit enter, it gave an error and I then had to click on the suggested link….

 

My inline preview utilises TestiPhone code as a baseline and no complaints so far.
So if you don’t have a Mac or an iPhone, iBBdemo or TestiPhone are my recommendations!

Comments

TypePad Connect for WordPress: Not feeling it

ReadWriteWeb report today that Six Apart have announced the release of some Six Apart plugins for Wordpress at Wordcamp Mid-Atlantic. RWW think this is “shocking”. If they think that counts as shocking they need to get out more….

I was intrigued enough to zip on over the their page for Wordpress users, and yes, sure enough, there are some shocking plugins available.

On initial examination, I kind of felt there wasn’t much new to it: wow a comment spam plugin, an advertising plugin… The only one that caught my eye was the TypePad connect plugin, and even that one I kind of knew wasn’t going to be a runner.

Yes it does lots of fantastic stuff, see the above page for a feature list, but it struck me that:

  • users had to go off to TypePad.com to register for your blog
  • comments were no longer stored on your own blog
  • the gains offered for the above are really not worth it

So I gave it the benefit of the doubt and installed the code on a test blog site. Installation itself is pretty easy, so no complaints there.

As expected, the newly activated plugin does make users go off to TypePad.com and create a TypePad account in order to become a member of your site. This doesn’t sit nicely with me: users click a link on your site and all of a sudden they are on TypePad.com being asked for their email address, set a password and their date of birth (TypePad: you don’t need my DOB, you might think you do, but you just don’t).

Ok so if you do all that and post a comment on my site it shows up and there are all the extra goodies they mention on their page.

Some points against:

  • You no longer have comments stored within your own site
  • Comments are harder to manage: two different sites to manage your blog, your blog site and your comment site
  • Not offering much: threaded comments are available in WP 2.7.x, Comment Spam is not an issue with plugins
  • The community thing: wow, you can create profiles. Not a big seller for me.
  • I can’t find any option to export your comments back to WordPress if you choose to leave TypePad connect???

The very fact that comments are no longer stored within my own Wordpress database, not even duplicated there, is a deal breaker for me. Comment counts are often used in my work for listing most popular posts, etc. I see no need to have data stored elsewhere.

In short, there are some nice features here and I think it is great that Six Apart are opening up their work to other platforms, but so far, there is nothing here that makes me want to use one of their plugins.

TIP: If you think TypePad connect might be something you find useful, check out IntenseDebate also.

Comments (3)

Wordpress Plugins I love

I was recently asked if I could recommend some Wordpress plugins for a new site. Well, yes, I guess I have dozens installed across many sites for various reasons, but there are a few I would recommend for all sites. I had a look through some of the Wordpress powered websites I manage to see which ones I rate as worth looking at:

Akismet

If you allow comments on your blog, you should have Akismet. I have it running on a couple of blogs that generate hundreds of comments a month and rarely does any comment spam get through Akismet. On occassion there can be some genuine comments caught in the Pending queue, but this plugin saves me so much time, I cannot recommend it enough.

Subscribe to Comments

For those who are serious about getting some debate going in your blog comments, this is a must have. I only just noticed as I was looking at the plugins for this site that I didn’t have it installed yet! Allowing users to be notified when someone posts a new comment on a particular blog post is just so handy.

All in One SEO Pack

This is another one that I have installed in pretty much all my blog sites. I generally just use it for fixing up page titles, but as this is the first thing seen in search results, this alone makes it worth while.

FeedBurner Feedsmith Plugin

Feedburner is a fantastic service and this plugin makes integrating your Feedburner feed with Wordpress very simple.

Google XML Sitemaps

Really handy plugin that automatically creates and updates a Google sitemaps compliant xml sitemap. Of course the sitemap can be used by other search engines too. Particularly useful with google webmaster tools.

Register Plus

The registration form on a Wordpress site is one area that still lacks any customisation. This plugin goes some of the way, allowing you to add a logo and some css changes to the form. More importantly, it allows you provide additional fields and prevents automated signups with captcha and email confirmation options. I use the email confirmation option on a couple of sites and it works a treat.

Similar Posts

Displays a list of related posts. The thing I like about this one is how configurable the options are. It always seems to display similar posts quite accurately. 

Search Meter

Search meter provides some insight into what visitors are typing into the search box on your blog and whether or not your current content is matching it. The report of searches resulting in 0 results is especially handy.

Sociable

In fact I only have sociable running on one blog. What I have found is that, unless your blog audience is fairly tech-literate, the use of these social bookmarking widgets can be hit and miss. I have had more success by custom coding various links and icons into templates based on the demographics of the site etc. In many of these I have used Addthis and Sharethis to track usage. I recommend Sociable as a good starting point though.

Comments (2)

Cashtrack goes live! My first SilverStripe Site

I’m delighted that I have my first SilverStripe website under my belt that I developed from start to finish. I find it quite frustrating these days that I only get to do bits and pieces of websites, add modules, modify code etc – seems I only ever get asked to the hard bits! The same holds true for SilverStripe: I have been working with it for several months now, developed modules, modified sites and other odd jobs, but never a complete site.

But at least all the bugs in Cashtrack.co.nz are all 100% mine! I worked with the very talented ladies of Decisive Flow on this project: they provided the fantastic design of the site, and I tried not to ruin it too much as I combined it with the Silverstripe development :)

Cashtrack is a pretty simple website (hence my ability to do it on my own!?), it lets New Zealanders enter the serial number of their note and little about where they picked it up etc. As the database grows, I think it will become a really interesting site that can might go in directions we haven’t thought about before.

I’m already thinking about some of the reports we could run: Where in New Zealand do people have the most $100 notes? What dollar amount has the site tracked so far, etc. 

We stuck with the philosophy of keep it simple at the start and adapt the site as required over time. I think it is the best policy for a site like this as it lets the site direction be guided by how users interact with it.

So best of luck to Rupert with the site. I certainly enjoyed doing the web development with SilverStripe and the development framework, Sapphire.

Almost finished my next big SilverStripe project too!

Comments

Remove the SilverStripe generator meta tag

Oh dear, SilverStripe 2.3.1+ now has an updated meta tag function that has a “generator” meta tag which includes detailed version numbers of the CMS. Eg for version 2.3.1, it has the text: “SilverStripe 2.3.1 – http://www.silverstripe.com”. Take a look here as to why I think this is a bad idea.

This is a real pity, and not something I want to have in a production website. SilverStripe is a great CMS and development framework and deserves praise (as does the web development company behind it, SilverStripe), but not right down to the release number!

Removing the generator tag is pretty straightforward:

  1. Open the Page.ss for your theme. Eg for blackcandy, open /themes/blackcandy/templates/Page.ss
  2. Remove this function call: $MetaTags(false) (could be $MetaTags(true) either)
  3. This prevents the generator tag from being output, but it stops a few other meta tags too, so I suggest you add the following to your Page.ss in the <head> section:
    <title><% if MetaTitle %>$MetaTitle <% else %>$Title <% end_if %>- MyWebSiteName</title>
    <% if MetaKeywords %><meta name="keywords" http-equiv="keywords" content="$MetaKeywords" /><% end_if %>
    <% if MetaDescription %><meta name="description" http-equiv="description" content="$MetaDescription" /><% end_if %>
    <meta name="generator" http-equiv="generator" content="SilverStripe - http://www.silverstripe.com" />
  4. <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="en"/>

  5. Save your file and upload if necessary. Once you flush the cache, your should see the changes

Now you might notice that I did slightly more than just meta tags there: I also updated the <title> tag. The $MetaTags function call I removed can output a title tag if $MetaTags(true) rather than false is set and you have a meta title set for your page in addition to the standard title.

This is a good idea for some pages. For example, a page on a site I was recently working on was called “Home”. This was fine for the navigation label and actual on page title, but “Home – MyWebsiteName” does not look good for a window title or in google search results, so we used the meta title to set something which only appears in the meta data and not on the actual page, which was more descriptive and useful.

You might also notice I did not completely remove the generator tag. Well I do want to show my support for SilverStripe so in this particular instance I have just removed any mention of version numbers. At least you now have control over this text.

Some caveats though: my code above replaces what the MetaTags function currently does, but this may change in future so that were additional functionality added to the function, you might be missing out. It also gathers data such as the language and content-type automatically which you need to set manually in my code (if you need to change it).

I will blog again on the MetaTags function if it does change. A perfect reason for subscribing to my RSS feed!

Comments (5)

What a difference a host makes

Over the past few months I have been struggling to get a website I manage onto a level footing as the site’s traffic began to reach over 750k page impressions per month. The VPS server it was on, despite adding additional cpu and RAM resources to it, continued to struggle – slow page load times, and Apache web server crashes were becoming commonplace.

My initial strategy was to move the site to a Media Temple Grid-Service hosting account. I won’t bore you with the details, but the Grid service has lots of space and bandwidth. Rather than running your site on one server, your site has computing resources available across the grid.

Unfortunately, each account has a limit on the amount of computing power it can use, measured in Grid Performance Units (GPU), and the site looked likely to require 5 or 10 times the amount of GPU’s that are included, and this overage would have run into several hundred dollars of additional charges a month. Not feasible.

The other disappointment was that although the hosting platform had become stable with the move to Media Temple, page load times were still disappointingly slow. This wasn’t a real surprise though as I had noticed this with other Media Temple hosted sites.

So off I went to find another hosting alternative. During my research I came across a crowd called SimpleHelix. I was little sceptical from their site as it looks ahem, rather similar to Media Temple’s, particularly the hosting plan names. Some research on blogs and forums gave mixed, but overall positive reviews, so I decided to give it a whirl. I was particularly interested in it’s technology which speeds up web applications.

A month in, and no complaints. Traffic is still growing, but page load times are much faster, and I have experienced no down time or other support issues.

It is not exactly scientific, but looking at the Google Webmaster stats for the web crawler page load time, I can see that pages have been loading much faster since the change in hosts.

Google Crawl Stats

Now actual page load times will not be as fast as they are for the Google web crawler, but I am sure this does give a sound indicator that page load times have decreased significantly since changing over to SimpleHelix. 

So, not as much disk space or bells and whistles as Media Temple, but excellent performance on a $20/month hosting package for a site serving 750,000 pages a month. Well worth it.

Comments

« Previous entries Next Page » Next Page »