Ubuntu

Quick Links

my DNS servers Free DNS @ afraid.org OzHosting
useful links WhoIs database Rebuilding Ubuntu from scratch
(current version 18.04)
Ubuntu Samba Server configuration NFS
programming ArgParse stdout encoding Processing Text Files in Python 3
Usage Downloading Photos
Disasters A sad, sad tale of a lonely orphan
Ubuntu (well, 2 orphans, actually)

Useful Tips

These are tips I have gleaned that describe useful (?) customizations in Ubuntu (13.10 - now 17.04). To find out what version of Ubuntu is running, type lsb_release -a into a terminal window at a shell prompt.

ls -l explanation

I had trouble finding out what the columns in an ls -l listing mean. Here is an explanation from MKSSoftware:

Long Output Format

The output from ls -l summarizes all the most important information about the file on one line. If the specified pathname is a directory, ls displays information on every file in that directory (one file per line). It precedes this list with a status line that indicates the total number of file system blocks (512 byte units) occupied by the files in that directory. Here is a sample of the output along with an explanation.

    -rw-rw-rw- 1 root   dir 104 Dec 25 19:32 file

The first character identifies the file type:

    -    Regular file
    b    Block special file
    c    Character special file
    d    Directory
    l    Symbolic link
    n    Network file
    p    FIFO
    s    Socket

The next nine characters are in three groups of three; they describe the permissions on the file. The first group of three describes owner permissions; the second describes group permissions; the third describes other (or world) permissions. Because Windows systems do not support group and other permissions, these are copies of the owner's permissions. Characters that may appear are:

    r    Permission to read file
    w    Permission to write to file
    x    Permission to execute file
    a    Archive bit is on (file has not been backed up)
    c    Compressed file
    s    System file
    h    Hidden file
    t    Temporary file

On Windows systems, most of the permissions shown are artificial, with no real meaning. The w bit is set according to the ReadOnly attribute, and the rx bits are always set on.

You can change some permissions with the chmod command.

After the permissions comes the number of links to the file.

Next comes the name of the owner of the file or directory. On file systems that don't support 7/2008R2/8/2012/10/2016 security, the owner name cannot be determined and the owner ID number is displayed instead. Under 7/2008R2/8/2012/10/2016 the name of the owner of a file is displayed if the file's SIDs can be obtained and if these SIDs have an associated name in the SAM database. If the file has a SID associated with it, but the name of the SID cannot be determined, then the value of the SID is displayed. (This can happen when the current user is not in the domain that was used when the file was created.) If the file does not have a SID (for example, if it is on a non-NTFS file system), or if the file security information cannot be accessed because the file is locked by another process, then the user name appears as <unavail>.

Note:

    When a listed file is owned by the local computer, the owner is displayed as computer_name\ where computer_name is the name of the local computer.

Then comes the name of the group that owns the file or directory. On Windows systems, the same rules are followed for the group name as for the owner name.

Following this is the size of the file, expressed in bytes.

After this comes a date and time. For a file, this is the time that the file was last changed; for a directory, it is the time that the directory was created. The -c and -u options can change which time value is used. If the date is more than six months old or if the date is in the future, the year is shown instead of the time.

The last item on the line is the name of the file or directory. 

Naming a Disk

To (re)name a disk using Ubuntu:

  1. Go to disk app (through Unity Dash or terminal with gnome-disks command)
  2. Choose your partition
  3. Click the little gear icon Gear icon
  4. Select Edit mount options
  5. Toggle Automatic Mount Option to Off
  6. Edit mount point to /media/ajh/new name
On a side note, this will also enable your partition to be mounted automatically on start up, If you don't want that to happen then make sure to
  1. Un-mark Mount at Startup
You'd want to do this if your Bootup times are slow

NFS

There is a useful tutorial on how to setup NFS mounts at https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04

Rotate Console

