Friday, 5 December 2014

Upgrade XBMC to OpenELEC

After working for over 2 years, essentially problem free, it was finally time to upgrade. I looked at just upgrading XBMC to Kodi, but found a much easier path of installing OpenELEC. Before doing so, I tested the installation on a spare machine. It worked really well. The things that concerned me, and required further investigation were:
  • how to manage machine using SSH?
  • can I use cron to perform maintenance tasks?
  • will remote work
  • will wireless connection work
I must congratulate the OpenELEC team on such an easy installation and configuration. It was simple and painless.

Preparation

Backup media on XBMC host: music, videos onto external USB drive

Prepare installation media. Here I used OpenELEC Stable - Generic x86_64 Version:4.2.1 (tar version) and the installation script to write to a USB flash stick: link

Installation

I just followed instructions on from this link. For setup, I connected a keyboard to make data entry easier. I also selected to enable SSH.
The choices you make are written to a read-only file system. To update these options you will need to use the OpenELEC Configuration Addon.

Post Installation

There really was very little to do:
  • remote worked out of the box 
  • wireless connection was simple with standard questions
Copying the music and video media back onto system was a two step process:
  • use the system file menu to copy music media onto /storage/music
  • update album covers
Do the same for videos:
  • use the system file menu to copy video media onto /storage/video
  • update video covers
Initially SSH used a password. I used the command ssh-keygen to use keys instead. Then used OpenELEC Configuration to switch off use of passwords.

Cron is supported, but I have not yet need to enable anything as the system pretty much looks after itself.

Summary

Apart from the very quick and easy installation, OpenELEC has these Features I love:
  • being able to add my ISP’s freezone playlists, so I can use my stereo to stream live music
  • on demand YouTube (register your account and you get all your favourites)
  • on demand TEDTalks via add-on
  • reliable wireless connection (was a problem in my earlier version of XBMC)
  • speedy start-up
I can highly recommend this distribution.

Tuesday, 6 May 2014

Can you admit you may be wrong?

I was having a conversation the other day. It was friendly enough. Until it turned to the reliability of journalism and media. They said that they did not trust Fox news, unless of-course, if it was reporting on events in Israel. This was a surprising admission. Being polite, I did not point out that this was an obvious example of confirmation bias. Maybe that was when our conversation deteriorated. Or perhaps, when I pointed out that it often took several alternate sources for me to arrive at a balanced understanding of a topic. I gave examples of news sources I reference, they included ABC, BBC and Al Jazeera. I suppose the last one was a bit inflammatory considering the previous admission, but I do honestly respect their reporting. My intentions were honest. How can you make an informed decision without considering alternate viewpoints, sources and data? That is after all, a principal characteristic to rational thinking.

Next, they made an attack on science. They gave an example. The specifics are not important. The inference though, was the challenge: "How can you have complete knowledge?" Despite my probably feeble efforts to describe the scientific method, their attack continued. This was not what rattled me though. I got annoyed when they asked, “Can you admit you may be wrong?”.

It took me some time to reflect how the conversation arrived at this often used anti-science argument. Here is a person of faith, a person with no evidence for their beliefs, with little, if any understanding of the scientific method, fishing for meaningless admissions.
What is a good response?
  • Is it not better to know one's limitations?
  • Is it not better to have a reliable process of obtaining knowledge?
  • Is it not better to be able evaluate and if found wanting, throw out bad ideas?
  • Is it not better to have evidence?
I was confused about why this was at all relevant. Of course I can be wrong! I enjoy being challenged. It keeps one young!
What may be going on, is that faith prevents you from changing your mind even when given contradictory information. One defence is to go on the attack: Get your adversary to admit doubt. As if doubt is of itself, bad. This diverts attention from their own fallacy and rigidly held beliefs. After-all, they can't be wrong as they have faith!

Perhaps it is a ploy to level faith with imperfect scientific knowledge? This is a distraction. I freely admit we do not know or indeed can know, everything. But that does not change my confidence in the scientific method. It has proven to be a reliable tool to describe our world. It is able to adapt to new knowledge. It accepts being challenged. It does not ignore conflicting data. It is not faith.

Or am I missing the point?

Friday, 7 March 2014

Bash arrays - what is the difference between array[*] and array[@]?

I've just been updating some Bash scripts and noticed that there are two ways to refer to array elements: one using the "*" the other using "@". So what is the difference? According to the manual
The "@" variable allows word splitting within quotes (extracts variables separated by whitespace). This corresponds to the behaviour of "$@" and "$*" in positional parameters.
So you get two different outcomes as demonstrated below:
$ ARRAY=(0 1 2 3 4 5 6 7 8 9)
 
