Obsolete sub-procedures

Introduction

This page contains various small procedures that should either be removed or moved to a proper page. They are only here because I have not decided which of those to apply yet.

Configuring desktop environment *before* logging in for the first time!

  1. To work around the user’s desired umask not being respected, do the following:
    1. Once only – i.e. not per user do the following:
      1. Log in as root on a text console.
      2. Create file /usr/share/xsessions/xsession.desktop containing:
        [Desktop Entry]
        Name=Xsession
        Exec=/etc/X11/Xsession

        (Note that pcms will create this file so pcms-based installations don’t need this step.)

      3. Log out as root.
    2. Log in as the normal user on a text console.
    3. Create the file ~/.xsession containing only:
      #!/bin/bash
      . ~/.profile
      exec xfce4-session

      and make the file executable.

    4. Edit ~/.profile and add the line:
      umask <preferred-umask>     #  E.g. umask 077

      (077 is a good umask to test with since the default umask is something else.)

    5. Log out as normal user.
    6. Go to the graphical console.
    7. Start to log in but do not enter the password!
    8. Set the session type to Xsession.
    9. Enter the password.
    10. To test:
      1. start a terminal and verify the umask. (If terminals are set to be login terminals then they themselves will source ~/.profile and set the umask to the preferred value, so this is not enough of a test!)
      2. Start Thunar and use it to create a new directory then start a terminal and verify that the directory has permissions in keeping with the preferred umask.
    11. Log out and in again and verify that both the session and the umask have ‘stuck’.

    Installing Dropbox (headless mode)

    1. Run:
      wget -qO - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzfC - ~
      DISPLAY= ~/.dropbox-dist/*/dropbox
    2. After a few seconds it will display a URL to visit.
    3. Go to the URL, log in to Dropbox and thereby allow your computer to access Dropbox.
    4. If you wish to relocate your Dropbox folder then:
      1. Stop the running dropbox process by pressing CTRL-C.
      2. Run:
        ~/.dropbox-dist/*/dropbox       #  i.e. not headless
      3. If the blue circle is turning in the Dropbox systray then right-click on the icon and select ‘Pause Syncing’.
      4. Right-click on the icon and select ‘Preferences’, then go to the ‘Sync’ tab, then click on ‘Move’, then select the new folder location.
    5. Stop the running dropbox process by pressing CTRL-C.
    6. If you did relocate your Dropbox, then you might want to create some symlinks at this point.
    7. If you want to start Dropbox automatically on a machine that hosts your home directory (typically a laptop or your only desktop at home):
      1. Go to Settings Manager–>Session and Startup–>Application Autostart–>Add and add:
        • Name: Dropbox
        • Description: (blank)
        • Command: bash -c ‘exec ~/.dropbox-dist/*/dropbox’
      2. Log out and in again to check it starts.

      or if you want to start Dropbox automatically on a machine that does not host your home directory (typically your home would be hosted on an NFS server) then some additional logic is needed to ensure you only run it on one host even when your home directory is accessible from several hosts: (Note that Dropbox currently doesn’t support NFS!)

      1. Add the following to your startup files (probably ~/.profile but Alexis uses ~/.envrc and ~/.profile):
        #  some site-specific logic to set DROPBOX_ENABLED_FLAG
        ...
        
        # Start headless Dropbox
        DROPBOX=~/.dropbox-dist/*/dropbox
        DROPBOX_LOCKFILE=/var/tmp/$LOGNAME-dropbox-$(uname -n).pid
        if $DROPBOX_ENABLED_FLAG && \
                [ -x $DROPBOX ] && \
                { [ ! -f $DROPBOX_LOCKFILE ] || ! kill -0 `cat $DROPBOX_LOCKFILE` 2>/dev/null; }; then
            bash -c "DISPLAY= setsid -w $DROPBOX < /dev/null > /dev/null 2>&1 & echo \$! > $DROPBOX_LOCKFILE"
        fi
        
      2. If your terminal application is configured to make your shells login shells then start a new terminal, otherwise log out and in again to check that Dropbox starts.

    I DON’T USE THE DESKTOP CLIENT ANY MORE: Nextcloud

    Nextcloud app for photo transfer does not work reliable. So skip this section; I’ll revert to Owncloud soon.

    1. Set up nextcloud email address via nextcloud web gui.
    2. Add nextcloud to the login session.

    OBSOLETE?: Miniscule fonts after switching monitor?

    1. Go to Settings Manager–>Appearance–>Fonts and disable any custom DPI setting.

    OBSOLETE?: XFCE tweaks

    Skip this section – I believe it is no longer needed since upgrading to Debian 10.

    1. Under ‘Window Manager Tweaks’, set:
      • Activate focus stealing prevention: off (otherwise Thunderbird’s calendar plugin can’t pop up alerts on top of other windows)
      • When a window raises itself: do nothing
      • Honour standard ICCCM focus hint: off

    DON’T REMOVE UNTIL RAGU REINSTALLATION: Issues with analogue audio levels when there is an HDMI-connected TV

    PCMS already handles most of this by commenting out the following line in /etc/pulse/default.pa:

    #load-module module-switch-on-port-available

    But issues with audio levels changing persist. This solution is taken from here.

    1. Use alsamixer to get the levels correct. Pay attention to the following issues:
      • if a music player is playing some music and the TV is on then can both be heard?
      • is there any distortion?
    2. Run:
      alsactl --file ~/.config/asound.state store
    3. If the problem reoccurs then run:
      alsactl --file ~/.config/asound.state restore
    4. To do this automatically, consider creating ~/.config/autostart/alsarestore.desktop containing:
      [Desktop Entry]
      Type=Application
      Terminal=false
      Name=alsarestore
      Exec=bash -c "sleep 5 && alsactl --file ~/.config/asound.state restore"
    5. See also: Howto save AlsaMixer settings

    OBSOLETE?: Finalising SSH

    1. If necessary update root’s authorized_keys files and id_* files.

    OBSOLETE?: Finalising packages

    1. Remove any old kernels and support packages. The following command will help:
      dpkg -l | grep linux-image | awk '{ print $2 }'
    2. Also run dpkg fgrepping for just the old kernels’ version numbers as this may reveal related old packages.
    3. Find packages which have been removed but not purged and clean up. The following command will help:
      dpkg -l | sed -e '1,5d' | grep -v '^ii'
    4. Run:
      deborphan

      examine the output and possibly remove listed packages.

    5. Repeat the last step until nothing further can be removed.
    6. Run:
      apt-get --purge autoremove
    7. Review what dictionaries and wordlists are installed.
    8. Run:
      apt-get clean
    9. Save the list of packages installed by running:
      debfoster -nq

    fiori and torchio “sdc” problem

    1. On fiori and torchio’s, whose LVM commands report /dev/sdc: open failed: No medium found due to these systems having a SD card reader, with no SD card in it, add the following to root’s crontab:
      0 * * * * [ ! -d /sys/block/sdc/ ] || echo 1 > /sys/block/sdc/device/delete

      (Note that that is on the assumption that fiori and torchio have two internal disks.)

    See also