Archive for the ‘eTeanga’ category

48 hours in L.A.

February 10th, 2011

Rodeo Drive, L.A.

I’ve lived in Ireland for most of my life, except for two trips to France for study and work experience.

I live my life with certain prejudices, formed by what I have already experienced. Prejudices, not necessarily negative in any way, are needed to deal with the world. You need to live your life with a certain set of assumptions. It’s always interesting to experience something new that enrichens your pre-existing assumptions. Experience, I guess you’d call it.

The past 48 hours I spent in L.A. with my lovely wife. L.A. was always going to be difficult for me to conceptualise. There isn’t as far as I know, one “main street”.

Back in Limerick city, you walk down O’Connell Street and you get the see Limerick. It’s not the full representation of the city, but it’s the central location where upon seeing it, you can rest assured that you’ve seen the main bit.

But in L.A. I got the feeling that seeing any one part of the city didn’t tick off the “I have now seen L.A.” checkbox.

I guess I came close to that twice though: Hollywood Avenue and Beverly Mall.

L.A. is of course built on top of the movie industry. While being here it struck me just how successful an industry it is. They (whoever “they are) have founded an industry that has become enshrined in the globalised society. Something that comes from thousands of miles away is very much a part of Irish life and popular culture (only matched by Christianity, as far as I can tell!).

Malibu pier, L.A.

Hollywood Avenue is the tacky representation of the industry that seems to be based further up the hills and across in San Fernando valley. It has stars along the sidewalk with names of actors and musicians. I take it you’re meant to trample upon their names?

After the 48 hour mark of our trip, entering Beverly Mall in West Hollywood was finally the feeling of “I have now seen the type of person they get on My Sweet 16″. Girls really were dressed up to impress, as if they were imagining strolling through the Cresent Shopping Centre in Limerick.

The locals seemed to be good fun and quite relaxed. We got talking to one girl up by Griffith Oberservatory (great views of the city) who was walking her dog. Turns out she was in Dublin for two weeks’ acting classes in the Gaeity Theatre. Another guy, Adam, was at a bar in the Farmer’s Market with his girlfriend. He was smoking cigars, and offered that seeing Disneyland would be more fulfilling that cycling along Santa Monica beach. Maybe it is a tough call.

When I talk about the locals I met, I’m talking about the W.A.S.P.s of L.A. The city, while mixed, is certainly segregated along ethnic lines. But segregated is far too strong a word. Rather, there’s a focus of different races depending on their concentration and influence in any particular area.

It’s impressive how going even from block to block along the same road you get Jewish centres, then Korean, then Mexican. The Mexican influence here is obvious, and you hear Spanish spoken a lot.

The Mexican-style food here is delicious. The “City Market”, named in such general terms, is really a bustling market of real Mexican produce and ingredients. Indulging in a couple of margeritas in El Cayote (visited by Harry Bosch, no less) hit the spot along with some taccos, burritos and enchilladas.

Taking the metro from Downtown, it was again mostly people of Mexican origin. The public transport system here is nothing to be sneezed at. A day pass got us from Hollywood Blvd., to Griffith Observatory, across to Universal City, and back down to Beverly Ave. for our margeritas, with a mixture of buss, shuttle bus, and metro.

Taking any sidestreet off the main avenues brings you to the leafy residential areas. It was here that I got the feeling that the residents were perhaps a little fearful, many houses proclaiming that they were protected by “armed response” security companies.

These houses in the ‘flatlands’ must be the poor cousins of those people living in the hills. Everyone is jostling to live on the highest local peak. Nobody is satisfied with their current situation and always have another place to strive towards. This is the same as any city I know of (yes, of my limited experience).

Billboard against the Hollywood hills.

One thing the local residents really surprised me with was their yielding to pedestrians. Walking along the footpath in Ireland, cars will pull across you without a second thought. They will pull out on the footpath right in front of you waiting to turn on the road, making you walk around them. But the drivers in L.A. always seemed to think ahead and let us pass first.

