Archive for the ‘extras’ Category

nginx and WordPress

Tuesday, August 17th, 2010

I just moved my weblog from a shared-hosting provider because it was getting laggy into my private Xen VPS at Linode (shame-less referral link is included :) ). I decided to move away from Apache due to its heavy memory usage, and use Nginx instead. nginx (pronounced “engine X”) is a lightweight, high-performance Web server/reverse proxy and e-mail (IMAP/POP3) proxy, licensed under a BSD-like license. Its memory footprint is much less than Apache and the performance is much better as well.

I’ve setup nginx & PHP running as fast-cgi following this guide from the Linode community documentation (an excellent resource I might say).

In order to get it working with the WordPress, I needed to translate mod rewrite rules to work with nginx, so my fancy permalinks would work. I used the following config for that:

location / {
root /home/websites/andreas.louca.org/public_html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}

The try_files directive will check if the file exists first. If it exists (like an image file) it will serve that directly. If it doesn’t, it will pass that as an argument to WordPress’ index.php. As simple as it gets!

Hope this helps someone!

Drobo FS

Friday, August 6th, 2010

Being a geek, I always wanted to keep my data safe, because I went through equipment failure quite a few times. I used to backup everything to CDs and then later to DVDs, but that isn’t practical anymore with the amount of data we generate nowadays. So I moved to external hard-drives, weekly backing up the “important stuff”.

When Apple introduced Time-Machine, things got a lot easier. Just plug an external hard-drive, and Time Machine takes care of the rest. However, the way time-machine works, it saves multiple versions of the same file (that’s good, in case you need an older version) but it takes much more space than a regular backup. Therefore, I was forced to migrate to two external hard-drives: one for my time-machine backups, and one other hard-disk for keeping the rest of the data that did not fit (or I didn’t want to keep) in my machine’s disk.

My configuration so far was an 750GB hard-disk (via USB2) for Time-machine backups , and one 1TB hard-disk (via Firewire 800) for large media files. 750GB for my documents/data backup was sufficient — it kept my data for 6 months. I also backup important stuff (coursework, source code, etc.) on Dropbox, so I always have those synced on the web and on multiple machines around the globe (US, UK and in 2 locations in Cyprus).

However, I am unable to backup twice photos and videos I took, because of the size. My iPhoto library weights approximately 40GB, as it contains hi-def videos and RAW picture files from my DSLR. Finally, backup up my laptop was inconvenient, since the time-machine volume was physically connected to my iMac, therefore I barely backed it up.

So I decided to move to a NAS solution to keep my data safe, have the ability to access it from the network. I looked at a few solutions, from building my own little machine to multiple NAS offerings. Finally, I settled with a Drobo FS from Data Robotics. While the initial price-tag was quite high, approx. £500, the overall functionality well worths its money.

It offers 5 SATA bays, where you can install any brand/size SATA sard-disk you want. Mix & match. Then, the Drobo using the so-called “BeyondRAID” technology manages the storage. It aggregates the hard-disks together offering a bigger volume, with some space reserved to withstand 1 HD failure, or two with the optional setting. Its dead simple: just put the hard-disks in. Setting this thing up took me 10 minutes. Drobo provides visual indicators on its chassis regarding the current disk health (Green for OK, Red for bad next to each slot) and how full the NAS appliance is.

It is connected to my home network via Gigabit ethernet, and the user can manage it via the Drobo Dashboard. The application automatically detects any drobo connected in the same network, no fuss no settings to configure. You can create volumes, shares and adjust user/group permissions using the Dashboard application as well as manage more advanced settings such as notifications if something goes wrong. Excellent!

Regarding performance: to be absolutely honest I was expecting this thing to perform a little bit better. I am getting approx. 25-30 MB/sec write speed and 30-35MB/sec read speeds. Given that thing uses something similar to the RAID technology and a modern hard-disk can spit up to 100MB/sec of throughput I was expecting that this thing can saturate a Gigabit link (approx. 128MB/sec without calculating TCP/IP overhead) or worst case scenario half of it.

Finally, the thing I liked the most: DroboApps. Drobo gives you access on the machine via SSH, and you have the option to install applications on the NAS device. This comes really handy: Torrent application, Firefly (Firefly serves digital music residing on the Drobo FS to the Roku Soundbridge and iTunes), FUPPES (FUPPES is a free, multiplatform UPnP A/V Media Server with DLNA support. — serves media to my PS3). I also cross-compiled PHP CLI interpreter for it so I could run some home-automation scripts on it. Neat.

