SV3200 Enable ssh Login

So you got yourself a shiny new HPE StoreVirtual 3200 device.  Now you want to login to the controllers over the network with ssh.  But by default, it’s not enabled (a good thing from a security point of view).

To enable it, go to the CLIQ> prompt on the 4th USB serial console, and enter:

setSupportLogin enabled=true

This allows what HPE calls a Support Login, which allows for ssh on the default port 22 to root@<your-bond-ip-address>

But now you have to deal with the OTP process: HPE’s one-time-password scheme that’s based on SKEY.  For that, you’ll need to work with an HPE support technician to go thru the challenge and responses, that will eventually get you logged into root.

Once a root user, you will want to bypass this OTP mechanism.  Fortunately HPE uses the standard Pluggable Authentication Mechanism (PAM), and provides both the SKEY mechanism as well as the standard one.  You want to switch it to the standard method.  It’s as simple as changing a softlink:

cd /etc/pam.d
ln -sf /etc/pam.lhn/sshd.std sshd

That should do it.  Now when you login as root via ssh, it’s a “normal” login!

One more thing, tho.  If you created users via the Web UI, and want to login to a shell for them, note that the web UI makes their default shell be CLIQ.  To change this, edit /etc/passwd and change the home dir and shell to something like /bin/bash .

Install Ubuntu MATE 16.04 on RAID 1

Task:  Install Ubuntu MATE 16.04 (or any similar Debian Linux O/S) on RAID 1 disks

Reference:

  • http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
  • http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi

Given: Two disks, /dev/sda and /dev/sdb; using MBR tables. (GPT is similar but you’ll need to set the bios_grub flag).

Simple single RAID set (/dev/md0) created from the two disks.

Boot into the Ubuntu live-installation; open a terminal window.

Partition the disks

# parted -a optimal
unit MiB
# Do first drive
select /dev/sda
mktable msdos
mkpart primary ext4 1 -1 # uses all the space excet 1MiB at front for boot area
set 1 raid on
# Repeat on second drive
select /dev/sdb
mktable msdos
mkpart primary ext4 1 -1 # uses all the space excet 1MiB at front for boot area
set 1 raid on
# Done
quit

Stop the auto-detected RAID: Sometimes (if you already have mdadm installed) the live-instance of Ubuntu that you’re running will autodetect the just-created RAID partitions and build the array. You don’t want this yet, so stop it:

# cat /proc/mdstat

If you see any, like /dev/md127 or whatever, stop it:

# sudo mdadm --stop /dev/md127

Create file systems in here, really not needed but I do this to start “clean” on the disks before RAID overwrites this. It leaves some identity info out there anyway; for example, a ‘print’ in parted shows the filesystem type.

# sudo mkfs.ext4 /dev/sda1
# sudo mkfs.ext4 /dev/sdb1

Build the RAID array.

Install mdadm (onto the Live distro, not the final system)

# sudo apt-get -y install mdadm
# sudo mdadm --create /dev/md0 --bitmap=internal --level=1 --raid-disks=2 /dev/sda1 /dev/sdb1

Partition the RAID array

# sudo parted -a optimal /dev/md0
unit MiB
mktable msdos
mkpart primary 1 16GB # Swap partition, use whatever size you need
mkpart primary 16GB -1 # The rest for / (root partition)

Now install Ubunto onto the new RAID array – but NOT the bootloader yet (-b); you must handle that special.

# ubiquity -b

During the install, select “Something else” for the disk layout.
Choose the swap and root partitions on the /dev/md0 device for the install.
Check the “format” box to format the root partition as ext4.
Let the install run, this uses much time…

Do NOT reboot yet – it will fail. You must manually install the bootloader onto each disk.

sudo -s
mount /dev/md0p2 /mnt
mount -o bind /dev /mnt/dev
mount -o bind /dev/pts /mnt/dev/pts
mount -o bind /sys /mnt/sys
mount -o bind /proc /mnt/proc
cat /etc/resolv.conf >> /mnt/etc/resolv.conf
chroot /mnt
apt-get install mdadm
vi /etc/grub.d/10_linux  # change quick_boot and quiet_boot both to 0
grub-install /dev/sda
grub-install /dev/sdb
update-grub
exit

Negated getopt long-form options: to dash or not to dash?

Is there a standard or convention that specifies the long-form option negation prefix for a CLI?  That is, which is correct?:

  --nodaemonize
  --no-daemonize

I looked thru the POSIX specs, the Getopt::Long parsers, the manpages for getopt() and getopts(), and found nada!  So what’s a coder to do?  Write a Perl script, of course!  I wrote script that parsed thru the entire man(1) set of pages, and pulled out both forms of negated long options.  Here’s the result:

  Without dash (no):  368 unique options
  With dash (no-):   1135 unique options

And the winner is… BOTH forms!  There is no standard for it. The with-dash form was preferred 3:1, but that’s not enough margin to call it a clear winner.

What was apparent is for a single utility, use ONE OR THE OTHER.  Don’t ever mix them for a single utility.  And there you have it.

Defacto-standard for Linux/UNIX CLI options

== DRAFT ==

