Compiling DOCSIS utility for Linux

DOCSIS is a small utility used for compiling binary configuration files for DOCSIS-compliant Cable modems. While this has no use to the average user, it takes some skill to get it compiled under Linux.

The actual utility source-code is available from the project’s website here: http://docsis.sourceforge.net/. Before trying to compile, make sure you have the following packages installed in your system, because it won’t complain during the ‘./configure’ stage:

bison, flex, libfl-dev, libsnmp-dev

Under Ubuntu just install via apt-get:

sudo apt-get install build-essential bison flex libfl-dev libsnmp-dev

And then proceed with the usual:

./configure

make

sudo make install

That’s it!

The tales of a (lucky) traveller

I was scheduled to fly out of Manchester Airport on the 18th of December with the Cyprus Airways flight CY 507 to Paphos. The flight was scheduled for 11:10 AM, BST.

Being on time is crucial for this flight. Being just 15 minutes late, the queue fills up with students carrying 10 suitcases each, causing a menace in the check-in desk. So I woke up at 6, adjusting for the not so favorable weather conditions. The previous night was snowing quite heavily.

I opted to drive to the Airport, as I figured trains would have significant delays I cannot directly control due to the strange weather conditions. The roads were clean enough, however, the salt on the road in combination with light rain sometimes made it difficult to drive behind trucks. As the 3rd lane of the highway was still closed from the snow, overtaking was kinda tricky, but we survived that.

On my way to the airport, I was listening to BBC Manchester for any road incidents updates. The reporter said that the M6 highway was closed from Junction 30, and passengers had to sleep in their cars during the night. Apparently the heavy snow made it impossible for them to move, and they’ve got stranded in their cars. Hopefully, my exit was just 2 miles before this whole mess. The remainder of the car journey was mostly uneventful, with just a bit of snow on the way. Of course, caution was advised, as the roads were still icy and couldn’t drive with more than 50-60 mph. My luck has just started working its thing.

At the airport terminal was already a mess. Huge queues, long delays. I used my executive club membership to bypass the queues for my flight, so I just spent less than 20 minutes waiting for check-in. However, I still witnessed the stupidness of Cypriots, trying to carry their whole wardrobe back to Cyprus. Not only that, they are unforgivably rude about that as well. But thats a subject of another blog post.

After purchasing some last-minute gifts, I headed for the gate. Just minutes before the previous flight coming from Cyprus, the airport closed for incoming flights due to bad weather. It snowed for 15-20 minutes, enough to divert 2 inbound flights to neighbouring airports. Luckily, the Cyprus Airways flight just made it through!

Before boarding time, it started snowing heavily again. The airport personell told us that if this continuously for another 20-30 minutes, the flight would be cancelled. And when she said that, it just stopped snowing.

When it was time to board, the lady first called the back rows. A few smart-pants Cypriots, sitting in the front rows, tried to board the plain. The airport personell told them 3 times to back-off and let passengers sitting at the back go onboard first. Of course, demonstrating our national stupidity, they did not comply, forcing her to tell them “You are boarding the plane last”. And she did not let them to board the plane, until everyone else was boarded. Funny and childish, but I guess it pissed them off to the necessary degree.

Just after sitting in the plane, the pilot announced that due to delays in the airport, 40 of the passengers did not make it in time through security, and we had to wait for them. It took them about an hour to get back in the plane. However, waiting for an hour for them to get to the gate, meant that the plane has frozen in the sub-zero temperatures. We had to wait for the airport personnel to spray anti-freeze on the plane, so it can take-off.

We had to wait for over 2 hours for the crew to spray our plane, and the waiting time was killing us. It could start snowing again while we were waiting, or for the crew to run-over their allowed work time. As IATA forces a limit on how much time a crew can work, and we were rapidly closing that limit.

Hopefully, we got sprayed, and we were on our way back home. After a 3-hour delay, we were on our way.

About half an hour before the plane was to land to Paphos airport, the captain made an announcement that the plane would instead land to Larnaca airport. The reason was because too many planes of Cyprus Airways were trapped in foreign airports due to adverse weather conditions, and they needed the plane in Larnaca for the next flight to go on.

Some Paphians tried to take-over the plane, yelling and making a fuss about the development, and blaming the captain. Once again, the Cypriot spirit was flourishing, when everyone should be thanking the crew for not just saying “we are not flying, our hours are up”. During the panic, I also heard some lovely questions from some of the passengers: “Would our bags go to Paphos or to Larnaca?”. Aw well. For me landing in Larnaca meant that I would save 1 hour more of driving, so it was a win-win situation.

The author would sincerely like to thank the Cyprus Airways crew on that flight from Manchester for making everything possible to get us back home safely. This means one thing for Cyprus Airways: the employees are doing their best to keep the company going – its the politically-driven management that messes things up badly.

nginx and WordPress

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

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!

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

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

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.

On motivation

Recent events made me think what is motivating me. Well of course the answer is not straight forward. There are a lot of factors, and these factors tend to change as you get older or as situations change in your life. But still, of course, there are some things deeply embedded in your character that will be always there and keep pushing forward no matter what.