Overall, I think I can say I was pleasantly surprised by the city. The time of year definitely helped (late January), and there was generally a relaxed atmosphere to the place. There’s obviously huge wealth in the area, and my respect for the society here for being able to create that. The Hollywood industry is massive, while being massively fake, tacky, and difficult for me to comprehend. Public transport is effective, and the choice of food is (too) delicious. With so many other places on the list to visit in our lives, it’s difficult to see us planning another trip dedicated to L.A. That being said, it’s been an interesting place to spend time, and I certainly wouldn’t refuse to come back.

Creating automatic PDFs with PHP, MySQL

January 18th, 2010

My collaborative Irish dictionary, Irishionary.com, creates a nightly PDF version of the dictionary. A cron job calls a PHP script that generates the PDF. There are examples of great looking PDF publications and mine isn’t one of them ;) All the same, it’s not that hard to create your own PDF files though PHP scripts pulling information from your database if you wish. If you figure out how to make them look nice, let me know!

An example of a PDF created through my PHP script:

This is the automated PDF of the Irishionary.com dictionary.

This is the automated PDF of the Irishionary.com dictionary.

mPDF is the PHP library to use for creating this PDF. There are lots of other libraries available, but it’s hard to find one that instantly suits. mPDF seemed to be good in several ways, especially given that you can style the PDF using CSS (Disclaimer: not all CSS tags are supported. Each sold separately. Batteries not included.) Another good reason to use it is that there are a range of fonts that you can use.

The official PDF to show off what mPDF is below. However, I will not allow you to see a full size version of it in the likely chance that it would negatively affect your view of humanity.

Official show-off PDF by mPDF.

Official show-off PDF by mPDF.

Stop messing around, let’s get coding. Download the mPDF library above, and put it somewhere in your web directory. Start editing a new script called mypdf.php.

Step 1

Include the library in your script.

define('_MPDF_PATH','./mpdf/');
include('./mpdf/mpdf.php');

Step 2

Initiate the object that will output the PDF for you.

$mpdf=new mPDF();

Step 3

Write some HTML to the PDF. This is where your literary prowess comes in handy.

$mpdf->WriteHTML('<h1>My PDF</h1><p>Yes, this ebook was totally
worth $29.95 of your hard-earned cash.</p>', 2);
$mpdf->SetFooter('Copyright: me.');

Step 4

Write the PDF to your file system. This step may require some permissions setting magic that your Auntie Maggy definitely couldn’t do. Check out the documentation for more pointers.

$file_path = $_SERVER['DOCUMENT_ROOT'].'/pdf/mypdf.pdf';
$mpdf->Output($file_path,'F');

Step 5

Either a) give away your PDF for the sake of humanity, or, b) charge a $29.95 price for your Amazing New York Times and Life changing My Mammy” PHP-generated PDF.

Web development on Ubuntu

January 11th, 2010

I get it. You’re a Windows person, always have been and always will be. Ok, you’re not a total n00b either. You’ll use the latest Firefox (even Chrome, but you’re a little suspicious about its privacy implications). For LAMP coding you’ve set up XAMPP and code with Notepad++. You’ll use TortoiseSVN to commit coding changes, and you’ll load up Putty to finally update your product web site. And you’re actually pretty happy with your Windows 7 setup (hey, I like it too).

But I’ve made the switch, and you and your pet dog Pudgie could too. Given that you’re not a total n00b, you should consider using Ubuntu for your daily life, and particularly for coding that amaaaazing web site idea you have that lets users schedule their coffee breaks with long lost school friends. Oh, and it has an AJAX-y frond end with widgets and lots of buttons. Ubuntu is nicely set up for this, whatever your online project. Actually, you’ll even come to like that you can SSH and SVN directly through the terminal.

Apache and MySQL feel more at home here, while XAMPP on Windows has always acted a bit like a shady character that you’re never too sure what it’s going to do next. I was sick of the start-stop services of XAMPP. It’s like trying to use Safari under Windows, it just doesn’t feel right. And try letting Apache start with the rest of your crawling Windows installation, haha no thanks!

To give you a flavour, here’s what my Ubuntu desktop could look like if I was doing web development and happened to keep my windows nice and orderly:

An (orderly) view of my LAMP development on Ubuntu.

An (orderly) view of my LAMP development on Ubuntu.