This gadget perhaps its one the best appliances that are not Apple-made, given its beautiful design and ease of configuration. I am glad I finally got it — it saved me from a huge stack of external hard-disk drives.

First impressions with iPhone 4!

Thursday, June 24th, 2010

Just got on my hands the new iPhone 4. First impressions:

  • AMAZING display. Never seen anything like it before.
  • Much more thinner. It also feels more solid in hands. The glass filling is amazing
  • The new camera takes impressive pictures. Its not an SLR, but it beats most of point-and-shoot out there

For those needing to cut their SIM, I used this template to do it. It is really easy, but you have to be careful not to over-cut the plastic.

A sample 720p Video: here

A few sample pictures from its camera (to be updated on the fly as I take more) – Click for full size:


iPhone Pictures:


Lancaster University in the elite top-10

Friday, June 11th, 2010

The last few years Lancaster University has been expanding rapidly. New buildings, more staff and better infrastructure. I’ve been here for 4 years now and the campus is continuously expanding, old buildings are either demolished or renovated and it feels like the university standard is getting better and better.

I am really glad and proud to see Lancaster joining the top-10 Universities in the UK, amongst or even surpassing some other “older players”.

Some links:

While Lancaster is not a Cambridge yet, the University has managed to surpass other older institutions such as UCL, Imperial and Kings. This also shutters the belief that you have to be an old University to dominate the top-10, since Lancaster managed to join the elite 10 in less than 50 years.

Patet omnibus veritas

Thoughts on Apple

Thursday, June 10th, 2010

I’ve been meaning to write this post sometime now, but I didn’t find the time to do it. Apple is a remarkable company — it went from oblivion to surpassing Microsoft’s market capitalisation, mostly due to the guidance of its CEO, Steve Jobs. However, what makes Apple significant is not their cash flow, nor its stock price (although this is an important factor when it comes to other things). What makes Apple significant its their ability to innovate and deliver amazing, polished products to the market.

First, take a look at the contraction quality of their computer hardware. The MacBooks have been remarkable machines, right from the beginning. My first Mac was a 1st-gen Macbook Pro, the first Intel machines that came out from Apple. When I held that laptop in my hands, and felt the sturdiness of the hardware, the great feeling of the aluminium I thought to myself “Wow, what the hell I was using before?”. You can’t even compare Macbooks with Dell/HP and others when it comes to build quality and beauty.

Then comes the OS. The remarkable Mac OS X. All of my life I grew up cursing Windows and their bluescreens. At some point, I also switched to Linux, but the hardware integration was so terrible, that it was even worse than the bluescreens. The difference between Apple and Microsoft when delivering new versions of the Operating System is that Apple introduces new features in the OS, like spotlight, Expose and so on, whereas Microsoft, most of the times, they just change the icons (see Windows 98 to ME, or 2000 to XP). People isn’t just looking at the icons, as it seems, they also care whats going on beyond that. Their OS is so well integrated with the hardware, that when you think about Windows it feels like a nightmare (n.b. I do not know if the situation with Windows 7 improved this area). You don’t get that with any other vendor.

With Apple’s entrance into the mobile market, lots of people came to criticise the company and how it handled the delivery of new features, both in hardware and in the OS. To me, the iPhone was the best phone I ever had. The huge gallery of applications, the multitouch, the best mobile browser and the excellent integration of other sensors in the interface (accelerometers etc.) is simply amazing. Let me ask you this: how do you browse the internet with your Blackberry phone? Still on WAP-alike pages eh? How about applications? Thought so. Sometimes I hear stupid arguments about competitor’s features like: well, my Nokia had multitasking 4 years ago. Well, how slow your phone was when you had 2 applications running? Now I think of it, what kind of applications you used to run back then? Or they compare Blackberry’s battery life with the iPhone’s. The only thing that your blackberry does through out your day is receive emails in a crappy mail client, you can’t do anything more on that thing. You can’t even browse the web on that thing (future browsers they may release will be considered when they release them). Let alone the smaller touch-less screen.

Having multi-tasking on small, embedded devices is a really hard thing to do. Hard, not because of the technology to multitask applications, but how to do implement it in a way that won’t suck up memory and make everything slower. Android and iOS 4 does this correctly. The rest implementations are just lazy and bad. I won’t go on and comment on their new brilliant display, neither the inclusion of a bunch of new sensors in the phone. And yes, I also know about the 3G video calling feature that many phones had from 4-5 years ago. But, have you ever tried video calling? *IF* it works, the quality is simply terrible. The video is continuously breaking and its low-res. Of course, iPhone 4 quality remains to be seen, but if it is the same as the one they showed in the presentation its going to be amazing. Nothing compared to what we ever seen before in a commercial phone.

