The Perils of Swapping Swap Late at Night

I recount this as a)A cautionary tale b)A reminder to myself how to get out of this mess.

Following a recent system upgrade and more memory, it was time to increase swap space for my LMDE Linux install.

It was midnight, I’d been writing Android JAVA code all day and tired what could possibly go wrong….

My swap partition was on /dev/sda5 and there was insufficient room either side to increase it. But there was a spare chunk of unallocated disk further up. “Hey” I thought, I’ll just move swap to /dev/sda12 and delete the old one that will only take a few minutes.

Ahh I’d better  change the uuid of swap in fstab . Oh  and change /etc/initramfs-tools/conf.d/resume to point at the newly selected swap partition. So I did, and rebooted. Miserably failure number 1, forgot to update-initrams. Doh!

(why oh why didnt I just change the uuid of the new swap to be the same as the old one that would have saved so much misery and the typing of this blog entry)

The change did indeed only take a few minutes, I rebooted the system and the boot hung at the resume stage.

At this point I thought, “Oh Belgium!” and went to sleep. (if “Oh Belgium” doesn’t make sense you need to read more books or listen to the correct radio comedy, does 42 mean anything to you?)

Thus next morning the following steps were taken.

Fortunately I have my systems configured with a couple of Linux Installs and Clonezilla partition(which makes doing whole system backups a lot more convenient).

At this point the plans were:

Plan A

  • Restart System
  • Move swap back to where it was on /dev/sda5
  • Give the new dev/sda5 swap the same uuid as the old one

As I wrote that down, my asleep brain realised actually an easier way would be

Plan B

  • Give the new swap the UUID of the old one
  • Put the old uuid back into /etc/fstab
  • Put the old one back into the resume file sometime as well

Plan C

  • Some hacking to do initramfs on the non bootable system

Plan C too fiddly for my patience so A and B  looked the most straightforward  but both needed me to know the UUID of the old version of swap.

Thats OK I thought it will be in my backup of fstab.

More misery followed involving, encrypted backups, downloading the wrong version of the encryption tools and finding my Centos boot didnt have the commands I wanted.

Anyway to change the swap uuid , the usual way of changing disk uuid using tune2fs was a non starter as it doesnt like swap partitions.

So the way to do it is

mkswap /dev/sda5 -U theuuid

System now rebooted and back to the fun of Andriod and JAVA.

Next time I must just change the new swaps UUID instead, much easier.

::sigh::

 

 

Posted in coding, computing, linux, LinuxMint | Tagged , , | Comments Off on The Perils of Swapping Swap Late at Night

NFC and Android

With NFC tags being so cheap, been having a play.

This is a reminder of what needs to be on an NFC  tag to make  Connectbot  open an ssh connection to a server.

It mainly comes down to remembering that you launch applictions in android via intents.

Examples of intents connectbot (an ssh client) understands are shown here

In short it looks like this:-

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="ssh" />
  <data android:scheme="telnet" />
  <data android:scheme="local" />
  <!-- format:  ssh://user@host:port/#nickname  -->
  <!-- format:  telnet://host:port/#nickname  -->
  <!-- format:  local://  -->
</intent-filter>

ssh://username@server.somedomain.com:portnumber/#nickname

Then use something like NFC task launcher to attach and open URL action to your tag.

Posted in android, computing | Tagged , , | Comments Off on NFC and Android

NineKeys

This is an application for helping to learn to read music.

There are quite a lot of sight reading practice applications for Android but none of them provided the features I wanted. NineKeys was initially written to satisfy my requirements. I wanted a better way to identify which areas of my sight reading were weakest and for the program to adapt to help correct those weaknesses.

A major part of learning is the feedback process and being shown in which areas your knowledge is lacking. This was a major influence in the design of the statistics display.

The statistics page overlays the staff with bar showing your percentage score for each note and  shows clearly which notes are giving you the most problems.

web_hi_res_512

The application operates in various modes and you can select which stave and note variations (sharps or flats) are included. The system uses an adaptive question algorithm to assist your progress (a hangover from my research work on Computer Aided Assessment)

Downloadable from the play store here

Posted in android, coding, education, JAVA, music | Tagged , , | Comments Off on NineKeys

PH_Lyrics Android Widget

As mentioned previously I have been using a database of Peter Hammill and Van Der Graaf Generator songlines as test data for various projects.  Whilst doing some Android related things I  put together a “widget”.

So as an extension to the PH Lyrics project (www.ninelocks.com/ph_lyrics) and twitter.com/ph_lyrics here is an Android widget.

The widget updates from the web every hour while the device is awake. The widget can also be tapped on to force a refresh. Its only available in the one size at the moment and sometimes it looks a bit empty when the chosen songline is a short one.

Download from here

qrcode_ph_lyrics_widget

Posted in android, computing, music, Uncategorized | Comments Off on PH_Lyrics Android Widget

Neko

The first version of Neko I was aware of was on the Apple Macintosh as a desktop accessory,but since then the code has been modified and re-written by various people so that Neko can play on a variety of different machines.

web_hi_res_512

I use Neko as a way of trying out dev tools an new platforms. So here is a variation on Neko for Android. Download here

qrcode_neko_ninelocksDownload Neko from Ninelocks.com


The history of Neko (as far as I am aware is)
neko DA (Macintosh version) © 1989 by Kenji Gotoh
xneko (X11 version) ©1990 by Masayuki Koba
Pilot version ©1997 by Hoshi Takanori
(If I have missed someone out, please let me know.)

This is an update of the version (with multiple cats) that I wrote for PalmOS and later Windows Mobile devices.

web_hi_res_512

Posted in android, coding, JAVA | Tagged , | Comments Off on Neko

ByteSplorer- A fun way to explore Binary numbers…

One thing the Android world is not short of is binary calculators but I required one with very specific functionality and behaviour. Hence ByteSplorer, available from Google Play or a direct download here.

ByteSplorer shows how the byte may be interpreted as an unsigned or signed number and its hexadecimal representation.

There are a limited number of functions as well that allow shifting (to demonstrate its effect on the value) and invert all and add 1 keys to allow experimentation with converting numbers to their to complement negative version.

ByteSplorer is at GooglePlay

device-480_320

qrcode_bytesplorer_googleGoogle Play

Posted in android, coding, computing, education, JAVA | Tagged , , | Comments Off on ByteSplorer- A fun way to explore Binary numbers…