Setting a Red Computer Display to Preserve Night Vision in Linux

Astrophotography sometimes requires the use of the computer screen whilst operating the telescope. This is damaging to night vision. It is better to use a red screen.

Linux users can install the program “xcalib”. For systems that use the Apt package manager (such as Ubuntu), xcalib can be installed with the command:

sudo apt-get install xcalib

The green and blue components of the display can then be switched off with the commands:

xcalib -green .1 0 1 -alter

for green, and

xcalib -blue .1 0 1 -alter

for blue. The display will now be red. The display can be reset with:

xcalib -clear

These commands can be added as aliases. If the bash shell is being used (it probably is, this is the default for Ubuntu and Mint) the following lines can be added to the .bashrc file (note the full stop).

alias astro=”xcalib -green .1 0 1 -alter;xcalib -blue .1 0 1 -alter”
alias notastro=”xcalib -clear”

The .bashrc  file needs to be in the /home/[username] directory, and may not exist so you might need to create it.

The display can now be set to red with the command “astro” and reset with “notastro” at the command line.

Alternatively, these commands could be added to a shell script and kept on the desktop where they can be run with a mouse click.

Don’t forget that the brightness control still works…

Variables in CSS Style Sheets

I’ve been doing a little bit of web design the last few weeks.

It appears that css style sheets do not natively support the definition of variables and the ability to perform basic addition/subtraction operations. This would be helpful when an element is resized and other page elements must be resized appropriately, or when the colour of an element is defined as a different shade of the colour of an adjacent element where a hex value can be simply added or subtracted. I find this surprising, so there is probably a very good reason for this.

A hacky but perfectly acceptable solution is to define the style sheet as a php file.

Typically the style sheet is named style.css. To do this the file will need to be named style.php unless the server is configured to parse othewr files as php (I generally don’t bother with this, I’m quite happy for people to be able to see what technology I am using).

The start of the style sheet is then as follows:

<?php

header(“Content-type: text/css; charset: UTF-8″);

# All variables go here, e.g. the width of the page:
$pageWidth=940;

?>

# CSS stuff below here…

#div {
width: <?php echo $pageWidth-100; ?>px;
}

The header() function defines the file as a css style sheet for the browser (since the file is no longer named as a *.css file). If the basic naming convention is still being followed then it is probably a good idea to keep this statement anyway to guard against changes in the server configuration. It may also help prevent the style sheet from being blocked by some web filtering proxies that are unable to categorise the data.

When the php part of the css is parsed the expressions are evaluated and printed in the style sheet with echo commands. The units of measurement (px, em, %) are then appended to the end of the expression in the stylesheet. If the programmer wanted to be imaginative the variables could be defined as strings with the units included, and functions can be defined that strip the units from the string, typecast the string as an integer, perform the mathematical operation, append the unit and typecast the result as a string. Unless this is coded very carefully and generically the resultant code is likely to be messy, so I prefer to avoid tricks like this (although the functions can be defined in another file).

Finally, the style sheet is applied to the html document with the following declaration in the header:

<link rel=”stylesheet” type=”text/css” href=”style.php” />

If used carefully this method allows style sheets to be defined that allow for easy changes in dimension. With a little thought some additional trickery can be formulated. I will leave that for another post…

 

 

Skywatcher EQ5 RA Setting Circle Slipping

I’ve been having problems with the RA setting circle on my Skywatcher EQ5 mount.

The RA setting circle is a collar that slides onto the RA axis with a surrounding fixed sleeve that extends down to the scale on the circle. As the mount rotated along the RA axis I was finding the RA circle had a tendency to slip. This renders the circle basically useless and a web search shows this to be a common problem.

As the centre of the mount rotates, the RA setting circle is rotated under the action of friction alone. I’ve found that the grease used in the mount had penetrated the space between the rotating inner and the circle collar. This was reducing friction and caused the circle to occasionally slip/stall.

First of all clean off excess grease from the inside of the RA setting circle – this might be all that is required. Unfortunately I found the circle was still a little too free to move. I’ve placed about an inch of electrical on the inside surface of the setting circle (I prefer if hack fixes can be removed). This has left the circle with a nice tight fit that doesn’t spuriously slip and tracks nicely.

The tightness of the fit can be controlled by varying the length of the tape.

A few points to note:

  • The lock screw will no longer lock the circle to a fixed RA value. I don’t think thats what that screw is for anyway… It is primarily to lock the circle to 0 to calibrate the polarscope. (Locking to 0 still works fine.)
  • If the circle is puled down to contact the date circle of the polarscope (which does admittedly look smarter) the circle again sits loose. This is a bad idea anyway as it stops the vernier-type scale from being read accurately.
  • Apparently some EQ5′s are supplied without the polarscope. Presumably this means that the RA circle can fall off the mount. I think this modification will stop that happening.