Finally, the best thing about Apple, is when they deliver a new feature, it is actually working, the way it was supposed to be. It might not be as advanced as we would like (see the camera app, it just gained digital zoom in the latest iteration of the OS), but at least it works properly. To me, working according to specs is more important than breaking occasionaly and delivering “some more” advanced features.

Apple makes mistakes as well, everybody does. But that doesn’t stop their products from being awesome.

Design refresh

Saturday, May 1st, 2010

After almost 3 years from first publishing this version of my blog, I decided it needed a slight refresh. While the design hasn’t changed considerably, I made some big changes in the layout and the way I am organising the content. Most notably:

  • Ditched the sidebar: I found that it wasn’t serving any cause, other than obstructing the content. This was more obvious when I got the iPad, because of the smaller screen.

  • Upgraded photo space: Instead of cramming the photos on the sidebar, I moved them into a more prominent space, just below the header. For the integration and presentation I used a slightly modified version of FlickrAPI to fetch my photostream from Flickr and JQuery/Lightbox for the nifty popup. I also got rid of the FAlbum, nobody used those sections of the blog; better to redirect everyone to flickr instead.
  • More elaborate categorisation: On the older version I used just three categories: life, work and university. While I thought that they would be sufficient, I found them quite restrictive, however, I do like the simplicity. So instead I changed the titles to me, us and extras, keeping the 3 main category simplicity, but introducing subcategories. More information about categories can be found here.
  • Stronger integration with Social Networks: Since everyone uses them nowadays (well almost everyone), I moved my LastFM and Twitter streams into a bigger space, just below the blog post. Since my Twitter/LastFM are more often updated than this blog, they deserve the extra space. Additionally, I make use of the new Facebook API to introduce the “Like” button just below every blog-post. I am still kinda skeptical about that, we’ll see how it goes.
  • Typography: I switch the blog font to Georgia, it simply looks better!

Hope you like it!

Taking on the iPad

Thursday, January 28th, 2010

The Magical iPad

Yesterday Apple announced their latest creation: the iPad. It is a revolutionary multi-touch tablet, running the 75-Million-users-famous iPhone OS. However, the press was not so welcoming with the announcement, and this makes me wonder why. I do not want to sound like an Apple fan-boy now, but I want to take a look at the facts before judging the device too cruelly.

First, lets take a good look at the specs, and see what Apple has achieved here:

  • Size: 242.8mm X 189.7mm X 13.4 X — Incredibly thin. Try comparing this with equivalent Tablet offerings or netbooks.
  • Display: 9.7-inch (diagonal) LED-backlit glossy widescreen Multi-Touch display with IPS technology. IPS means greater viewing angle and the LED means more vibrant colours and brighter display at lower energy costs. We all know what multi-touch is, right?
  • CPU: 1GHz Apple A4 custom-designed System on a Chip Processor. Another breakthrough: when a company designs the software for its own processor, you can expect marvels when it comes to performance, optimisation and energy savings. How fast this is, and how it compares with Intel Atom it waits to be seen.
  • Storage: 16-64GB SSD Drives. By far exceeding in capacity the equivalent offerings in the netbook area. SSD comes expensive tho.
  • Connectivity: WiFi (802.11n), Bluetooth (2.1+EDR), and 3G (optional). Digital Compass and Assisted GPS (only on 3G models).

All of the above are packed in a very slick, thin, light, aluminium package. Don’t even get me started how bulky and ugly the existing tablets or netbooks are. Its also backed with iPhone OS, which has made miracles on the phone marked and revolutionised the cell-phone industry. Take a moment and think what was before the iPhone. Nothing exciting eh? The iPhone platform revolutionised mobile User Interfaces, and even with its shortcomings as a device, it is still the best you can get in terms of mobile web browser, media player and the vast library of applications.

Now, imagine having almost twice as much the processing power of the iPhone in a 9.7 inch tablet. Imagine the possibilities with multi-touch applications. When developers get the hang of the new Software Development Kit, I promise you that we are going to see some AMAZING applications. Also, lets not forget the price: 499$ for the 16GB wifi model.

Of course, Apple demos of the new iPad weren’t so polished. To me, iPad now is something like the 1st gen iPhone when it was introduced. A brand new platform seeking for acceptance, so it can give it a push for later. If you recall, the 1st gen iPhone had no 3G connectivity, no AppStore, no iTunes store, no nothing. Just the stock applications. Now Apple made a head-start with these applications, but the OS is still lacking behind: no multi-tasking support, the welcome screen seems kinda, no flash support empty and so on. But lets not forget that we are talking about a device that has not yet seen the face of the earth, we’ve just seen it on a demo. And I am positive that Apple is going to push an OS upgrade for these devices to make as much from it as possible.