Still a bit unsure about this Linux thing? It’s easier than it used to be. Just set up a virtual machine with a copy of Ubuntu running on it. No need to do a nasty dual-boot setup. (Later on, I bet you’ll be installing Ubuntu and virtualising Windows).

Ok, you’re almost there.You’ll need to install some extra components (although if you install Ubuntu server edition I think a lot of these are already set up for you).

Coding editor. Ubuntu already comes with a text editor called gEdit. Change the colour scheme to Oblivion, show the File Browser menu on the left and you’ll have an instant coding environment:

Gedit text editing program that's shipped with Ubuntu.

Gedit text editing program that's shipped with Ubuntu.

Apache, MySQL, phpmyadmin: With Ubuntu, you don’t have to trawl the web for software downloads of supported packages. Just install them directly through the system’s package manager.

Subversion: In the same manner as above, install SVN. You’ll be able to update/commit directly in the terminal. Now that you can use the Synaptic Package Manager, grab yourself a copy of Firefox too.

That wasn’t so bad, was it? Now you’re running on a free operating system that’s being constantly updated. If you’ve gotten this far, I now declare you an Ubuntu fanboy :P The only reason I still use Windows 7 is when I need to use Lightroom for my photo collection, but that’s a different (virtualisation) story!

Multiple operating systems – Virtualisation

November 16th, 2009

The era of dual-booting my desktop PC may have come to an end. Using Ubuntu as my primary operating system, I can now just run other operating systems on top of it using virtualisation. The idea has been around for a few years, and is matured enough to use reliably one your home computer.

I’m still relatively uneducated about virtualisation. As I understand it, it allows you to boot up your PC as usual, but then you can run other operating systems ‘within’ it, as if they were normal applications running on your PC. As far as I understand, with the normal virtualisation setup will need you to run at least one primary operating system normally (while enterprise-level tools may break away from this requirement).

So let’s jump straight in to how you can set this up on your system. This is the “host” operating system. Any virtualised machine running on top of it will be called the “guest”.

How to get virtualised

It’s this easy to run other operating systems on top of your normal one:

  1. Install Sun’s VirtualBox. It’s an open source virtualisation platform (very complex programming underneath the hood). It’s easy to use!
  2. Create a new virtual machine. This is the machine on which you’ll install an operating system.
  3. Boot up your virtual machine!

Pics or it didn’t happen!

Ubuntu is the operating system that I used as normal before any virtualisation setup.

I installed the VirtualBox application on Ubuntu, which then looked like this (you can see I already installed one virtual machine):

VirtualBox virtualisation application running on Ubuntu.

VirtualBox virtualisation application running on Ubuntu.

I then created a new virtual machine using the simple menus. Using an ISO image of Ubuntu Netbook Remix operating system, I installed it on the virtual machine. After booting up the virtual machine, that Ubuntu Netbook is then running as a guest its own window on the host. If you have the licenses, you could also run Windows XP and Windows 7 as guests in other windows in parallel, for example.

Here’s Ubuntu Netbook running as a guest on my desktop, on top of standard Ubuntu:

Ubuntu Netbook Remix running within VirtualBox.

Ubuntu Netbook Remix running within VirtualBox.

Bonuses

Each virtual machine created in VirtualBox is just a file on your actual hard drive. This means that the file can be backed up to store a “snapshot” of your guest operating system. If you make too many message installations on the virtual machine, you can just roll back to a previous snapshot you took.

Virtualised web hosting: The server which served you this web page is also coming from a virtualised operating system, offered by Servint. This feature allows me to rent a server running as a virtual machine (a “virtual private server”), which is cheaper because I’m sharing the hardware with other virtual servers, but it also has good performance as it has guaranteed minimum RAM and processor usage. It’s reliable too, as any other virtual server that crashes on the same hardware will never affect the reliability of my own virtual private server. Read more about eTeanga’s VPS hosting experience.

A glimpse into the early Web

November 3rd, 2009

We take a lot of the Web for granted. Things “just are”, but it’s not really that long ago that HTML and HTTP standards were being discussed and were still “under construction”.

