Monday, June 22, 2009

Microsoft ClearType

I had mixed feelings about ClearType on XP - it seemed to be an addon that didn't achieve much. In Vista I didn't realise until recently that it is a default part of the OS and actually without it stuff looks weird. The system fonts seem to go bold, but making them bold/unbold doesn't make much difference.

In fact this change is the source of a number of forum posts akin to 'my fonts have gone bold, help!'. I myself spent a long time searching for a solution to this 'problem' - last time it occurred I ended up re creating my user account from scratch! I'm not sure why or how but this time it occurred to me to look up ClearType - I guess I saw it on one of the forums that discusses the issue.

I still have no idea what actually causes the change to happen but here's how to undo it:
  1. Open the control panel set called Personalization (right click on the desktop > Personalization)
  2. Click 'Window Color and Appearance' then 'Open classic appearance properties for more color options' which is at the bottom
  3. In the new dialogue box click 'Effects'
  4. In the next new dialogue box tick 'Use the following method to smooth edges of screen fonts' and set the drop-down to be 'ClearType'
  5. Click OK on both dialogue boxes to close them, applying the changes

Sunday, June 7, 2009

WinXP on netbooks

So Microsoft are again dictating to hardware manufacturers what they can and cannot use in their products if they want to have Windows XP on them. It doesn't matter if this decision is later reversed, or the story is true or not as it should never have been considered. (this goes for any company, in any market, that tries to restrict others in a similar fashion too).

The restrictions on what hardware you can use to run certain products should be purely technical ones. Just imagine if you bought a DVD or Blu-ray player only to find that it didn't work with your TV not because you needed some connector you didn't have but because it was too big! You'd be furious right?

Thankfully this situation will improved when Windows 7 gets released, but even that OS has restrictions if you use the very lowest end licence version.

The other issue here is that these limits do affect people who buy the non-Windows versions as these machines probably have the same hardware as their Windows counterparts, just a different OS installed.

Wednesday, April 29, 2009

Automatically mounting drives in Ubuntu

I know there's a number of guides out there that show you how to do this, but I always seem to end up combining a number of them to actually get what I want. What I want is the drive to be mounted once I'm logged in (I don't really care when, so long as it's instantly usable).

Here's how I do it

  1. Use sudo blkid to get info about the drive you want to be mounted.

  2. Make the folder that it's going to be mounted in. I normally put a folder in /media/ which has the same name as the drive. This keeps things simple and won't break any symlinks already in place. You do, however, need to unmount the drive first, and of course to make a new folder in /media you'll need to either be root or use sudo.

    I usually do this with:

    sudo mkdir /media/Data

  3. Edit /etc/fstab (you'll need to be sudo) to add the following lines:

    UUID=$DRIVE-ID $FOLDER $TYPE defaults,umask=000 0 0

    This line specifies where to find the drive where to mount it and how. You need to replace $DRIVE-ID with the UUID number for the drive you got from blkid, replace $FOLDER with the full path to the folder you want the drive to be mounted in and $TYPE with the type of filesystem used on the drive, which you can also get from blkid.

    I usually add a comment line, so I know what's happening, then this becomes:

    # /dev/sda5 - Data
    UUID=4820-8D15 /media/Data vfat defaults,umask=000 0 0

That's it. Now whenever you start Ubuntu your drive will already be mounted. If you want to mount it now without rebooting then you can tell Ubuntu to mount everything in the fstab now by using:

mount -a

Wednesday, April 15, 2009

Opening files via WINE in Ubuntu

As a windows user I enjoyed the power of Notepad2 (a lightweight yet powerful notepad replacement), and while the features of gedit are useful they're not what I'm useful. Indeed a number of what I would regard as essential features are in a secondary plugin set that you have to track down in the repos (gedit-plugins), hence I wanted to use Notepad2 in Ubuntu. Thankfully Notepad2 worked immediately under WINE, removing any troubles that I might have incurred there, though I still needed a way to directly open files into the program, preferably via a simple double click.

I investigated using a custom wine command, with a number of various symbols after the path to Notepad2, searching for the one that would pass the filename in a manner that it could understand, but without much luck. Google, however, had some answers and I found this post.

The solution is to call a small bash script which then generates a link file within WINE which points to the file you want. This works fine except that the program inside WINE doesn't get to see the original filename (this isn't a problem when saving, but is annoying when using programs that display the filename in the title bar and elsewhere). To resole this I made a couple of changes to the script such that the link file uses the name of the original file, rather than a pre-defined static one, these mods are in my reply to that thread.

