Raspberry Pi with Ubuntu MATE Installation

Tags

, , ,

I’ve only recently managed to get my hands on a Raspberry Pi, which was really popular at my university and the local hackspace. The credit card-sized board houses an ARM v8 quad-core processor, 1GB memory, a wireless interface and plenty of USB ports. More than enough to function as a desktop with a minimal Linux installation.

As you can see, the Pi has a set of GPIO pins along the side for hardware and I/O programming, though I think an Arduino board is more suitable for learning that kind of thing.

I’ve housed the Pi in a PiBow Tangerine case, which ModMyPi sells for ~£12. Since I hadn’t gotten around to completing my desktop build, I had to order a few extras from ModMyPi and Farnell Components – both pretty good suppliers.
One of these is an official power supply, as it requires a 5v adaptor capable of supplying 2.5A. ModMyPi sells these for ~£7. I wouldn’t recommend attaching anything fancy through the USB ports or attaching multiple hubs, as that could draw enough current to fry part of the board. I’ve seen that happen with laptops a couple of times.

microSD Card and Operating System
The Pi will automatically load whatever operating system is discovered on the inserted microSD card, so it’s easy to switch between them by swapping cards. Alternatives to the recommended Raspbian OS include Debian, PwnPi, Ubuntu MATE and several distributions that can turn the Pi into a media centre.
Whichever operating system is chosen, I recommend using a microSD with at least double the recommended capacity. It’s likely more space would be required for extending and customising the installation. There’ll also be personal files you’d want to keep on the same volumes as the root file system. Another potentially important factor is the data transfer rate for the microSD, as that could be a bottleneck, and therefore the operating system would ideally be installed on a microSDHC card.

If installing Ubuntu MATE, the first step is to download the version specifically for the Pi, and this will be a .xz archive from which the .img file is extracted. This image file is then ‘burned’ to the microSD card. I’ve used 7-Zip and Etcher, as recommended in the official Pi documentation,.

Since there is no swap partition on the microSD, the 1GB of physical memory won’t be extended. That would also mean the hibernation feature wouldn’t work. If the memory proves too limited for the MATE desktop, we could install XCFE and configure that as the default in the .xsession file Another option is to disable X11 using ‘raspi-config‘ – almost every desktop application has a decent command line substitute.

Well, that was my plan, but I wasn’t initially able to get this operating system running on the Pi, as it apparently couldn’t find the partition for the root file system. I kept getting the following error message:

Kernel panic-not syncing: VFS: unable to mount root fs on unknown-block(179,2)

I’ve come across this error before, when I had a multi-boot system spanning several hard drives. The kernel is attempting to create or read a file system on a non-existent volume.
I managed to pin this down (I think) to a configuration line in ‘command.txt‘, which has either an incorrect partition number or incorrect filesystem set. Multiple times I swapped the microSD between my laptop and the Pi, trying to find the correct values by trial-and-error (e.g. root=/dev/mmcblk0p2 instead of root=/dev/mmcblk0p6).

The problem was I created a partition table on the card before flashing it, not realising the Ubuntu MATE image will create the partitions on unallocated space anyway. To fix this, remove all partitions on the card using the Windows Disk Management application, so the entire 30-32GB is unallocated and flash the card again using Etcher. Disk Management should display the following partition scheme after flashing and verification:

Note, the boot partition (~5GB) is marked as primary. The third partition is unallocated, and this is where the root file system is created.

Advertisements

Setting Up a Linux Virtual Machine to Allow XRDP Sessions

Tags

, , , , , ,

Normally when a Linux Virtual Machine is created on Azure, we’re given just the core installation. That is, the VM is accessed through a command line over an SSH session. Here I’m going to try setting up an environment on a Linux VM that’s accessible through the Remote Desktop client.
The general principle here is that we create a standard Linux virtual machine in Azure, and on that we install the desktop manager, interface and a Remote Desktop server. Hopefully we’ll be able to connect the Remote Desktop client to this the same way we would a Windows VM.

