Archive for the ‘computer’ Category

Epoch countdown

Friday, February 13th, 2009

Epoch countdown

Terribly geeky, i know! Many modern computers count their time in the number of seconds since Unix Time, an epoch beginning on 1st January 1970.

In about 8 minutes it is going to reach 1,234,567,890 – something which i find oddly exciting! Keep up with it on coolepochcountdown.com

Update: GOT IT!!

My little ruby program recorded it for me!

Also, coolepochcountdown.com started doing fireworks and playing "Celebration" at 1234567890 o'clock! It was excellent!! :D

Also, there are many geeky celebrations on Flickr!

Apache tricks on Linux

Monday, January 26th, 2009

Most of my life is spent coding Ruby on Rails, but occasionally i venture into the world of PHP. When i do, i sometimes need to configure Apache because, unlike Rails, it does not happen automagically! To save myself always looking things up on the Internet, here is a little summary of the things i have learnt.

Don't do this!

When i very first started using Linux, i discovered that you could put files into /var/www and access them through http://localhost. This is a very bad idea because you don't have permissions to the /var directory (for good reason!) so i used to end up chmodding everything. Also, keeping anything outside your home directory is bad news because you're liable to forget to back it up before you do an upgrade! WHOOPS!

A perfectly good solution

The next thing i learnt was symlinking, or creating shortcuts. So you can set up a shortcut from the /var/www directory to an appropriate place in your home directory. For example:

sudo ln -s /home/aimee/websites /var/www/html

Now if i have a directory called mac2 under my websites directory i can go to http://localhost/html/mac2/index.php. Nice!

More advanced: VirtualHosts

Later on i started experimenting with Apache's RewriteRule and RewriteBase for nice 'pretty' URLs. You'll soon find out that the symlink method is no longer suitable because you're not using relative URLs anymore. It's time to learn about VirtualHosts, so that i can access my local files with a URL like http://mac2.aimee.

Apache2 keeps a list of available configurations under /etc/apache2/sites-available. I have one called aimee.conf because i am egotistical like that!

sudo vim /etc/apache2/sites-available/aimee.conf

It must start with this line:

NameVirtualHost 127.0.0.1

Then, for each site that i want, i add a VirtualHost like this:

<VirtualHost 127.0.0.1>
  ServerName mac2.aimee
  DocumentRoot /home/aimee/websites/mac2
  CustomLog /var/log/apache2/mac2.log combined
  DirectoryIndex index.php
</VirtualHost>

It really just needs to know where to find the source files. The log and directory index are not especially important. It's probably fairly obvious why i added them. There are plenty of other options you could use if you wanted to, but this is about all i use.

Next we need to enable the configuration. It's as simple as symlinking the file from the sites-available directory. You only need to do this once per .conf file (and i only use one for simplicity).

cd /etc/apache2/sites-enabled
sudo ln -s /etc/apache2/sites-available/aimee.conf .

The next step is to configure the hosts file such that when i type http://mac2.aimee into a browser it knows to look on my actual computer rather than on the Internet.

sudo vim /etc/hosts

I enter a line like this:

127.0.0.1       mac2.aimee

Finally, restart Apache and all should be very well!

sudo /etc/init.d/apache2 restart

The best of both worlds

If you want it both ways (and hey, why shouldn't you?!) it is quite simple to set up another VirtualHost for localhost. Just add it in like this:

<VirtualHost 127.0.0.1>
  ServerName localhost
  DocumentRoot /home/aimee/websites
</VirtualHost>

Restart Apache again and now the same site is accessible at both http://mac2.aimee and http://localhost/mac2/index.php.

Happy day! :)

Disclaimers

This is how i made it work on Ubuntu Linux in a development environment. Other operating systems may behave differently. I have no idea about setting up production servers!

If Apache is in a different place on your computer, you can find it like this:

whereis apache2

To find your hosts file:

locate hosts

I am not an Apache expert, so if you have any questions, chances are i can't answer them! Scroogle is your friend! :)

Windows 7 quick review

Sunday, January 11th, 2009

I installed Windows 7 Beta for a few reasons:

  1. Because it's free! (as in free beer)
  2. In order to test things under Windows and IE8
  3. To get SecondLife / OpenLife which are kinda dodgy on Linux
  4. Just for curiosity because all the reviews have been good