Signing Off

Recently, I was doing research online to select a new telescope. This has since been purchased, but I am still being bombarded by adverts for telescopes. Clearing my cookies has helped, but my browsing history appears to be linked to my IP address and browser request header. I find this to be a continuing source of annoyance.

In the last half of 2013, marketers have started to push facial recognition technology to target adverts at passers by.

At the moment, these systems are limited to the identification of age and gender. However, the technology certainly exists to uniquely identify individuals if sufficient data is available. This data has already been compiled in the form of profile photos and photo-tagging. Due to the potential profits that can be made, I imagine it is only a matter of time until facial data is made available to marketing firms. When this happens, I will consider it an intrusion, and I do not wish to participate.

Therefore, I have decided to delete my social media accounts.

I consider myself very lucky, since my friends will use phone/text/email to get in touch or organise gatherings. Perhaps this is a feature of my demographic…

Aquarium Substrate

The substrate of an aquarium is the gravel at the bottom of the tank. The choice of substrate is important. Things to consider are:

  • Colour: The colour of the substrate changes how some species of fish or invertebrate behave. The popular cherry shrimp changes colour depending on the colour of the gravel.
  • Particle size: If the particles are too small then oxygen does not penetrate the medium quite as effectively. This encourages anaerobic bacteria which may introduce toxins and bad smells to the aquarium water. If the particles are too big then fish waste and decaying plant matter may be buried too easily and decay.
  • Chemistry: Some materials may have an impact on water chemistry by hardening or softening the water or changing pH, which may or may not be desirable. Other materials may act as an ion exchange resin and reduce unwanted heavy metals introduced into the water by food or tank equipment. Peat is often used to beneficially change water chemistry and mimic some natural environments.
  • Texture: A substrate that has sharp surfaces may damage bottom dwelling animals such as catfish or frogs, and may also cause damage to plant roots.
  • Density: If the substrate is too buoyant then it will be difficult to place plants without a weight around the stem or a plant pot.

 

Linux on a Fujitsu-Siemens Esprimo Mobile V5535 Laptop

I have previously blogged about difficulties with Linux and the Fujitsu-Siemens V5535 laptop. This is now an old laptop, and hardware support is now a lot better in Linux.

I have recently installed Lunux Mint.

Everything works following a default installation, without the need for any custom configuration.

Javascript and Mobile

Periodically my phone gets *really* hot and my battery drains quickly.

I have wasted a tremendous amount of time troubleshooting. I’ve cleared RAM, killed background tasks and uninstalled lots of apps.

It seems that the problem is Javascript. The browser appears so closely integrated into the OS that it cannot be closed (it simply pushes into the background) and any looping Javascript on a webpage continues running which drains my battery and creates heat. Not all sites using Javascript cause this problem.

Web designers put a great deal of effort building sites that respond to the size and resolution of device screens. Javascript is one of the tools used to achieve this objective. Since this means flattening my battery I am considering turning off Javascript altogether.

Optimising a site for mobile should include design decisions other than simple display and usability considerations, such as methods that preserve the battery of the device…

If anyone has any good ideas or examples of best practice they would like to share, please leave a comment.

The Importance of a Strong Password

Introduction

Whenever I get into a discussion about the importance of strong passwords, the response I am invariably “challenged” with generally goes as follows:

I am an obscure and unimportant individual. I am not famous. I do not have any political connections. I do not hold any sensitive information online. I am not a hackers high-value target, and therefore I am probably safe.

Here, I will take a moment to discuss how a password works at the “server-side”, and consider a way an attack might be performed. We will find that a single individual is often not directly targeted, but becomes a default victim if a weak password is implemented.

How A Password Is Stored… The Secure Hash!”

Many people probably imagine that when we select a password, the string of text is saved in some sort of flat file or database entry, and that when we “log in” the text we enter is compared to whatever password the server registered against the username.

Back in the early days of the web, this is exactly how things worked.

If you stop and think about it, this is a very bad idea. An attacker could break into the server over the network and steal a list of passwords. Alternatively, someone with legitimate access to the server (such as a system administrator) could simply copy the file and take the passwords home.

Fortunately, passwords are no longer kept in plaintext. (Plaintext is text that has not been subject to any cryptographic cleverness. Ciphertext is the opposite of plaintext.) A cryptographic “hash” is generated from the password and this is then stored. A good hash algorithm cannot be reversed, so you can’t work out what the original password is.

An example of a cryptographic hash is the MD5 algorithm. This is no longer the best algorithm to use when security is important. Better hashes exist, such as those in the SHA-2 family. I will use MD5 as an example because readers probably use MD5 to verify internet downloads (if they are sensible enough to take the time to do so).

So What Happens To Passwords On A Server