When using a portrait monitor, or a monitor with rotating screen, you can rotate the display to suit according to the following parameter values:

For transient rotations, use

echo 1 | sudo tee /sys/class/graphics/fbcon/rotate

and for permanent rotation, (sudo) edit /etc/default/grub to ensure that it contains a line:

GRUB_CMDLINE_LINUX="fbcon=rotate:1"

In both cases, substitute the 1 with the required rotation parameter.

Make Print Directory

I got a bit fed up with make printing directory entry and exit messages when recursively making, so I added this to my master make directory:

          ifndef MAKEFLAGS
            MAKEFLAGS += --no-print-directory
          endif
        
The general advice is that if you want to debug makes that do use recursive makes, then you should turn this off (and resume printing the entry and exit messages).

Workspace Configuration and Shortcuts

To enable multiple workspaces:

  1. Open System Settings -> Appearance -> Behaviour
  2. Click on the Enable workspace checkbox

To change the nuumber of workspaces:

  1. Type gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ hsize 3 to change the number of columns to 3
  2. Type gsettings set org.compiz.core:/org/compiz/profiles/unity/plugins/core/ vsize 3 to change the number of rows to 3

To change the keyboard shortcuts for navigating between workspaces:

  1. Open System Settings -> Keyboard -> Shortcuts
  2. Click on Navigation in the left side bar
  3. Edit the shortcuts acording to the instructions.

Adding user name to title bar

gsettings set com.canonical.indicator.session show-real-name-on-panel true/false

The last word (true/false) turns on the display of the user name in the root window title bar (if true), and false turns it off.

Creating multiple machine pulldowns for remote terminals

These are my settings for the gnome-terminal configuration file /usr/share/applications/gnome-terminal.desktop. Actually, the proper place for this file is /home/ajh/.local/share/applications/gnome-terminal.desktop, which is now where it is placed. The /usr location is for system-wide defaults.

[Desktop Entry]
Name=Terminal
Comment=Use the command line
Keywords=shell;prompt;command;commandline;cmd;
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=utilities-terminal
Type=Application
X-GNOME-DocPath=gnome-terminal/index.html
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-terminal
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=3.6.1
Categories=GNOME;GTK;Utility;
StartupNotify=true
OnlyShowIn=GNOME;Unity;
Keywords=Run;
Actions=heywood;heywood-root;dimboola;echuca;spencer;
X-Ubuntu-Gettext-Domain=gnome-terminal

[Desktop Action heywood]
Name=Heywood
Exec=gnome-terminal --window-with-profile=Heywood

[Desktop Action heywood-root]
Name=Heywood-Root
Exec=gnome-terminal --window-with-profile=Heywood-Root -x ssh root@localhost

[Desktop Action dimboola]
Name=Dimboola
Exec=/usr/bin/gnome-terminal --window-with-profile=Dimboola -x ssh dimboola

[Desktop Action echuca]
Name=Echuca
Exec=/usr/bin/gnome-terminal --window-with-profile=Echuca -x ssh echuca

[Desktop Action spencer]
Name=Spencer
Exec=/usr/bin/gnome-terminal --window-with-profile=Spencer -x ssh spencer

Make sure when editing the Desktop Actions that you add the "Name" field to the list of "Actions" in the top entry.

The other thing to note is that when you first create this file, you need to make it executable, and then drag it from the Files display to the Launcher bar. If the file is not visible in Files, click View->Show Hidden Files to make it visible.

The desktop file syntax is described in the Desktop File Specs page.

Samba

I am running a samba server on my disk farm server. Here's a useful page on how to configure a Ubuntu Samba Server.

Unix Stuff

To set the system timezone to Melbourne

      $ sudo bash
      $ cd /etc
      $ ln -sf /usr/share/zoneinfo/Australia/Melbourne localtime
    

Moving to Ubuntu

