Technology

Technology

Browsers, The Internet, Linux and more.

Browsers, The Internet, Linux and more.

Best HTML to PDF Library Ever!

The thing is huge but it beats the crap out of most things out there. I'm talking about tufat.com's html2ps and html2pdf PHP library. Check it out here:
http://www.tufat.com/s_html2ps_html2pdf.htm

I took the HTML output from Ubercart's invoice system and fed it to this library and, voila, PDF invoices. Lovely stuff :) Especially when you consider that I've been struggling with this PDF stuff all day long.

Make sure you give html2Fpdf a skip. It's quite a waste of time. Enjoy!

Wondering What to Tip your Waiter?

What's 10% of your dinner bill? Bad service? Make it 8%? Good service, make it 20%? But what IS 20% of R432,12?

Take out your cellphone and go to www.waiterlove.co.za to find out. I dig it!

Gmail's Improved Labels Rawk!

Gmail, how do I love thee, let me count the ways :D

This morning, I woke up to Gmail's improved labels. Previously, I would get completely distracted by the amount of emails I had in different labels. As soon as I was finished with my "2Do" emails, something would pop into "Facebook" as soon as I'd read that, a new email came into "Twitter" and so on.

This was not good for my productivity.

So you can imagine my sheer joy at the improved Gmail labels interface. You can now "hide" the non-work, non-paying labels and only show the important stuff. The non-important stuff can be dealt with in one go and then hidden again. Distractions be gone! Helloooo productivity :D

Lookie! It's so neat & tidy!

Yes, that's right SIXTEEN more! An email into any one of those SIXTEEN more meant Norio wasn't getting sh!t done :D

Viva Gmail, viva Google, viva Norio's productivity ;)

SugarCRM is BAD for OpenSource

SugarCRM or, more accurately, SugarCE (community edition) is opensource customer relationship management software, or CRM software.

Like other CRMs available, its purpose is to make it easier for you to keep track of your customers and your company's relationship with those customers.  You can do that by keeping track of leads, sales, and so on.

Now I've just spent over 10 hours today trying to install and run SugarCRM but I continuously encountered issues where it would hang for minutes at a time and generally be very useless. 

I checked my logs, checked the other applications on my web server and everything seemed fine.  In fact, more than fine, being a Sunday afternoon, everything was running extra fast.  Every except SugarCRM, that is.

"Not a problem, I'll go to the forum", I thought.

Ha ha. Ha ha. Ha.

I encountered a number of people experiencing the same issues I was but here is where it gets interesting, threads were being opened but never answered.  I must have found over 7 threads relating to the issues I was having without any one of them having a single answer posted.

That's terrible.

In my (extensive) experience with OpenSource, questions get answered in hours or days.  They don't get left there for you to battle with by yourself.

To me, the problem is NOT the community but in the way that the Sugar company itself runs it's forums and the rest of it's company.  It would appear that no one is employed to moderate the forum, much less provide added support.

They might step in at this point and argue that the community edition of their software isn't supported but this level of UNsupport leaves a bad taste in my mouth.  The sort of bad taste that ensures that I never try the commercial version of their software.

I'm bitterly disappointed in SugarCRM.  If this was someone's first experience with OpenSource can you imagine them ever coming back? I don't think so.

My Take on Google SearchWiki

If you're logged into your Google account while searching for something, you'll have noticed some changes to the results.  Specifically, arrows that allow you to move certain results up, and the ability to comment on search results.

What's my take on this?  Despite what Google is saying about how your changes won't affect other people's search results, I don't believe them!  I think that this is a cheap way for Google to have user-moderated search results!  I'm not saying the new features aren't useful, I think the changes are great but I also definitely think Google will take note of what people are doing and take some of into account.  After all, how can you ignore millions of people's opinions on where things should be ranked?  If there's a common-thread that, say, one YouTube video should be ranked higher than others for a particular keyword, Google would be stupid not to use that information to its advantage and offer better search-results.

I think it's smart and I like it.  Putting the internet back in the hands of the users is what it's all about!

Check out Google's blog entry on SearchWiki.

Drupal Templates & Themes

I've just set up a site where you can buy "Premium" Drupal Templates and Drupal Themes (same thing, really).  I think the availability of paid-for themes for Drupal shows that it had matured to the point where the masses can now use it without necessarily being a techie.

Now we just need more techies to see the opportunity and start selling more templates.  Yes, yes, I know most of you guys are against charging for your work on something GPL but, really, this is how we get QUALITY stuff out there and this is the next step to growing Drupal.

Enjoy the templates and please make sure you buy at least one ;)  Support a fellow blogger, and all that :D

Norri's Simple Machines Forum CDN

I'm experimenting with the following code which will basically mirror my attachments and avatars on my forum onto my Amazon S3 account and serve them from there on subsequent requests.  If you want to do something similar (it can save a LOT of bandwidth!), copy this code in after around line 1047, in Sources/Display.php...

NB:  This code requires the S3.php file available here.

