|
|
# foo=bar
# name=foo
# echo ${!name}
bar
The above example shows how to make a bash environment variable reference the value of another.
# echo ${!f*}
foo fs_abc_opts fs_name
The above example shows how to get a list of all variables beginning with “f” (NB the wildcard can only go at the end).
Ben Fowler writes about the issues related to nuclear power in Australia. He spends 8 paragraphs discussing the issues on the “Right” side of politics – of which 6 concern the an Australian nuclear weapons capability and then spends 3 out of 5 paragraphs related to the “Left” side explaining that he thinks that everyone who opposes nuclear power is a Luddite.
Ben didn’t bother providing any links or statistics to back up his claims, so I’ll assist him in analysing these issues by providing some facts that we can discuss.
In March Spain had wind power provide 27% of all electricity (making wind power the main source of power for the country). I blogged about this at the time. While Spain has an ongoing program of building new wind power stations the majority of wind turbines in Spain are quite old (the Model T of wind power) and not nearly as efficient as modern turbines that would be installed for Australian power plants.
The Danish government has announced plans to use wind power for 75% of their electricity. Denmark has a much smaller land area than Australia, which means that generating so much electricity from wind power is more technically challenging for them than it would be for us. A larger land area means that when one area has low wind speeds other areas can be used to provide power.
For home electricity generation wind turbines have not yet been proven to be practical. The linear speed of the blade is determined by the wind speed and the rotational speed is therefore a factor of the wind speed divided by the radius of the blades. This means that smaller turbines have higher rotational speeds which causes more noise (bad for getting council approval), also to avoid turbulence a wind turbine will ideally be some distance above the ground (8 meters is good) which again gives problems when getting approval. The O’Connor Hush Turbine is supposed to solve the noise component of this problem. It will be interesting to see whether home based wind power becomes practical in future – if so I would like to get an O’Connor turbine on my house!
Home solar power has been proven to work well, in the form of both solar-electric and solar hot water (I know several people who have been happily using them for years). You don’t get cold showers when the sun isn’t shining, you instead use gas or electricity to heat the water (it’s a standard feature in a solar hot water system). Also your home electricity doesn’t go off when the sun stops shining, you have batteries that are charged during sunny times to run things overnight, and when they get flat you pay for power from the grid.
It is quite realistic to stick solar power systems on every roof in the country. The added cost to the process of building or purchasing a house is negligible and the benefits include having electricity when mains power is unavailable (NB water is used in generating electricity from coal or nuclear power plants so a bad drought will eventually become a time of limited mains power). Even the smallest home solar electric system will produce enough electricity to power a fridge and freezer 24*7 so it’s a very useful backup for essential power. The government is subsidising the installation of solar electric systems, so it seems that they expect everyone to get one eventually.
Dr. Ziggy Switkowski (the main advocate of nuclear power in Australia) says “the introduction of a carbon tax could make nuclear power the cheapest option by the 2020s”. In consecutive paragraphs Ben derides “carbon trading” and claims that nuclear power is “practical”. Unfortunately the main advocate of nuclear power in Australia does not believe that it is practical without a carbon tax. Ziggy also states that it would take at least 15 years to complete a nuclear power plant, unfortunately we don’t have the luxury of waiting for 15 years before starting to try and reduce the damage that we are doing to the environment. The Stern report makes the economic consequences of inaction quite clear.
I am not a Luddite. I oppose nuclear power because of the risks related to accidental release of radioactive material and the routine release of radioactive material as part of the uranium mining process, and the dangers related to long-term storage of nuclear waste (let’s not assume that Star Trek science can make it all non-radioactive). Nuclear power is not cost effective for Australia and will take so long to develop that it won’t save us from the serious economic damage predicted by the best scientific models as presented in the Stern report.
For large scale power generation wind power works now, can be easily implemented and has no hidden costs or risks. There will never be a Chernobyl type accident with wind power, it is inherently a safe technology. For small scale power generation (something you can add to your home) solar power works well, is not expensive (when considering the price of a house and especially when the government subsidy is counted) and has the potential to seriously reduce the amount of carbon dioxide produced.
A default RHEL4 install of a Rackspace (*) server contains a cron.d file named /etc/cron.d/rs_rhncheck that runs a job to check for Red Hat Network updates. In the default configuration this would send out a message every day indicating that up2date did nothing. To only get email when there is something interesting happening I changed the cron.d file to call the following script. The checksum is compared against the checksum of the output of up2date when it does nothing (I guess I could have tested the return code for diff). So when up2date either installs a package or decides not to install a new kernel package (or other important package) then I get an email.
#/bin/sh
/usr/sbin/up2date --nox -u > ~/up2date.out
SUM=`md5sum ~/up2date.out | cut -f1 -d\ `
if [ $SUM != "65c57b05b24bd8f656a0aec0d6db725a" ] ; then
cat ~/up2date.out
fi
(*) Rackspace support is really good. If I was paying I might look at other options but for my clients I am happy to recommend them without hesitation.
Just over two days ago I sent a DMCA take-down request to nixforce.com for copying my content in violation of the non-commercial license that I offer, I have not had a response from them and they have kept mirroring my site.
I have just sent a DMCA take-down to tierzero.net which appears to be their ISP. The email address listed in the whois record for that ISP bounces as does the postmaster address.
It seems that I’m not the only person with this problem, Antti-Juhani Kaijanaho is also having problems with them. Any suggestions on how to deal with them would be appreciated.
One possibility that I will eventually persue is to file a DMCA request with Google, this can result in their Google Adwords account being terminated.
The first thing you need is to have meta keywords in the pages. The solution I discovered for doing this is the All In One SEO Pack, this automatically makes the categories of a blog post become meta keywords, allows adding arbitrary meta keywords when editing the blog post, and supports keywords for the entire blog. It also re-writes the titles to have the title of the post appear before the title of the blog in the <TITLE> tag which is rumored to be a good thing to do.
The next thing you want to do is to create a Google sitemap. A sitemap is an XML file that describes all the URLs in your web site which tells Google (and other search engines) the last change dates of all the URLs and the change frequencies (or how often they should be checked for changes). Note that the format is called Google Sitemaps because Google invented it, other web search engines also use the same format. To generate my sitemap I use the Google Sitemaps Generator which tells earch engines to index my main blog page daily and the category pages weekly (which is configurable). It also has an option to notify Google of changes by pinging the Google service.
Having multiple names for the same web page hurts you when it comes to search engines. Having two separate pages at the top of page 2 is not nearly as good as having one page on page one! To solve this problem I use the Permalink Redirect plugin to make sure that each page has only one URL pointing to it. This plugin also allows redirecting the feed URL to feedburner.com. Feedburner serves the feed data (thus saving you some bandwidth if you are on a slow link) and also tracks statistics on it which are interesting.
Under the Writing section of the Options menu there is an option to enter a list of URLs for update services that can be notified of every post. I use http://rpc.pingomatic.com/ and http://rpc.technorati.com/rpc/ping. The Update Services entry in the WordPress Codex has more information on how this works.
Social networking sites such as digg.com can direct a large amount of traffic to your site if you write about a popular topic. The Share This plugin is the simplest way I found of adding social networking hooks to WordPress (I tried a few others that had both less functionality and less ease of use).
Finally before publishing a post, I often check the Google Adwords Keyword Tool. This often gives me ideas on how to make the meta tags and title match what people are searching for.
In response to my comment and post about the cost of driving to work there was a comment on the blog post I responded to suggesting that a small car is better value for money than a hybrid car.
The claim was made regarding a Nissan Pulsar, but to investigate this I decided to compare the Prius with the Corolla Hatchback, as far as I can tell the Corolla Hatchback is the nearest non-hybrid car to the Prius that Toyota sells (being similar in size, weight, and performance). Comparing cars of different make adds extra variables into the equation. Unfortunately the Toyota web site fails to provide specifications for the Prius and only provides a PDF file with minimal information on the Corolla, but it is enough for some minimal calculations.
A car company run by intelligent people would publish the specs on all their vehicles and provide a search form to compare selected models. The Standard Performance Evaluation Corporation has a good search method that allows easy comparison and ranking of items in their database (here is an example). It would be good if Toyota would permit us to compare models in their car range in a similar manner.
According to the Toyota web site the Prius uses 4.4L/100Km when driving in the city and the manual transmission version of the Corolla Hatchback uses 7.4L/100Km (7.7 for the auto). For the average 16,000Km that an average Prius owner drives that would save 480L of petrol which would save about $700 at current petrol prices.
The Corolla Ascent Hatchback (the cheapest of all Corollas) is $21,000 while the cheapest Prius is $37,400. If you compare the Prius with the cheapest Corolla then it’s a $16,400 price difference. If you save $700 per annum then it won’t cover the interest on a $16,400 loan or match the interest rates earned by a bank term-deposit if the $16,400 was invested. So it seems apparent that at current petrol prices (NB petrol prices are expected to increase) and with average Prius driving patterns a Prius will not be more economical than a cheap Corolla.
Currently the Commonwealth Bank of Australia offers 6.05% interest on term deposits of between $10,000 and $25,000. This means that $700 per annum would be the interest on a term deposit of $11,500. If we compare the Corolla Ultima Sedan at $32,000 with the Prius at $37,400 the difference in price is less than $11,500 – but the cars have incomparable sets of luxury and safety features. The Prius i-tech appears to have a super-set of the luxury and safety features of the Corolla Ultima Sedan but at $46,900 is again going to cost more for the average Prius driver.
The Prius is a very quiet car to drive, there is almost no engine noise (when driving at speeds where the Petrol engine is operating there is usually more noise from other vehicles) and no gear changes (handy if passengers are consuming hot or sticky drinks). It has a good set of safety and luxury features and is also a prestige car (no-one will say “oh wow, you’ve got a Corolla”). If you assign a dollar value to these features then a Prius may be the most economical car that meets your requirements!
Finally, let’s keep in mind the fact that petrol prices are steadily increasing. If you save $700 by driving a Prius this year then you may save $1000 next year. There is also the option of converting a Prius to a plug-in hybrid which will be a useful option if petrol prices hit $10/L! Also the amount of money saved will depend on the use of the car. If you are running a courier or taxi business then a Prius will probably be a lot more economical than a Corolla due to the greater distances travelled and the travel in the slow city traffic that the Prius was designed for.
PS All prices are in Australian dollars and concern products on offer in Australia, I would like to see comments from other people who perform the same calculations for their countries.
Update: If this interests you then you may want to read other posts I filed under the Environment and Cars categories.
In this post I recommended that job seekers not publish their CV. In a comment Gunnar suggested having a special CV for conferences. I think that Gunnar’s idea is good and have started writing my conference CV at http://etbe.coker.com.au/conferences. When I complete it I will make it part of every submission for speaking at a conference.
The LCA 2008 call for presentations is now open. One of the most interesting, noteworthy, and slightly controversial items is the suggestion that people submit a video. I think that the video submission is a great idea, either a video or testimony from audience members from past presentations should be required for all submissions (NB I’m not involved with organising LCA2008 so my opinion means little in this regard). The reason is that I have attended many presentations which fell far short of their potential due to poor speaking skills. I’ve been to great presentations by people with strong accents, by people with speech impediments, by people who are incredibly shy, and by people who just don’t have a clue about public speaking. However my observation is that if a speaker has more than one of these disadvantages then the presentation is likely to fail. I have previously written at length about how to give a good presentation to a technical audience (such as is found at LCA).
Dave Hall blogs about Should I do a presentation at LCA 2008. He mentions lack of a web-cam as a disincentive, but I am happy to lend him my digital camera (which makes really high quality movies) to solve this problem. In fact I have considered recording some short Linux talks at the SGI office during lunch breaks (Dave and I both work for SGI).
Dave also mentions a nightmare scenario about a laptop not working with presentation hardware. My post about getting laptops working for presentations will hopefully help some people in this regard.
I’m not sure if I’ll make an offer for LCA this year, I haven’t been doing much cutting-edge work recently. Maybe I’ll just offer some talks for mini-confs, I could probably get several offers accepted by mini-conf organisers if I try.
Mark Greenaway expresses surprise that someone could spend $8000 per annum on petol.
I own a 1999 VW Passat 2.8L that does 12.8L/100Km (based on my average driving habits – I record the amount of petrol purchased and the distance driven). I spend an average of just over $60 a month on petrol, so I’m approaching $800 per year.
I catch the tram and train to work most days (probably drive to work less than 10% of the time) and use my car very little apart from that (most places that I drive to are close to my house).
If I was to exclusively drive to work then that alone would make my petrol expenses approach $8000 per annum. If I was to shop at locations that weren’t so convenient or do recreational driving then the petrol expenses could be significantly greater.
The $1000 a year I spend on public transport doesn’t seem so expensive!
The Sydney Morning Herald has an article about the increase in sales of hybrid cars due to fuel price increases. In that article they note that Toyota representatives claim that Prius drivers travel more than the average 15,000 KM per annum.
Recently the RACV magazine published an article based on the CNW report (the bogus report paid for by Exxon which claims that the Jeep Wrangler is better for the environment than the Toyota Prius). In response to this I reviewed all adverts for second-hand Prius and Wrangler’s on www.drive.com.au to determine how much these vehicles are driven.
I counted a 2006 model as a 1yo car for the purpose of the average. On the 29th of April when I looked at the web site there were 90 Prius and 127 Wrangler on sale for which both the model year and the distance driven were published. Of these vehicles the average distance driven per year for the Prius was 15995Km, and the average for the Wrangler was 11,658Km.
Someone who purchases a Prius instead of a V6 car (such as my VW Passat) can expect to save at least 7L per 100KM (based on the assumption of 12L/100Km for a V6 and 5L/100Km for a Prius – this is a conservative estimate, the savings could be greater). That would be a saving of at least 1120L of petrol per annum for the average Prius owner, giving a saving of >$1500 per annum with current petrol prices. Over the 20 year life of the vehicle the average Prius owner can expect to save at least $30,000 on petrol at current prices – but we do expect petrol prices to increase…
I often want to write blog posts about HTML code and about source code in various languages. One problem I have is that the characters I want to use have special meanings (EG < and >), another is that I indent source code to make it readable and I don’t want the spaces trimmed from the start of lines.
I initially wrote a simple Perl script to replace characters such as < with HTML codes. I then had to extend it to escaping quote characters because WordPress tries to get smart and change quotes in a way that might look nice when dealing with plain text, but is just a pain when dealing with code.
The next problem I had is that when I used the <PRE> tag around some text to preserve the white-space WordPress would double-space the text (IE insert a blank line between every two lines of code). This was annoying when reading it and in some situations would change the meaning of the code! The solution I have found to these problems is to use the below script and not use the <PRE> tag. Also I tried using the <CODE> tag, but it made no difference to the end result as far as I could see.
The below script is what I am currently using. It is working well with shell scripts, HTML, and XML so far.
Update: The way that -- is munged by WordPress to — is something that I find particularly annoying. I already had this in the script but forgot to mention it in the post.
Continue reading putting HTML codes and other special characters into a blog entry
In my last post about Heartbeat I gave an example of a script to start and stop a cluster service. In that post I omitted to mention that the script goes in the directory /usr/lib/ocf/resource.d/heartbeat.
To actually use the script you need to write some XML configuration to tell Heartbeat which parameters should be passed to it via environment variables and which nodes may be candidates to run it.
In the below example the type of web means that the script /usr/lib/ocf/resource.d/heartbeat/web will be called to do the work. The id attributes are all arbitrary, but you want to decide on some sort of consistent naming scheme. I have decided to name web server instances web-X where X is the IP address used for providing the service.
The nvpair element contains a configuration option that will be passed to the script as an environment variable. The name of ip means that the environment variable will be named OCF_RESKEY_ip. Naming of such variables is arbitrary and a script may take many variables. A well written script (which incidentally does not mean my previous blog post) will have an option meta-data to give XML output describing all the variables that it accepts. An example of this can be seen by the command /usr/lib/ocf/resource.d/heartbeat/IPaddr2 meta-data.
In the XML the resources section (as specified by --obj_type resources on the cibadmin command-line) describes resources that the Heartbeat system will run. The constraints section specifies a set of rules that determine where they will run. If the symmetric-cluster attribute in the cluster_property_set is set to true then resources will be permitted to run anywhere, if it is set to false then a resource will not run anywhere unless there is a constraint specifying that it should do so – which means that there must be at least one constraint rule for every resource that is permitted to run.
In the below example I have constraint rules for the service giving node-0 and node-1 a priority of 9000 for running the service.
In a future post I will describe the cluster_property_set and how it affects calculations of where resources should run.
Continue reading configuring a Heartbeat service
|
|