I got the irrits with Apple and have sworn not to buy a new system or upgrade the systems I have, preferring instead to move (back) to Linux as necessity demands. But Ubuntu has its own irrits, too! This is a log of things that I have fixed.

Virtual desktops

Mac OSX calls them "Spaces", Ubuntu calls them "Workspaces". I prefer "Virtual Desktops". Oh well. You can't please everyone.

The hassle is that there is no clear way of driving the number of them, and how to switch between them.

Setting Up
Go into the System Settings > Appearance > Behaviour, and check the box "Enable workspaces". This sets up the default 2x2 workspaces.
Changing the Number of Workspaces
Make sure that "CompizConfig Settings Manager" is installed (use the "Ubuntu Software Centre" to search for and install this). Then follow General Options > Desktop Size, and set the Horizontal Virtual Size and Vertical Virtual Size to your preferences. Close the CCSM.
Showing the Virtual Desktops
You show see an icon in the launcher that looks like this one (it may have a background colour to match the launcher). If you click this icon, a representation of the workspaces available will be shown. Click it again to dismiss, or click inside any of the workspaces to switch to that workspace.
Keyboard Shortcut to Switch Workspace
CTRL-ALT-arrow will change to the next workspace in the direction of arrow.

Emacs and PSGML

One of the hassles of upgrading a system (and moving from Apple to Linux counts as an upgrade) is that new versions of just about everything surface, just when you are not in the mood for dealing with them. I suppose the Nathans of the world would argue that this is why one should upgrade continuously, so that the Principle of Least Surprise is observed. Whatever. Moving to Ubuntu forced my Emacs from version 23 to version 24, and my PSGML scripts all stopped working.

Fortunately, PSGML has also been upgraded to now run with version 24. See the page by the author, Florian v. Savigny, or download the code directly

Some Ubuntu Problems in Ubuntu 18.04

(As of August 2018)

wallch

wallch does not run correctly, and keeps crashing. One point is when you start the window (type just 'wallch' in a terminal window) and click 'start'. The first time it does nothing, the second time, it crashes with a floating point exception.

It does work if you type 'wallch --start' at a terminal prompt.

vlc

vlc comes up with very small text, too small to read. I have traced the steps offered in (URL cite) by clicking in the right real estate territory, but nothing changes.

There is also a problem with .wtv files having no sound. I fixed this on one computer (a generic Intel box) where the font size was readable, but could not on the other computer (an iMac).

CD rom

This may be a problem with very old CDs, but many of my collection not only do not mount, but they also put the CDrom into a frozen state, where the only recovery option is to reboot.

Workspaces

I dislike workspaces only partly appearing when the 'super' key is pressed, and you have to move the mouse into the sidebar to see the workspace icons. Why not blow the Icons out immediately?

lizard fs

files has a big problem with lizardfs, and refuses/takes a very long time to display some subdirectories of a lizard mount. The same subdirectories list correctly when displayed with ls.

backup

again, perhaps a lizardfs issue, but backup keeps failing with a /lizard mount save directory.

firefox

Firefox refuses to display some images in my web pages - the images can be opened successfully from the command line, and have the correct permissions. The problem seems to be one of just not wanting to load the relevant files.

Downloading Photos from Samsung S8

I switched to using Dolphin as my file manager window, but it does not recognize my Samsung S8 when it is plugged in. Use the old 'files' for this purpose: it does work.

This page is copyright, and maintained by John Hurst. 972 accesses since
28 Dec 2017
My PhotoMy PhotoTrain Photo

Local servers: Localhost Newport Burnley Hamilton Echuca Heywood Richmond Spencer (Note that these are only accessible on my local network.)
Public Web Servers: Hurst Server/ajhurst.org Home Server/ajh.co CSSE Server Internode Server (In order of preference; not all of these may be active.)
Dynamically generated at 20181210:1038 from an XML file modified on 20181121:1731.

975 accesses since 28 Dec 2017, HTML cache rendered at 20181210:1814