Wednesday, March 25, 2009

Using network computer names on a local network in Ubuntu Linux

This is something that works straight off in Windows, yet I just spent a while struggling with it in Ubuntu.

The solution is remarkably simple:

If the other computer is running windows and you can't ping it using its NT network name (and you'd like to) then you might need winbind, or to add wins to your /etc/nsswitch.conf file. Here is the guide I followed.

If the other computer is running Ubuntu then you might need to add .local to the computer's name - if the remote computer is called mydesktop then mydesktop.local or mydesktop.home is probably the network name you need, depending on how your router is setup. This is known as Zero configuration networking.

Getting Apache working in Ubuntu Linux

Ever since finding I could put stuff, any stuff, on the Internet, simply by putting it in a certain directory in my university file space and tweaking some permissions, I've been interested in playing with web things (more detail is on my website). More recently I found I needed a local testing server as uploading stuff only to find it didn't work got very tedious. As a windows user I grabbed XAMPP, which is great - you get a nice installer and a small GUI that turns it on and off, but you do get introduced to having to edit config files manually (I used notepad2 for this).

Eventually I found I needed to repeat this in Ubuntu which, for those who don't know, is a distribution of Linux (you really should give it a go!). However for Linux I found a plethora of guides on how to get apache up and running, but they only answered some of my questions, so I'm having a go partly so I can remember what I found works!

To install you'll want to grab the following packages from the repo manager (Synaptic in Ubuntu):
apache2
This is the main package for the webserver, and the only essential one, dependencies should be taken care of automatically

php5
PHP enable your server to dynamically change the pages that it serves (At the time of writing PHP5 is the most current, but PHP6 is due out soon)

mysql
MySQL is a database query language and this package enable you to host databases that you can use MySQL to grab data from

phpmyadmin
PHPMyAdmin is a tool written in PHP that enables easy MySQL database management

ssh
ssh enables you to remotely login to the host computer from another (ssh user@host from a terminal in linux or I use PuTTY from windows.

Once you have installed apache you should go ahead and set a name for the server (this is partly to get rid of an error message you get when you restart it). You'll need to add ServerName localhost to the apache.conf file. In Ubuntu this is /etc/apache2/apache2.conf, but in other linux distros it can be found elsewhere.

The default place for apache to look for files to serve is /var/www/html/ though I believe that you can change this by editing the configuration file (however I've never had cause to do so).

Some commands you'll probably find useful (these all need to be run as root or sudo):
apache2ctl restart
Restart the webserver - this needs to be done when you want a configuration change to take effect

a2enmod module
Enable an apache module whose name is module

a2dismod module
Disable an apache module whose name is module

Some modules you might find useful (use a2enmod, above):
UserDir
This module allows users to put stuff in a directory (public_html by default) within their home directory that they want to be served by the server at their user-url (/~username by default). See below for config details.

Proxy
Proxy another server, be this another local server or one from the net. See the apache Proxy documentation for more.
Proxy_http
This is the module that actually allows http proxying. It depends on the Proxy module.

I use the UserDir module as I find it simpler to edit stuff in my home directory rather than navigate to /var/www/html/. I use the Proxy module to aid development of a web application for Student Robotics which is written in python, using turbogears, and so has its own server built in.

Configuring the UserDir module:
In a httpd.conf file (/etc/apache2/httpd.conf in Ubuntu) you could have the following lines:
UserDir disabled
UserDir enabled sam

Which enables UserDir for the user called sam but no-one else. That is /~sam will serve files in /sam/home/public_html (provided persmissions are set appropriately), but /~anything-else won't work. See the apache UserDir documentation for more.