However, the press was really harsh to device. It reminds me the post we saw on Slashdot a few years ago: Apple Releases lame iPod. Aw really? What is the dominant portable music platform now, eh Slashdot, with 250m units sold? Apple is the victim of the rumours that are created around “expected” devices. Their mysticism around new product in these cases comes like a boomerang, as people start speculating about new product announces and they expect something extraordinary. Well, reality check people: Apple is a company like any other. They can not build the perfect product, but they do their best to get one thats innovative enough out there. This does not mean that every thing thats being distributed as a rumour must be a part of the final product — so guys, please, do not get disappointed if “teleport support” has not made into the iPad. This is plain stupid.

What I really like about Apple is that normally they don’t get a product out that doesn’t just works. However, this means that sometimes they drop out features that 10-15% of the users out there might find useful, such as generic USB support or an OLED display. Also, lets not forget that Apple is a company, not the messiah, and they want to make money. Of course they are going to release an OLED version later on, or one with a Camera: but not before they make some money and cover some R&D costs before they do that.

To sum up, I think the problem here is that the rumours were transformed into a real product, even before the product was announced by Apple — hence, many of the reporters were disappointed by the fact much of the rumours did not make it into the real product. If you take the device and compare it with the rest of offerings in the same space, you will then see the amount of technology and innovation that they put in. Well, OK, yes its a large iPhone, but then again its much more.

I am sure that iPad will be a great success, and it will, in fact, revolutionise the way we interact with computers, not instantly, but it will sure have a great impact. For now, I’ll have to be patient another 60-90 days to get my hands on it!

The anatomy of the Cypriot Enterprise

Monday, January 18th, 2010

Having worked in several Cypriot businesses during the past few years, I came to notice a few unusual things happening. This post is a semi-humorous approach to talk about these issues using fake examples, without reference to real persons, facts or companies. Any similarities are purely coincidental.

First of all, when someone in Cyprus decides to start a business, they just do it (like the Nike motto). No market study, no business plan, no budgeting, no sales analysis and prediction. Nothing. You just go write a company in the registry and off you go. Of course, they don’t even hire expert people required to run these new business, they just assume that the people they already have onboard are suitable to run it — without any training whatsoever. “Ok lets just work for today, and tomorrow we’ll see”.

If you have lots of money to burn, and your idea is somewhat good enough, the business may have a partial success. It will start growing rapidly, in paces that you will not really control — since there is no business plan or structure within the company. Of course the management will go hire new “key” people, sufficiently ignoring the people who were already there. These new hot-shots (because in Cyprus whatever you say, you are) will try to enforce something they’ve learned in a business in a completely different sector (lets say they hired a new Sales manager in a Technology business who previously worked in dealing cars) in this new startup. Of course, as you’d expect, it will not work.

As the lack of clear vision still persists, you will commonly hear contradictory announcements throughout the year: “We will take over the market” and the next day “We are in negotiations for being sold”. Of course this not only destroys the morale of the people working for the company, it also pushes them to pursue other ventures, therefore they’ll start loosing employees. Someone with a business background will know that if an employee is good enough (i.e.: he/she does the work he/she is supposed to be doing), you don’t risk driving him away, as the replacement might not come as soon as you need it and on top of that you’ll have the extra cost of training. Keeping a good employee is a must. Well, not in Cypriot businesses. In their minds this will get translated into this: “No worries, we’ll hire someone new with half the salary! He’ll learn the business in no time!”.

If of course your business is souvlakia-making (barbecuing), this would be very easy and straight forward (although I am sure, every trade has its secrets). However, if you are in a business that requires expertise, training and know-how, this is not easy at all. Getting someone up to speed especially in dynamic, pressuring and understaffed environment is extremely difficult. Not anyone can handle this. And if you happen to become an expert in a field, instead of being a company-asset, you magically become a liability. Why? Because you want a raise, your salary is high, and your managers say that your job is relatively easy: Hey, you just type a few commands here and there, why should we pay you?

When a new employee is hired (if you manage to justify it, because you just type some commands in a terminal), there is no training. The management expects you to train the newbie and transfer all the knowledge you gathered the past X years working in the company, or from the numerous manuals you’ve read in a weeks time. Dude, first of all, I AM NOT A TEACHER, and secondly HOW ON EARTH you expect that to happen in a week? Working for the company is already hard, but you get on new duties that involve teaching and training as well, because the management can not spare any money for training — Why pay for that when we have a manual?