First you start off with simple things. You want to be a good boy, make your parents love you, etc. I think thats the first stage, a stage that everybody goes by. And then you “evolve” into what psychologist call “reinforcement”, which can be either positive or negative. You are motivated to do (or not do) something by either rewards or a negative impact. I can remember a few occasions when growing up that this was a crucial part of my everyday thinking. Leveraging the pros and cons of doing or not doing things and picking the best possible route for myself. Also at times you are also being motivated at impressing others, namely girls (hey, there’s no shame in that. You all did it!) or your peers, but thats really not a good idea.

As you form a character of your own, with influences from your environment, fictional characters, celebrities and myths however, the above motivational schemes cease to exist, or their importance gets denominated over time. You form your own interests, you set your own targets in live and you stop caring about taking good grades in Art or Geography at school.

Unfortunately, we don’t get the change to do that many things in life. Because life is brief, and then you die. And the things you choose to do, should be really excellent. Once I realised that, during mid high-school, I understood that I must set the targets in my life no matter what repercussions they might carry and what other people think of them. That includes my parents as well.

Knowing the above, it motivates you to excel at the things you have chosen to do. You set targets, levels, acceptable parameters. Whatever you chose to do with your life, it better be damn good, and it’d better worth it. This is what pushed me forward back in school, what pushed me out of the army days, what pushed me though my University degree. What is currently pushing me during my PhD and working at the same time (at Cablenet).

Another thing, that always bothered me is that people tend to compare your achievements with others. Sometimes you’re ahead, sometimes you’re behind. Motivation is really bad when it comes from jealousy. Why worry about others? Worrying is as effective as trying to solve an algebra equation by chewing bubblegum. The race is long, and at the end is only with yourself. Not with your colleagues, not with your friends. Your own personal goals, aspirations and targets should be the criteria for yourself. Of course, that said, whatever you do don’t congratulate yourself too much and don’t berate yourself either.

And a motivational, cheesy quote (which I think its quite nice) for closing up:

“Impossible is just a big word thrown around by small men who find it easier to live the world they’ve been given than to explore the power they have to change it. Impossible is not a fact. It’s an opinion. Impossible is not a declaration. It’s a dare. Impossible is potential. Impossible is temporary. Impossible is nothing.”

– Muhammad Ali

Design refresh

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!

Engineers vs. The World

After spending almost 4 years in the UK now, I came to notice how much unappreciated is technical knowledge is in Cyprus. Watching the following short commercial from OTE, it made me realise the gap even more.

First of all, the salaries in Cyprus for Engineers of all sorts start from 1300-1400E (BSc. degree award or equivalent) vs. 2000+GBP in the UK (even more if your work-place is in a big place like London). If you compare this salary to a sales person for example, which requires no degree whatsoever, the difference is simply remarkable. It is true, that he who sucks up goes forward in Cyprus, and we, geeks, possess no such skill, so we are doomed to stay forever at the base of the pyramid.

In Cyprus, my dear reader, nobody cares about the person who is sweating to get the work done. In Cyprus always takes the credit the one that manages to sell your product that you’ve build. The management doesn’t care how much effort you’ve put in (hence, no engineer is awarded a bonus when the network is rock-solid, but sales people are awarded a bonus on top of their fat salary if they manage to sell a part of it), as long as its working and we can sell it. I am not saying that a sales person isn’t putting effort to sell something, but at the end of the day if your product receives enough marketing exposure and it is better quality and competitive priced against the competition it practically sells itself. However, if you don’t have capable engineers, people to make the best out of the budget you assign to them, people to make a living network out of a bunch of fibre patch-cords and life-less switches and routers you can’t sell anything. And if you can’t maintain it, you’ll end up loosing everything you’ve sold.

Your knowledge goes completely unappreciated. If you don’t work to build something from the bottom up, but you enjoy the end result, you just take it for granted. Who cares about the engineers that constructed the plane I am on? (But you always remember them when something goes wrong). Its like you’ve been given the knowledge to build networks, to build planes and cars, to program computers from birth. Its no lie that you have to spend a considerable portion of the best years of your life studying hard to begin scratching the surface of the science you love. Its no lie that you have to spend years studying, reading, understanding, practicing before you fully understand the complexities hidden under the hood of your car’s engine or whats going on on the other end of your computer monitor, deep inside a complex and nested computer network. It might take 1 hour and a few words in a terminal to solve your problem and it seems simple, but to get to that point you need years of hard-work. But when something goes wrong, then you magically become the king of the world. You become the centre of the universe, and they remember where your office is. Please, enough of the irony.

And lets face it, engineering is not for everyone. Not everyone can handle pressure, deadlines, an upset customer, the risk of a decision, the skill of troubleshooting and the skill of making a computer understand him. As an anonymous cleverly put it:

There are 10 types of people, those who understand binary, and those who don’t

Please, take a moment and try to imagine you, living in a world without engineers. Without technology and innovation. Start thinking what you would do without electricity, your car, planes, internet, computers, mobile phones, houses and bridges. Your dependancy on engineers can not be hidden, and lets face it, they make YOUR WORLD TICK.

Dear reader, don’t get me wrong. We are not doing it for money or fame. We are engineers because we like challenges. We are engineers because we enjoy lifting the world on our shoulders and push it forward, even if we end up being the invisible force that magically does it for the rest of you. We are engineers and we won’t tolerate any more abuse, verbal or otherwise. We are engineers because knowledge is power.

Disclaimer: The above post has no relation with any real person or work environment.

PS: There is no place like ::1