/** Norri's CDN **/
  $bucket = "bucketname";
  $prefix = "cdn";
  $cdnurl = "http://s3.amazonaws.com/$bucket/$prefix";
  // redirect if CDN version exists
  $cdnfileurl = "{$cdnurl}/{$real_filename}";
  if (fopen($cdnfileurl, "r") !== false) {
    header("Location: {$cdnfileurl}"); exit;

  // else, copy over for next time and continue loading local file
  } else {
    set_time_limit(0);
    ignore_user_abort(1);
    require_once('S3.php');
    // AWS access info
    if (!defined('awsAccessKey')) define('awsAccessKey', '********************');
    if (!defined('awsSecretKey')) define('awsSecretKey', '****************************************');
    // upload
    $s3 = new S3(awsAccessKey, awsSecretKey);
    $s3->putObjectFile($filename, $bucket, urlencode($prefix."/".$real_filename), S3::ACL_PUBLIC_READ);
  }
/** /Norri's CDN **/

Next I'm going to look at probably a whole TWO lines to add to my .htaccess file to redirect direct requests for images in my forum theme to my S3 Amazon account.

Alexa Hax0red my Server!

My server in The States was hacked by mistake by Alexa's web-crawler.  You see, if you have the Alexa toolbar or, like me, Quirk's SearchStatus plugin installed, then Alexa will crawl the pages you browse.  Maybe not all of them, maybe only pages from domains it doesn't already have indexed but, nonetheless, it will crawl them.

The problem with that is that some parts of the net aren't supposed to be indexed.  It used to be considered safe to put something up without linking to it or telling anyone about the URL.  If you did this, it shouldn't be accessed by anyone as, if something isn't linked to on the internet, for all intents and purposes, it doesn't exist!

Well that doesn't count any more :P

The problem is that the admin interface I use has a well-known bug wherein it doesn't properly check your login credentials before giving you access to administrative pages.  And that's basically how they h4xored my server.

Their crawler accessed my admin interface and proceeded to "crawl" the deletion page for one domain and the suspension pages for 2 others.  Fun stuff for me ;)

Luckily I picked it up about an hour after it happened so I've been in touch with them and let them know about what's happened and I've fixed my server but boy was I shocked to find Alexa at the other end of my h4xoredness :D

Just goes to show that you shouldn't be lazy in patching your server.  Security by obscurity is no security at all.

Google Chrome: New Browser from Google

Google ChromeIt's only available for Windows (right now) but it looks absolutely AMAZING.  I've been reading through their presentation and they've literally taken the core bits and pieces that make your browser slow and re-written them. 

  • Each tab has it's own process, so one crashing doesn't mean your browser crashing. 
  • Javascript gets executed in it's own safe-box.
  • It also gets compiled to machine-code and then executed, speeding concurrent runs of the same code a LOT.
  • The interface has been slimmed down a LOT.  So now GMail will look like it's own app, if you want it to, instead of a browser window.
  • Pop-ups are restricted to each tab's space.  But if you want to promote one to it's own window, you can.
  • Open a new tab and you see all your most-visited web sites and most searched-on sites too.
  • New versions get tested across millions of web sites (using their own datacentre) long before you get a hold of it.

Frankly, I'd get tired just writing about all of its great features.  We're basically watching the internet's next phase and Google started it (again?)

I'm sad that it's not ready for Linux yet but it will be soon and, in the meantime, you can test it out (if you're on Windows) and give us some feedback here!

Tags: , ,

Numerology is Cool :D

I was mucking about with some ideas this weekend when I decided to finally create the lottery number generator I've been thinking about doing for ages. Originally, my idea was to take all the numbers that have ever been drawn before, along with the number of times they've been drawn, and then use a bit of a random algorithm to pick 2 common numbers, 2 not-so-common numbers and 2 in-the-middle numbers.  And then test until I'm getting 2-3 numbers per draw.  Perhaps I'll still code that one but it'll take a bit more database work than I was prepared to do this weekend!

So today I sat down and coded a numerology-based lotto number generator (<- try it out here!).

How numerology works (when calculating your secondary number) is you take the numbers in your birth date (eg: 1983-10-19) and you add them all together (eg: 1+9+8+3+1+0+1+9) to simplify them into a smaller number (eg: 32) and you keep doing that (eg: 3+2) until you get a single-digit number between 1 and 9 (eg: 5).  THAT is then your number.  It's kind of like astrology in that you should, with numerology, be able to tell what kind of person you are, what your purpose in life is and a whole bunch more using some basic math to get your number and how it applies to certain areas of your life.

What interests me about numerology is that you can add your numbers in any way and still get the same number (1983+10+19 = 2012, and 2+0+1+2 = 5!).  That's not freaky, it's basic math but, for someone like me who failed math on standard grade, it kinda feels all X-Files like :D

So, anyway, numerology can also be used with letters from the alphabet but there's a bit of confusion (and disagreement) on which letters represent what numbers.  I've basically gone with what's been touted as "the most powerful set" according to the author of this numerology / lottery article.

With that in mind, my lotto number generator takes your first name, last name and birthdate and finds your 3 lucky numbers.  Then it expands those numbers into their lotto-suitable counterparts.  For example, if one of your lucky numbers is 3, then your lotto lucky numbers include 3, 12, 21, 30, 39 and 48.  Basically any numbers that, when simplified to single-digit, give you the number 3.

I take all of those numbers and then pick a random 6 for you to play for the next draw.  I hardly consider this rock-solid science or anything but it would be interesting to see if this "strategy" works for a few people.  If not, at least I had some fun coding this weekend :D

Enjoy and please leave comments!

Tags: , , ,