In the progress of getting a business plan, at the end of the year they ask the department heads to submit a budget. They don’t give them any information or targets, just the command “submit budget”. A simple question pops in your head instantly: “How am I going to prepare a budget if I do not know what I am budgeting for?”. Questions like “What’s your expected growth?”, “What are your targets of the year?” and “How much is the budget?” do not matter in Cyprus. You just have to prepare a budget, and if the management disapproves it, its your fault: why did you put so much stuff on it anyway? Budgeting in the real business world means projecting expected sales — How much money am I expecting to make in 2010? How much new customers will I take on? And from there, in a waterfall model, should fall into supporting departments: how much money you need to support this growth? But of course, what do I know, I am not a manager!

If you take a look at an organisational chart of a Cypriot company, half of the people will have the word “manager” in it. Everyone in Cyprus is a manager of some sort, even if there is no one left to do the real work. Everyone is an expert in something, and they don’t really consult their fellow coworkers because there is a growing envy between them: who is going to talk first to the Managing Director with a cool idea, because he has all the money and power and we must be friends with him. Of course, the issue with money & power is a society one, it just gets reflected in the company, but it is always funny to see people running around other people like faithful dogs.

Every request someone has in a Cypriot company is a high-priority one: if someone is dying but somebody else broke his hand, you should stop treating the dying man and go treat the one with the hand. Especially if the one commanded you to it is a manager, it overwrites all your existing work and priorities. And of course, you can’t say no, because then you’ll be under-utilised and ineffective. Naturally, this keeps happening even if a department ends up with 50 pending issues but nothing closed because of this priority and focus shifting, enforced by the all-knowing managers of the company.

After finishing this post, I think I understand why over 50% of the Cypriot population works for the government, they are fed up with all of the above!

New hosting place

Monday, November 23rd, 2009

I’ve changed the web host of my blog. I’ve switched from a shared-hosting server I had with some friends to my own private web server. Since I have the privilege of having a dedicated fiber connection to my home at Cyprus from Cablenet, I used my unused Mac Mini Core 2 Duo as server. Mac OS X is already a server-grade Operating System, no issues there.

Mac Mini is actually a good candidate for a personal server. It is fast, silent, and power-efficient (just 110W, according to Apple). I currently run MySQL/Apache/PHP (AMP Server). It currently hosts my blog and a private wiki/blog/calendar as a database of organizing all my PhD-related information.

Aw, it also keeps automatic backups, thanks to Time Machine.

Getting touchy with Apple’s Magic Mouse

Friday, November 6th, 2009

Magic Mouse on my Desk

I ordered the new Magic Mouse as soon as they announced it. I was longing to replace my broken Mighty Mouse (the wheel got too dirty it stopped working, and yes I tried the paper cleaning). It arrived yesterday in a cute little box (with batteries included!).

The normal pairing procedure worked out of the box, nothing fancy here (that’s what I love about Apple), and a new “Mouse” icon appears in your System Preferences panel. The big difference with the rest of the mouse out there is that there are no buttons. The whole mouse is a big touch surface. This might sound confusing, but its not a first with apple (Mighty mouse also had touch left/right click).

First of all, I liked the footprint of the mouse, its small and relatively thin, so you can carry it around easily. I have really big hands, yet it fits alright in my palm. The right/left click works as you expect: you click the left-side its left-click, you click the right-side its right click. Now, here comes the fun part: scrolling! When you keep your finger in the mouse surface and move it around, its scrolls 360 degrees with you. It replaces that small ball the Mighty mouse had (which was good, but a pain in the ass as it got dirty), with much bigger space to move your finger. The whole movement comes really natural, and you get used to it right away. No learning curve at all.

I also liked the “two-fingers swipe” gesture. It gets handy when you are navigating through a multipage document and again its really comfortable to use, as your two fingers are always only mouse, as I again used to for expose (show desktop). However, I believe that therer are a lot of possibilities and options on what you can do with a multitouch mouse, so I guess Apple might introduce new gestures later on (eg. keep two fingers pressed for a second for expose or something), or even do a twirl for refreshing a page in a browser. The possibilities are endless. I really hope that Apple opens up the API for this mouse, so developers can create gestures for their applications or listen to events generated by the mouse.

Overall, I am really pleased with it. It fits well with my Apple wireless keyboard. The only negative point is the price: 55 GBP for a mouse is a lot.