I think Microsoft have done a really good thing here, generating such an interest and making it available to as many people as want to try it. From the looks of things it's a good release both in looks and in functionality, and they should get a lot of great publicity that should lay the disastrous year of Vista to rest. Plus loads of free testing and feedback of course!

Fear not, i am still a great big Linux fan, and i will continue to use Ubuntu as my operating system of choice. But you know, if Windows 7 is really worth it, i might just cough up the money for the real thing when it comes out and the beta expires.

I followed the instructions here: How to dual-boot Vista with Linux (with Linux installed first) to create some space for Windows 7, install it to the new partition, and then fiddle with GRUB to make the two play nicely together. In fact they did not play together to start with. Windows 7 tried to hide Ubuntu, and then i fixed that, and Ubuntu refused to let Windows 7 have a turn. I got "BOOTMGR is missing" and had to run the Windows 7 fix program on the DVD twice before it came back to life.

Anyway, i got it working now and there are some pretty cool things that have impressed me. This is not going to be a full review; that has already been done by plenty of other people … but here are some snapshots of my experience.

I was delighted to see that it comes with a "United Kingdom" theme, possibly because i entered United Kingdom as my location. How very thoughtful and welcoming! The background changes every 30 minutes with nice scenes from around the UK.

QUICK! Find Antivirus!

The "important message" is Windows 7 anxiously urging me to install a virus checker. Welcome back to the world of insecure operating systems, hah! I have installed the Kaspersky preview for Windows 7 which annoys me with popups every time i try to do anything. Rubbish, hey!

My first piece of feedback to Microsoft, if i could be bothered to give it … the Start button has a spiky highlight. It looks a little bit threatening, to me.

Spiky Start button

Previews are pretty awesome, especially in Internet Explorer 8 where each tab becomes a separate preview. When you hover over the preview, the full-size image appears. It's neat!

Clever tab previews

The hover colours themselves are actually really stunning! It seems to take colours from the icon, and apply a beautiful glassy effect, for example the Firefox one is mostly orange:

Beautiful hover colours

The 'show desktop' now works both as a click and a hover.

Show desktop hover

I've already done that a couple of times tonight to have a check on the time and temperature. It's quite nice that a quick mouse gesture (to the bottom corner) can quickly minimize and bring back again. However, the gadgets are not always visible, which may be a glitch or maybe i've just not understood when they show and when they don't.

Finally, Second Life! I was initially disappointed because Second Life claimed that it didn't like the video card driver. So i went to Control Panel – Hardware and Sound – Device Manager, right-clicked on my Display adapter and requested an update. Windows 7 found a good one for me!

Second Life working under Windows 7

YAY! :D

Windows 7 – a second chance for Vista?

Thursday, January 1st, 2009

Please don't all freak out on me … but … i am thinking of trying out the Windows 7 beta.

I think it's fair to say that Windows Vista did not quite meet all the expectations that Microsoft had for it in 2008. The user account protection was annoying, the visual effects to me smacked of "tried too hard" and i think a lot of Windows XP users felt it wasn't different enough to be worth an upgrade. People took their new Vista computers back to "upgrade" to XP, Dell are selling computers with Ubuntu, and the netbooks available in the high street have pushed Linux further into public awareness than ever before.

Vista was late, but i think they released it too soon. I think Microsoft's reputation took a knock, but they have a chance to repair it. Windows 7 is pretty much Vista done properly, and from everything that i've read so far, it looks as if they've actually done quite well this time. So i'm going to try and get hold of the beta and have a go at dual booting it. It certainly won't be my primary operating system of choice, but it could be useful for running SecondLife and/or OpenLife and i will admit i'm curious to see for myself what it's like.

Rails on a netbook?

Friday, November 28th, 2008

I am here today to ask a question and then answer it. The question is: Can you run Ruby on Rails on a netbook? Specifically, an Acer Aspire One. My motivation is … since buying my netbook, i have completely fallen in love with it, and much prefer it to the desktop computer. I want to do as much as possible on the netbook. I don't think i'd spend a whole day coding on it, but just for quick little things it could be wonderful!