First thing’s first: Most the configuration is done in the VM’s command line, so the local machine must have either BASH or PuTTY, or a program that enables an SSH session. Also, it helps to understand something about the architecture, dependencies and configuration files of a Linux system, but that’s not essential here.
The remote system here is an Ubuntu 16.04 Virtual Machine, and I’ve selected the cheapest and most basic pricing option.

An SSH Session
After the VM has been ceated, deployed and started, clicking the ‘Connect‘ link in the Azure Portal will show which IP address to point the SSH client to.

So, let’s try this by running PuTTY and initiating an SSH session to the VM’s IP address. After entering my username and password, and switching to the root account, I get the following:

Now we’re in business, and I can check for a package manager (ideally APT), and whether the X11, desktop manager, desktop interface and XRDP packages are available. This should be the case for any Debian-based installation. Before proceeding, run ‘#apt-get update‘ to avoid broken header problems.

Desktop Manager and Environment
Initially I was going to install the MATE desktop, but running ‘#apt-get install mate‘ indicated the components and dependencies amounted to over 1GB. I wanted something much smaller for demonstration purposes, so I chose XFCE instead, running ‘#apt-get install xfce4‘. It’s always possible to install and switch between desktop managers later, if needed.
Despite the warning messages shown during installation, the desktop components will be installed.

Setting Up the XRDP Server
The next component required is a remote desktop server. This will be provided by XRDP, which is installed with:
#apt-get install xrdp

After installation, we can use ‘#service xrdp status‘ to check whether the XRDP server is running. This is a useful command, as it enables us to stop and restart services at any point. The output should look something like this:

Every user on the system will need a .xsession configuration file in their home directories, to specify the default environmment to load when initiating an X11 session. Currently I’m logged in as root, so I need to navigate to my non-root home directory, and create this file containing the line ‘xfce4-session‘ in it. The commands are:

#cd /home/michael
#nano .xsession

And add a single line to the file:
xfce4-session

A quicker way to do this as root from the current path would be:
#echo xfce4-session >/home/michael/.xsession

Now restart the XRDP server to load the changes.
#service xrdp restart

UPDATE: 300MB of the desktop manager and interface packages consist of dependencies common to MATE and XFCE. If you want to install the MATE desktop, run #'apt-get install mate‘ and change the line in .xsession to ‘mate-session‘.

Configuring the Azure Inbound Rule for RDP
At this point the VM should have a desktop manager and an RDP server running. Now we need to find the Remote Desktop server port, so Azure can be configured to allow connections to it.
#netstat --listen

It looks like the port we’re interested in here is 3389. In the Azure Portal, under the Network tab, add an Inbound Port Rule for ‘RDP’ – this will indeed be port 3389.

Now, the moment of truth. We’ll connect the Windows Remote Desktop client to the VM. And presto, the XFCE desktop.

And the MATE desktop over XRDP:

Dr. Peterson’s World of Curiosities

Tags

, , , ,

More interesting than Dr. Jordan Peterson’s interview with Cathy Newman the other week is the question of why so many people are drawn to him almost twenty years after he authored Maps of Meaning. I’ve taken a liking to the content produced by Dr. Peterson, having read about half the book and assimilated about 70% of his lectures. I certainly didn’t start out with the intention of being heavily critical of Peterson when formulating my opinion. Quite the opposite.

Now, for reasons I’ll get to, it’s important to differentiate between the two main themes of the worldview Dr. Peterson’s expositing. One theme is essentially an explanation of why nihilism, the realisation that ‘God is dead’ and the individual has no divine value, made the 20th century unprecedented in brutality, suffering, authoritarianism and the disregard for human life at the hands of collectivist regimes driven by ideology. This understanding came from reading Dostoevsky, Nietzsche, Solzhenitsyn (hope I spelled that right) and a few other authors I can’t recall, though numerous other authors and studies are cited. Several times in his book and lectures, Peterson reveals an abject fear of this.

This paragraph from an article in The Guardian is a better summary of what he’s now taking a stand against:
Peterson has largely been in the news for his blazing, outspoken opposition to much of the far-left political agenda, which he characterises as totalitarian, intolerant and a growing threat to the primacy of the individual – which is his core value and, he asserts, the foundation of western culture.