Although there’s no need for a standard usage of the getopt() long options, we have only 2 x 26 = 52 available switch characters for the older short options.  (Actually, more, ‘cuz we can do things like -4 or -# or -@ for switches.  Regardless…)

Because choices are limited, a defacto standard has emerged — 30+ years in the making — for the short options:

  -f   --force, sometimes -f is used for a config file
  -h   --help
  -o   --output (to the named file, for example) (rarely: -o optionname=value)
  -v   --verbose
  -q   --quiet

The above are almost universally used, while the following are “frequently” used:

-a    --all or --append; or a start time (the --at-time)
-c    --configuration-file  or related .conf option, sometimes -f is used for this (but -c preferred)
-d    --debug or  sometimes --directory
-D    --no-daemonize or --disable
-e    --error;  send to stderr instead of syslog
-E    --enable
-g    --group(s)
-i    --interactive, --identity or some identity related thing, sometimes --ignore
-l    --long or --lengthy, such as include details (different than verbose); or --log-level, or --list
-n    --count, any numerical thing
-p    --port or --priority
-r    --recursive
-R    --alternate-root or --root, also -R (uppercase) sometimes used for --recursive
-t    time-related things
-T    test related things, especially test timeouts
-u    --user or username or submitter things, sometimes -l used for this (think l = login name)
-V    --version (uses uppercase V because lowercase v means verbose)
-w    a web-related thing, such as a URL
-x and -X    X11 things.  Historically, the upper/lowercase meaning is reversed; 
        lower is disable and upper is enable it -- this is opposite normal convention.
-y    --yes, take the affirmative or default action instead of prompting; also -y used to mean syslog
-z    --colorize-output
-4    IPv4
-6    IPv6
-#    Any numerical limit  (avoid this tho, it causes problems in shell scripts)

And a defacto convention is that the lowercase form is used to invoke an action, while the uppercase form is used to suppress an action.  For example,

 -z (lowercase) typically means to colorize the output
 -Z (uppercase) means to NOT colorize the output, implying it's colorized by default.

But uppercase can also have conventional meanings, too.  Such as -R for an alternate root.

These aren’t absolute, and there’s plenty of commands that don’t follow the above, but there’s more that do.  If you’re writing a new utility or command, please try to follow the above!  The community will thank you!

AlphaMonth – A proposal for new month names

== D R A F T ==

The ISO 8601 standard would have us write dates like 1953-06-05, which is fine and better than much of what we see out there.  However I still like names for months — but I dislike that the current names in chronological order are not in alphabetical order.  Let’s fix this!

If we have new names that are also alphabetical when laid out chronologically, then they sort nicely on computers and they’re easy for humans to parse.

Below are my proposed new month names, and their three letter abbreviations. The above date could then be written 1953-Ion-05, and perhaps a single letter abbreviation of 1953-I-05.

 Current       New       3LA
---------     ------     ---
January       Anu        Anu
February      Ebrem      Ebr
March         Farem      Far
April         Gaprem     Gap
May           Haem       Hae
June          Ione       Ion
July          July       Jul
August        Lugast     Lug
September     Membem     Mem  (perhaps Nembem "Nem")
October       Octem      Oct
November      Povem      Pov
December      Recem      Rec

Do these names have a current meaning?  Is there a lexical collision?

Anu — Sanskrit: atom or molecule (good for the beginning month of the year); in Hawaiian means cold; there are other inconsequential meanings.

Ebrem – Nothing found

Farem – Nothing found

Gaprem – Nothing found

Haem – (Biochemistry) biochem a complex red organic pigment containing ferrous iron, present in haemoglobin; also British variant of “hem” as on a skirt or dress.

Ione – Greek origin, a violet flower

July – The month as today.  If we alter it to follow the -em pattern, it becomes Julem (no definition found), but close to the river Jhulem

Lugast – Nothing found; but close to “lugas”, a bower, arbour, or trellis.

Membem / Nembem – Nothing found

Octem – Nothing found, but based on the “Oct-” prefix (eight)

Povem – Nothing in English, but in Turkey its a form of therapy; in slavic languages its a semi-supplative stem word.

Recem – Nothing significant; a common error word from an OCR system reading “recent”; in Brazilian it means a newborn baby.

These new month names also have little meaning in the world’s other languages, so they should find easy acceptance there as well!

To work out:

  • Is it asking for trouble to have months begin with “I” and “O”; because they could be read as the digits 1 and 0?
  • Double check if the above are existing words with some present meaning.
  • Should I go all-in, and make all the months end in “-em”?  Anu => Anem, Ione => Ionem, July => Julem, and Lugast => Lugem?  But somehow it feels more natural that there are some “adopted” names in the list… I dunno.
  • Would “Mem” — the 3LA for Membem — get confused too much with “memory”, often seen in computing?  I could be convinced to go with Nembem (Nem).
  • Possible alternate for Ebrem (february) is Erem: from the greek meaning lonely and solitary, or desert.  Also appropriate for February.

Finally, there’s the idea to just add a prefix letter to existing 3LA’s making 4LA’s like: AJan, BFeb, CMar, … FWIW.

1LA’s for the Days of the Week

You’ve all seen it: The days of the week abbreviated to a single letter, done as so:

   M  T  W  T  F  S  S

Really?  Two T’s and two S’s?  That’s rather lazy, and ambiguous!  Here’s the better way:

   M  T  W  R  F  S  N

You’ll see that thuRsday uses an “R”, and suNday uses an “N”.  Much better!  By the way, I know from personal experience that this better system has been in use for over half a century. Have we forgotten history again?

A skateboard, a girl, and a leaf blower (physics fun)

What happens when you put a small girl on a skateboard with a running leaf blower?  It’s a=m÷F !  Apologies for the bad video at the end, as grandmotherly instincts took over.  The young girl – brave granddaughter Noella – learned a new way to have fun!  The leafblower and skateboard were not harmed during the production of this film.