Now that MyChores is open source i really like this idea of code anywhere. Wherever i have my netbook and an internet connection, i can code! If there's an emergency bug needs fixing on MyChores, i could make the fix and push it. Or if i'm feeling lazy one Saturday morning there can surely be nothing better than a cup of coffee and coding in bed! ;)

So without further ado, let's see if you can put Rails on a netbook …

(more…)

I'm a free-thinker

Sunday, November 9th, 2008

I find it odd that Microsoft seem to be dedicating so much TV air time to their "I'm a PC" response advertisments to the Mac vs PC ads of a few years back. The odd thing is, i never remember seeing any of these ads on television. And i would remember because they were done by Mitchell and Webb in the UK. I've only seen them on Youtube when browsing for amusement's sake. I reckon there could be plenty of people who are completely bemused by all these people saying, "I'm a PC" when they have never seen the original ads for reference. Maybe Microsoft will awaken people up to the realisation that actually, Windows is not the only option.

Here's one of the Mitchell and Webb ads: The Naughty Step.

I actually thought it was illegal to make direct comparisons between your product and a direct competitor's product in an advertising campaign, so i don't know how Apple got away with this whole series of advertisements.

Somebody should do an ad called "I'm a free-thinker!" I haven't sold my soul to Microsoft or to Apple. I don't owe anybody any money. I just owe a debt of gratitude to thousands of volunteers who willing donated their time, knowledge and expertise to create the world's best, most secure, most reliable, most flexible, freely available, freely modifiable and freely redistributable operating system.

Actually, IBM did a Linux ad, ages ago. Linux: The Future is Open. Has anyone done anything like that since?

At my parents' home

Friday, October 31st, 2008

Just a quick post to say, hello, and celebrate the fact that i'm on my netbook at my parents' home! :)

Predictably, they didn't know the password for the wireless internet. I thought it would be written down on a piece of paper somewhere, but no, it's worse than that … only my uncle in Yorkshire knows the password! Happily i managed to poach a network cable and use that. It's nice to have my own machine, with my email and calendar, and internet preferences and keyboard and everything just the way i like it! :)

This has been a tough week at work, and i was feeling rather overwhelmed yesterday, but several things all came together nicely today. It was a good day. I'm also very happy and relieved to say that my brother, who has been very ill for some time, is significantly better now.

I'm going to bed in a minute … i've been given some Nytol sleeping tablets which will hopefully help me to sleep better. I've had a lot of nightmares and sleepwalking lately. I can feel the tablets kick in as i type this (or maybe that's just psychological?!) … i think this is going to be a nice relaxing weekend.

My glorious netbook!

Thursday, October 16th, 2008

I must say, this is one of the best impulse buys i have ever made! I am at my aunt and uncle's house, connected on their wifi. It is so nice to have my own computer, with all my settings, and my email and calendar, just ready to take around with me wherever i go. It picks up wireless networks effortlessly.

I had a nice evening with my cousins, playing with their gogos and reading stories. My plan for the rest of the evening is to write a few blog posts, watch Heroes on the iPlayer, and maybe read a bit of "The Pragmatic Programmer" which i'm intending to finish by the end of the month.

Church was quite fun on Sunday. There was over an hour of singing and worship at the beginning – wonderful for me! :D It felt good to be in an environment where i could contemplate God much more than i have done for a long time. I had a nice chat with a few people, and i was impressed by how many people there were of all ages – loads of kids, some young people, teenagers, young parents, middle aged and elderly people. There was also a nice diversity of nationalities represented there … though about half of them are South African! :)

I even went to a home group last night. It was convenient – just across the road from me. If nothing else, it feels good to be getting to know a few more people locally. They were friendly and tolerated my questions. They answered from their hearts, thinking about what was true for them, rather than giving me any standard drilled-in "Christian" answers. I admire that. I shall probably go again, both to the church and to the homegroup. It seems a good time in my life to be getting involved with a church again. Whether or not i will call myself a Christian remains to be seen. I might just be an agnostic who goes to church!