And so, within the last 18 months, he gained something of a cult following of young men who see him as a role model, if not a father figure. That’s quite telling, as he was relatively unknown when publishing the Maps of Meaning book and lectures.

I fully agree with his position on individual rights and the freedom of speech, and largely with his analysis of the state of modern culture, but it’s dangerously simplistic to think the intolerance and authoritarianism is only characteristic of the far-left, and that the political left is incapable of being truly progressive. During the 80s and early 90s, elements of the ‘religious right’ were engaged in witch hunts and censorship, and almost twenty years ago the United States saw the introduction of the Patriot Act, unprecedented mass surveillance, arguably unjustified invasions of Afghanistan and Iraq, ‘renditions’ and torture, and the militarisation of the police. Plus, there are strong reasons for arguing that today’s ‘social justice warriors’ are actually a fascist movement bent on causing bitter divisions among the working class and undermining any alternative to the aforementioned state of affairs.

The second theme is Peterson’s Jungian and esoteric interpretations of the Old Testament and ancient mythologies, to which he brings decades of experience as a clinical psychologist. Again, his points, especially when discussing psychology in isolation, are nicely articulated and they can appear exceptionally compelling. Some of them even clarify certain beliefs we have.
The way Peterson gestures during his lectures, and the pain in his voice at certain points (which, interestingly, wasn’t noticeable in his 2002 lecture), reveals a man who desperately wants to believe in God, but is unable to abandon the absurdly rationalistic. This conflict leads to many tenuous assumptions and lack of structure in his reasoning, and that’s what I find troubling. Is there any evidence to suggest the authors of Genesis had anything other than the most rudimentary understanding of nature beyond the fact humans are singular among species? Or is Peterson projecting his wisdom onto the mythologies?

I’ve said that it’s important to be aware of these two distinct threads, and that’s because I can see how Peterson’s followers, not identifying the demarcation between the political and religious ideas, would likely become emotionally invested in a distorted, incomplete and naive understanding of our faith. And it’s very tempting to view Christianity as a traditionalist conservative force in a perceived culture war. According to Austin Frank’s piece in Today in Politics, this is indeed happening.

My Own Maps of Meaning
As far as I can determine, it’s more appropriate to describe Dr. Peterson’s view of the world as ultimately atheistic, maybe Luciferian, as it puts the ideal individual, the physical embodiment of the mythical hero, as the absolute. I’d hesitate to say that’s a bad thing, as the ‘Left Hand Path’ is still preferable to having no direction in life, and it’s definitely preferable to uncritical adherance to any religion or ideology.
Of course, Christians instead look to the external and supernatural God as the absolute, and this leads to inevitable disagreements I have with some of Peterson’s ideas.

The first problem with marrying Peterson’s ideas to Christianity is the latter, Catholicism especially, is actually the exact opposite of a myth-based religion, and the Church Fathers were quite explicit about this – the historical evidence shows that many people risked everything for their belief they witnessed miracles and a physical resurrection. There is very little ambiguity or room for interpretation about their claims, whether one believes or not. Our faith also goes to extraordinary lengths to emphasise the physical, encouraging the veneration of the Blessed Sacrament, historical figures, statues, relics, etc. And many works of art were created with an astounding level of realism – for a while that was the cutting edge of what mankind could acheive in the West. In Christ and the saints we find, not abstracts, archetypes and mythical heroes, but humans that anyone could emulate. There must have been a strong reason why this succeeded the older mythical traditions Peterson has interpreted.
There is an even more esoteric element to this, among the attempts to explain various doctrines, examine the meaning behind them and search for what’s absolutely real. If you explore the scholastic works, you’ll find an understanding of the world we typically experience as an abstraction of a deeper layer of reality. I have experienced an intimation of this myself last year at the Grotte de Massabielle in Lourdes, but I’d struggle to describe that experience in any understandable way.
The general point here is that one could believe or disbelieve. What we can’t do is reconcile faith and rationalism by some vague, and frankly useless, interpretation of mythology.