# first using "@" inside quotes,
# you get the same output with no quotes ...
$ for i in "${ARRAY[@]}"; do echo "$i"; done
0
1
2
3
4
5
6
7
8
9
 
# same as above but using "*" ...
$ for i in "${ARRAY[*]}"; do echo "$i"; done
0 1 2 3 4 5 6 7 8 9
 
# but without quotes ...
$ for i in ${ARRAY[*]}; do echo "$i"; done
0
1
2
3
4
5
6
7
8
9
Source: http://www.tldp.org/LDP/abs/html/arrays.html

Saturday, 8 February 2014

Update on Debian with Lenovo X1 Carbon

On my previous post, I noted that the X11 trackpad customisations. Since then I have implemented the SSD optimisation recommendations as recommended here. I'll give a summary below, where detailed notes on my configuration are here.
Firstly are /etc/fstab options to reduce writes:
# /dev/sda1
UUID=??? / ext4 discard,noatime,commit=600,errors=remount-ro 0 1
# /dev/sda5 (swap)

UUID=??? swap swap sw,discard 0 0
Next, reduce swappiness. Add to /etc/sysctl.conf
# optimise for SSD

vm.swappiness = 0
Finally, use the deadline scheduler. In /etc/udev/rules.d/60-ssd-scheduler.rules


# Only sda is SSD, see https://wiki.debian.org/SSDOptimization
# set deadline scheduler for non-rotating disks
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
In my case I need only do this on the sda device.
Please read my document on this as it provides extra information and links.

Saturday, 1 February 2014

Debian Linux on Lenovo X1 Carbon

I am now using a Lenovo X1 Carbon for work. After the installation hassles with the Samsung Series 9, I'm certainly sticking with Lenovo. It was such a breeze. While I had every intention to maintain the Windows 7 partition, between Lenovo and Windows they consumed all the spare volumes. If required, I can resort to Mac OS X as a commercial alternative. Besides, I have been Windows free since 1998, so have not got a valid reason to retain it. So Windows and Lenovo recovery got dumped onto an unused external hard disk. Someday, I may need to recover, but history is against it.

My notes on the installation, though thin are here. It is running Debian, with Xfce installation. The only customisation worth noting are the X11 settings for the trackpad. The custom settings used are:

#
# File: /usr/share/X11/xorg.conf.d/50-synaptics.conf 
#
Section "InputClass"
   Identifier                      "lenovo x1 carbon touchpad"
   Driver                          "synaptics"
   MatchIsTouchpad                 "yes"

   # three fingers for the middle button
   Option "TapButton1"             "1"
   Option "TapButton2"             "2"
   Option "TapButton3"             "3"
   Option "ClickPad"               "1"

   # drag lock
   Option "LockedDrags"            "0"

   # prevents too many intentional clicks
   Option "PalmDetect"             "1"

   # vertical and horizontal scrolling
   Option "VertTwoFingerScroll"    "1"
   Option "HorizTwoFingerScroll"   "1"
   Option "VertEdgeScroll"         "1"
   Option "CoastingSpeed"          "8"

EndSection

Update on Samsung Series 9

I have been using a Samsung Series 9 with Linux Mint Debian Edition for nearly two years. It is a wonderful machine to use. Crisp screen. Fast. Silent. Lovely keyboard. But it was a real pain to get working reliably under Linux. And with the reported BIOS bug you feel like on tender hooks doing a reinstall or upgrade.
I'm, however, relatively happy to report that apart from the occasional kernel panic when using USB ports it has been reliable. Now that I know it is USB sensitive, I take extra precautions when yanking out USB devices. Ensure it is properly unmounted, eject if able. Put machine into suspend mode, then yank out. A pain, but I'm more confident going the extra effort to avoid uncontrolled panics while in the middle of an edit.

I am disappointed with recent change of direction of Linux Mint Debian Edition. I like the rolling release. Having successfully implement two updates now, the process is relatively smooth. However they have abandoned the Xfce desktop as a installation choice. That will push me back to using base Debian. Which is not such a bad idea. I used Linux Mint initially due to its rolling distribution option. That this is simply a pointer to Debian testing, means I should be able to revert to Debian. More on this in a later post.

Please be sure to check my updated notes on this installation here. It has been maintained as the machine was tweaked and optimised.

Saturday, 18 January 2014

Quantum Quackery

Here is the latest quackery, Scientists claim that quantum theory proves consciousness moves to another universe at death from Robert Lanza.
This has been addressed many years ago by the respected physicist Victor Stenger in Quantum Quackery.

Here is a direct response, Biocentrism Demystified.

Figures from the UK suggest that while people are leaving organised religions, they are increasing in spiritualist organisations.

It requires constant and disproportionate effort to debunk spiritualist claims.
It is far easier to make stuff up than to convince people of their fiction.