The thing that got me was this: okay so maybe there are many routes to God. Maybe every religion has something to offer. But that doesn't mean i shouldn't follow any religion. If i find one religion particularly beneficial, by all means i should follow it. I like many aspects of many religions, but after all, Christianity still feels the most comfortable to me, since it's what i'm used to. Yes, i have my problems with a few of its followers – the ones with the more extreme beliefs – but in its essence, Christianity itself is not such a bad religion.

And then i thought – What if it's all true? Obviously i can't make myself believe something, but maybe if i hang around with these people for a while, if i go to church and take part in the worship and the customs … perhaps i'll learn to lose some of my doubts, and let it sink in a bit. Maybe then it will become true for me personally, and maybe i'll find my peace with God. We'll see.

Oh very good!!

Sunday, October 12th, 2008

You know what – church was alright! :) The music was good, the people were friendly-but-not-too-pushy. Most of them seem to be from South Africa, heh! :) I might talk a little more about the church experience later … but for now …

My 'reward' for going to church, hahaha!

My gorgeous new Acer netbook

I love it!! I am sitting in the living room right now, connected to the wireless network, surfing the internet. It's easy to type on, especially now i switched the keyboard layout to Dvorak. I'm glad i thought to buy a little mouse because i don't get on too well with trackpads. I have enabled the XFCE advanced settings, downloaded Firefox 3, installed the Gimp … all is very, very good! :)

It is so cool how i can just take the SD card out of the camera, slot it into the Acer and it reads the pictures straight away, no fuss. Delightful! :)

It has a web cam, which may mean i can do Skype video calls. That would be cool! As a machine it works very nicely, makes a very faint hum, the screen is bright and clear, and the keyboard is perfectly responsive. The Linpus Linux it comes with is perfectly useable. I might be tempted to switch to Ubuntu, but i know this is designed to be fast and energy efficient, so i think i'll stick with it for now. I managed to get rid of the XP-imitation title bar buttons, so i'm happy! :)

Aspirations

Sunday, October 12th, 2008

Two exciting things might happen today. One, i might go to church, if i don't chicken out! I just feel like i want to. So i will! I can always leave if they start trying to pull any funny business on me.

Two, i might buy one of these little beauties:

Acer Aspire One A110 Acer Aspire One A110

Acer Aspire One A110. It's a gorgeous, tiny little netbook, comes with a special lightweight, fast response, low power consumption version of Linux, plus Firefox, OpenOffice and a chat utility. It's big strength (as far as i'm concerned) is the ability to find and use wireless networks. Useful for travelling! We have wireless at home now but i haven't yet managed to make my computer recognise it.

I feel this would be a perfect solution to when i come home at night and just want to check emails and browse the Internet a little bit. It's a waste of electricity to turn on the big computer and leave it on all evening. It would be great to have one of these that i can use from the living room, just turn it on briefly when i want it.

All reviews are very good – display is good, keyboard is a good size, it's very quiet, style-wise it looks awesome! The only negative point anyone had to say was the battery life is only 3 hours. But that sounds sufficient for me. I had a go on one in town yesterday and i was impressed. I love the idea of taking it away with me, using it on the train, and at my parents house.

I was initally attracted to the Eee PC, which was great in its day – cheap, fast, light, portable. But competition is a wonderful thing. The Eee PC burst their own bubble by releasing a much better version but pricing it much higher. As soon as i saw the 900 series i no longer wanted a 700, but i didn't feel the price justified the larger screen.

I have also been tempted by the Advent 4211, but after i had a go on it, i found that two of the keys were too close together. Plus it's Windows by default. The most exciting thing about the Eee PC initally was that it came with Linux. So does the Acer Aspire! :)

At £199 i definitely think this is worth the money. Okay, i could get it on Amazon for £4 cheaper … but i think i might just spend that extra £4 and get it today! :) So long as they have the seashell white … then it satisfies my mac envy too! :D

In my mind, these events have become strongly linked. Go to church, then buy an Acer Aspire A110. Well – there's motivation for me!

who-am-i
A web programmer in my late-late-twenties, fanatical about open source, free software, loving my job working daily with Ruby on Rails, RSpec, Cucumber and Git.

I am very proud to have created MyChores.co.uk, an online team based tracking system for household chores and other recurring tasks.
Search



Flickr