Suppose you sign up for a new email account (or web host, or forum profile etc), and you decide to use the password “London2012″ (A REALLY BAD PASSWORD!).

Your new password is sent to the web server. The server then generates a hash. If MD5 is being used (it shouldn’t!) the string “London2012″ will give us the following hash:

95c01f7cb1212eaac5866ff184f05751

The server then stores this hash for future logins.

When you next login and send your password, the server works out the hash for your password, and then compares it against the hash that it has on file. If the two hashes match, then the server concludes that the correct password was entered and you are allowed to login.

Remember that a good cryptographic hash cannot be reversed. We cannot calculate the password from the hash. This means that if the password file is stolen then it is still difficult for someone to log into your account.

So Why All This Strong Password Nonsense?

Suppose a file containing password hashes is stolen from a server. This file might well contain the hashes of several million passwords.

Since this file is so big, we can be confident that someone, somewhere, has “London2012″ as a password. We could calculate the cryptographic hash for “London2012″ (95c01f7cb1212eaac5866ff184f05751) since the hash algorithm is not a secret, and then search the file for this hash. We then find which username has this password and the account is now broken.

A modest desktop computer could calculate a hash and search a password file very quickly. If a list of commonly used passwords is available then hundreds of thousands of passwords could be checked in a few minutes. The operation could be further optimised by the use of rainbow tables. To make matters worse, cloud based services make high performance computing resources available at a modest cost. More simply, the password hashes could be leaked on the internet and breaking the passwords becomes a community effort.

Herein lies the problem. It does not matter how insignificant you are, if you have a weak pasword you are rapidly picked out from the crowd. An attacker does not always target specific people. It is often weak passwords that are targetted.

We often hear stories on the news of peoples passwords being stolen and published on the internet, this is precisely how this happens. The victims in these instances are ordinary people that do not stand out.

If you find out in the news that a service you use has been compromised, change your password. Thousands of people all over the world could be trying to break into your email.

Strong passwords are important. Don’t argue with me, because I won’t bother arguing with you. I’ll nod politely, and maybe even agree so that the conversation moves along to other matters. You are responsible for your own data…

Aquarium Water Chemistry and Reverse Osmosis.

For most people, the water from the kitchen tap is mostly OK for a typical fish tank. However, water quality can vary greatly, even within the same county. This is one of the advantages of finding an experienced aquarist in your area – for most people this will be a local dealer. They will advise on the suitability of your local water. Note that most shops keep fish in local water, so that the water chemistry matches that of the average customer. This is why it is so important to acclimatise fish to a new environment. The water in the tank could be very different to that in the transport bag.

Tap water usually contains additives to maintain cleanliness of the water for drinking. This usually means traces of chlorine or flourides and are harmful to fish. If tap water is used, a product to render these substances inert should be added.

Water from the hot tap SHOULD NOT BE USED. The hot water tank is often made of copper which is particulaly toxic. Simply use cold water, and add it slowly.

Reverse Osmosis water (often called RO water) is water with all minerals and other impurities removed. It is sold by most aquarists, or is made at home by hard-core enthusiasts (the equipment to make RO water can be expensive). Minerals must be added before it is put in the aquarium: water that is totally devoid of minerals can quickly kill fish.

RO water is useful because it is less likely to contain trace toxins (such as heavy metals or chlorides) and formulating the necessary mineral additives provides an opportunity to precisely control parameters such as pH, KH and GH, so that water chemistry can be targeted towards particular fish species.

Aquatic plant enthusiasts use RO water because low hardness water can be fertilised with a greater concentration of carbon dioxide without becoming toxic for fish.

The Good Old Days…

When Canonical moved Ubuntu to the Unity interface I was not a happy Linux user, and I was not alone…

I would have been happy to spend some time learning this new interface (after all, I encourage Windows users to keep an open mind), but I found a few of the early quirks too painful. I took the opportunity to play with some other desktop environments, and found myself installing Fedora in the process. It was about time that I learned a little bit more about Red Hat type systems, and I’d heard that the Fedora installer made disk encryption nice and easy which is helpful because I travel with my computer. I eventually settled on the XFCE desktop: I found the interface to be clean and back to basics.

Today I decided to pull an old laptop out of the back of a cupboard. After booting into single user mode to reset my password, my machine presented me with…. Ubuntu 7.04, “Feisty Fawn” !

This old machine is being left to crawl through its upgrade cycle. I’m going to have a play with the latest Ubuntu, and then I’m going to reformat and install Gentoo. Everyone knows that when you’ve compiled Gentoo you gain super-powers.

I still think Ubuntu is a brilliant operating system. It is bright and colourful to appeal to kids, friendly for the noobs, educational for computer enthusiasts and it provides the tools needed by those who dabble with technical computing.