Mark Pilgrim shows quotes from a mailing list including Marc Andreessen and Tim Berners-Lee. The discussion is about introducing a new IMG tag to be used in HTML documents to be able to include images in the page.

What seems like such an arbitrary discussion affects coding structures that are directly used still, about 20 years later.

Hosting with a Virtual Private Server

August 8th, 2009

This page links to a commission-paying link for a service I’ve used for years.

You can get web site hosting dirt cheap these days.

If you’re looking at dirt cheap hosting, it’s most probably shared hosting. This means that you’re sharing the server with lots of other sites, and you probably don’t have access to configure any of the services offered to you.

VPS (Virtual Private Server)

If you’re a bit nerdier like me, though, you’ll probably have fun running your own VPS. This is a whole step up from shared hosting – you basically run your own server.

The only catch is that your virtual “server” is sharing the same hardware with a few other virtual “servers”. This virtualisation allows you to run a fully self-contained server, while not paying for using all the hardware.

When I say you get a server, I mean that with a VPS you can:

  • SSH to your server to control it at the command line
  • Fully configure Apache, MySQL through config files, log files, custom timeouts – whatever you want.
  • Guaranteed RAM and CPU cycles.
  • Install git for version control.

Why I went for Servint

I’m not a Linux command line pro. Actually, I felt a bit lost there at the beginning. Instead of going for a blank canvas approach such as Slicehost, I opted for Servint which is a fully managed VPS. This means that if something goes wrong, if I mess up Linux or Apache, their 24/7 support guys will fix it.

Try out Servint if you want more than just shared hosting. The page you’re reading right now was served by that VPS. It takes a bit of server juice to serve all those dynamic pages, especially at peak times.

Get hosted with Servint VPS hosting.

Fail cat at a totally new level

July 24th, 2009


Catcerto.

Film a cat playing the piano, and write an concerto to accompany it.

http://www.youtube.com/watch?v=zeoT66v4EHg&

Sweet. CMS+Blog on WordPress

July 17th, 2009

To set up WordPress for both CMS and Blog:

  1. Create a Page and call it “Home”. This is your default home page.
  2. Create a Page and call it “Blog”. This will show in /blog/.
  3. In Settings -> Reading,
    1. Set to show “Home” as the static page for Pages
    2. Set “Blog” as the static page for Posts.
  4. In Settings -> Permalinks, change the “Common” rule to /blog/%postname%.
  5. Ta da! Your pages will be created as mysite.com/page/ and your blog posts will appear in mysite.com/blog/post/.

After 7 years of using handmade PHP pages on LearnIrishGaelic.com, I finally moved the site over to a WordPress installation.

What this means is that I have one of the most mature web application at my fingertips. Adding a new page no longer means creating a new PHP page, and worrying about how to update my navigation menus.

What’s better, I read Brian Yerkes writing about how to use WordPress both as a CMS and Blog. This means that the main part of your site can be static pages, while WordPress still handles /blog/ as a blogging application. Follow the settings above to get your own CMS powered by WordPress, while having a blog section.

Taking doubt out of the checkout process

July 1st, 2009

learn-irish-gaelic

Handing your hard-earned cash to to an online vendor can be hard to decide on, especially if it’s a small site you’re not familiar with. I’m always highly suspect of a site promising to ship something out to me.

So I was thinking about how to optimise the visitor’s process on LearnIrishGaelic.com where I sell some language learning software.

I’ve made a small change online. Instead of guessing when you’ll receive your order (“within 10 days”), I’ve added “Next dispatch date” and “Your order will be delivered by…” date to the shipping information.

Hopefully just another small bit of information that will help you decide to splash out on a learn-at-home Irish language product ;)

Newstalk.ie not coping with news traffic

June 7th, 2009

croppercapture1

Yesterday was the first day of counting in Ireland’s 2009 Local and European elections.

There will always be some spike in traffic to a news website around a big event such as an election. These are the most crucial times for a news site.

This is why a news site’s server should be prepared for unexpected traffic spikes. Unfortunately, Newstalk.ie (a good radio station) is down, presumably because of people trying to get up to date on the latest election news.

Tip to Newstalk: beef up your server and check your Apache settings ;)