The next thing I disagree with is Dr. Peterson’s assertion to the effect ‘happiness is a pointless goal‘. What are meaning and purpose if not preconditions for happiness? Happiness is actually such a valid goal that we could argue it’s the very point of human existence, and many philosophers have set their minds to this. This is no trivial undertaking, as one must decide precisely what true happiness entails and how to live a good life. As Peterson himself said: ‘the principal discovery of early mankind is that “God” can be bargained with, through sacrifice – which is no more than saying if you sacrifice the pleasures of the present, reality is likely to reward you in the future. It’s not guaranteed, but it’s the best option you’ve got.
The clearest example of this is someone earning a satisfying career through having the self-discipline to acheive a 1st class degree in a demanding field of study.
True happiness could very well entail living a monastic life, being occupied with meaningful work, or simply having an ideal circle of friends. Or perhaps it might entail a life of absolute hedonism, if you could live without regrets. Perhaps it would entail leaving your job, starting a business and accumulating the wealth to achieve something more meaningful.

There has long been recognised a relationship between virtue and happiness, and the conflicts betweeen good and evil are really conflicts between our intellects and impulses.
But how could we know what counts as virtues, and what guides conscience? This is where we get to the central point: objective morality and first principles. Without God, or more precisely the conviction that God exists, I can’t see how fundamental rights could be ‘self-evident’ truths, or something more than what we decided for ourselves. And without this, you’re left with a rather transient morality that happens to be the prevalent in society, a matter of consensus that might disregard fundamental rights whenever they’re inconvenient.

Line Wrapping in the nano Editor

Tags

, ,

Using the justify feature (Ctrl+J) would insert hard line breaks, which made the text look disjointed in other editors. The following entries in /etc/nanorc should sort the issue:

set softwrap
set tabsize 4
set fill 90

I’ve tested whether this was soft wrapping by opening the test file in Vim and XWPE.

Other Things
There is also a spell checker, which I never actually use. Install aspell and uncomment the following in nanorc:
set speller aspell "aspell -x -c"

To show the cursor position at the foot of the editor:
set constantshow

Some Thoughts on the Future of Traditional Martial Arts

Tags

, ,

Aikido’s popularity may be in decline, according to Josh Gold’s research at Aikido Journal, but is it really in crisis? He says: ‘Interest in aikido has declined an average of -9.3% per year over the last five years. The spike in interest in November 2015 correlates to the release of a Walking Dead episode featuring aikido.

Only a small minority of people have more than a cursory interest in taking up a martial art, and Aikido is one option among many. Aikido isn’t a brand or a ‘household name’, we could say, that has a presence in the mainstream. Still, an 86% decline of interest between 2004 and last year should raise questions.

The trends for just one search term doesn’t tell us much about the situation, though. We’re pretty well-known in the Rhondda valleys, and often people join because they’ve heard about us from friends, and friends of friends. Evidently some organisations are doing better than others. The statistics might also have been significantly offset by people using ‘aikido + [location]‘ as a search term, instead of just ‘aikido‘.

Still, far more people were (and are) interested in MMA, which I expected:

This looks pretty damning, no? Well, it’s actually not as damning of Aikido, per se, as it first appears. If you compare the trends for ‘martial arts’ and ‘aikido’, both appear to be on the same trajectory, and changing the date range seems to confirm this. So, I could argue that interest in the traditional martial arts in general is in decline.

I decided to look at the trends for ‘aikido’ and ‘sports club’, and the graph is interesting.

Here we have something of a correlation between the interest in sports clubs and interest in Aikido, though the trend for the former is more gradual.
So, the good news is that the problem doesn’t appear intrinsic to Aikido. The bad news is the trends suggest a declining popularity of traditional martial arts and perhaps fewer people engaging in physical activities socially. Aikido is a casualty of this.

