Subscribe RSS

Archive for March, 2009

Linux terminal tty resolution Mar 27

babe_wayhayWith a lot of linux distributions the default tty resolution will work with almost all old hardware. You may have noticed that this compatible (default) resolution is klunky and not particularly useful when trying to view large amounts of data. It is infact possible to change the resolution to anything as high as 1280×1024. This is a feature of the linux kernel that can be set at boot time. First look at the table below

Colour Depth 640×480 800×600 1024×768 1280×1024
8 (256) 769 771 773 775
15 (32k) 784 787 790 793
16 (65k) 785 788 791 794
24 (16M) 786 789 792 795

This table enables you to choose your tty resolution and colour depth and you are left with a number e.g. 1024×768 16bit = 791.

This number now needs to be put in to the line of your bootloader where the kernel is loaded. (/boot/grub/menu.lst) I have only ever used grub but im sure it will work with lilo and other boot loaders.

Look for the line like:
kernel       /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 ro quiet

and add vga=791 so the line looks like this:
kernel       /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 ro quiet vga=791

Now reboot the machine and the tty resolution will be what you set.

Category: Linux  | Tags: , , , ,  | Leave a Comment
Javascript Calendar Mar 11

Our software forces a mime type of application/xhtml. Unfortunately this seems to break 99% of the libraries. However this one looks pretty damned good. Its nicely done, seemingly multi-browser compatable, and well, just does the job.

frequency-decoder javascript calendar

Category: Javascript  | Leave a Comment
Css Specifity and … Star wars? Mar 05

As “the Css guy” I am often looking around for easy ways to remember the various facets, tweaks and foibles of the language. thumb

One of the things I have been toying with for a while is “specificity” of a css selector (basically, given two selectors for the same item, which one wins out?) I have often noticed that if you refrence somthing from a lower element of your site (for example div#wrapper div.content div.left a.biglink{color:blue}) it will have more weight (i.e it is more likely to actually be applied to the element) than just a.biglink. I came across this again recently where we had an element with an ID which then had a class added as a transformer (to change it slightly on another page). When referencing this in the css like this:
div#thisdiv{background:#ffffff}
div.transformer{background:#999999}

the ID would ALWAYS win out – it would always be white regardless of the presence of a transformation class. However, when you make a slight change and reference this as
div#thisdiv{background:#ffffff}
div#thisdiv.transformer{background:#999999}
(including the ID and the Class in the transfomer) it would win over the white when both the ID and the Class were present. This is specifity at work.

It was then I remembered an awesome resource I read a while back on the subject at Stuff and Nonsense which culminates in a fantastic little representation of how specificity works using star wars characters. See the full star wars chart here but be sure to read the article first.

What Andy does not cover is the use of inline styels in your HTML (thses will always override any css in an external style, no mater how specific) and the use of the contraversial !important tag (which essentialy overrides the specifity within the stylesheet – but many people see this as cheating!)

Eddie