When you ignore the comments dealing with the political issues within Aikido, there’s the general sentiment that the underlying problem is societal, and I’m inclined to agree. We live in an individualistic society without ideals, direction or positive role models, and we’re collectively driven by the need for instant gratification. I think the lack of role models in particular is a major problem, especially for young men.
Modern culture has again turned to pagan deities, in the form of superheroes who don’t have any real character development that anyone could emulate. This is important, because movies were a major gateway to the martial arts in the 80s and 90s, and it was implicit, either through the storyline or the actors’ histories, that human legends were made through years of hard practice. Just about anyone could become like Stalone, Norris, Seagal, Lundgren, van Damme, etc. if they really tried.

Yet I don’t think there’ll be a consensus on what the underlying problem is, or even whether it’s a problem to be solved, as was pointed out in the comments:
I do miss those root causes which are only hinted at (“many factors”). Yet, a few lines further down a solution is suggested and it involves Aikido Journal taking the lead. While I appreciate the enthusiasm and engagement this seems a bit premature and I am not sure whether Aikido Journal or its community is even the right tool / audience to resurrect interest in the Art.

Solutions?
For what it’s worth, past experience has taught me a few things: Anyone seriously invested in a martial art needs a community that’s going to provide support, encouragement, knowledge and a channel to vent frustrations and share ideas. This is where Aikido Journal, AikiWeb, the Aikido subreddit and similar forums have an important role to play.
Secondly, the idea of being relevant to modern society should be approached with caution, lest it be confused with trying to be all things to all people. We must seek to adapt, but preserve the traditions, standards and principles that make Aikido worth practising.
Lastly, as Josh Gold quite rightly stresses, it’s important that everyone has the opportunity to play a role in their organisation or community. Even a junior grade can help in the teaching of a beginner, and anyone can be involved in the preservation of Aikido’s history and traditions or researching the history.

Teaching Methods
Something that’s always bothered me is how we (yes, myself included) introduce beginners to Aikido, but I haven’t found a way around this. There’s nothing worse than wondering why the hell you’re spending the first six months grabbing each others’ wrists and learning how to roll around on the floor. Especially given there’s more impressive stuff and self-defence techniques on YouTube you could learn instantly. We’re in the awkward situation of practising a very effective martial art, a martial art that has some real advantages when the self-defence applications eventually become apparent, but an art with a damn slow learning curve for most people. Again, I don’t know any shorter way of passing on the secret – you perform the techniques a hundred times before you get it right. As one commenter put it, ‘Most, if not all sensei, have internalised Aiki by osmosis‘.

On a related point, demonstrating and explaining the relevance of static techniques to self-defence is important. We should be explaining how one progresses from countering wrist grabs to countering right-hooks, straight punches and stabs, and how effectively things are done at advanced levels. There’s always an eagerness on my part to teach this. In truth, I don’t think junior an intermediate grades are doing enough Randori and improvisation to experience this for themselves.

A third point is made by Gold:
The sensei who spend the majority of their professional time teaching, researching, developing training programs, and mentoring students, are a key asset in the aikido world. If our art can’t sustain enough professional instructors, instructor quality will decline […]

While I agree that such instructors are an asset, we have to be realistic. Instructors who are able to pursue Aikido as a full-time profession are a tiny minority, if they exist at all here in Wales. But is that really such a problem? Currently Aikido already has something resembling a common syllabus, the standards are pretty high for being awarded the black belt, there are special classes for senior grades, and we have the opportunity to train several nights per week. And let’s not forget the Internet gives us access to historical material that the old-timers didn’t have.

Instructor/Student Ratio
When I take a look at our organisation’s membership, it seems pretty obvious that Dan grades (black belts, if you prefer) and the senior grade classes are the core of our organisation. You could say there are about twenty black belts and maybe seven junior grades (not counting the very young children). But I don’t see this as a bad thing. In fact, if the ratio was switched, I’d be worried. By this, I don’t mean the junior grades aren’t important, but rather, the coloured belt system is just the initial few steps of a decades-long journey.
Nobody here is awarded a senior grade without proving themselves, without developing self-discipline, perseverance, humility, mental strength and the resilience to overcome failure. And this process is physically and mentally tough. That’s probably why Aikido will always remain a minority thing.