20160325

Unattended-updates

How to enable unattended software updates on Linux Mint 17.x

Installation of software updates are very important in every operating system. We can either configure the installation of package updates manually or automatically, in Linux Mint. This tutorial explains you how to enable the installation of software package updates automatically in the Ubuntu-based editions. I'll be using this as a guide to activate unattended updates on linux mint.

  1. Open your terminal and run the update:
    sudo apt-get update
  2. Install the “unattended-upgrades” package; This is the package used to install the updated packages automatically:
    sudo apt-get install unattended-upgrades
  3. Next, the configuration file needs to be edited; To configure the unattended-upgrades edit the /etc/apt/apt.conf.d/50unattended-upgrades file and make changes according to your needs:
    sudo gedit /etc/apt/apt.conf.d/50unattended-upgrades
  4. Make the following changes to 50unattended-upgrades:
    // Automatically upgrade packages from these (origin, archive) pairs.
    Unattended-Upgrade::Allowed-Origins {
    "${distro_id} ${distro_codename}-security";
    "${distro_id} ${distro_codename}-updates";
    // "${distro_id} ${distro_codename}-proposed";
    // "${distro_id} ${distro_codename}-backports";

    // You also have to add the following two Rows,
    // otherwise you'll just update the Mint-Packages.

    "Ubuntu trusty-security";
    "Ubuntu trusty-updates";
    };
    // And to minimize the tech support to friends and relatives on how to update :-D
    // Remove the //, so it's not a comment anymore, and the update will be done

    // when the PC is shut down.

    Unattended-Upgrade::InstallOnShutdown "true";
I've taken some notes and content from https://community.linuxmint.com/tutorial/view/1217 and the comments on that page to compose this reminder howto.


UPDATE 20160428: apt-get update error for Chrome

I updated chrome yesterday via the updates-manager. I also receive this error after running sudo apt-get update. The solution is to run the following from the terminal.

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -

And that did the trick for my Ubuntu 14.04, 16.04 and LinuxMint 17.3 systems. A big thanks to dwarfijazzer on UbuntuForums for the answer!

20160312

Fermenting Food

A quick list for pickling food in mason jars.


  • Mason Jar
  • 1 cup White Vinegar
  • 1 cup Water
  • 1 Tablespoon Pepper (Red, Yellow, Green; your choice)
  • 1 Tablespoon Peppercorns
  • 2 Teaspoons Salt
  • Other spices and flavors you may want
  • 2 Cups Produce
Directions:
Boil Vinegar Water and Salt.
Add Peppers and Seasoning to Very clean jar, then add Produce.
Pour brine into jar so at to cover the produce.
Put Lid on tight and wait for it to cool to room temperature. You should hear the lid "pop" as it seals.
Place in cool  dark shelf, or in refrigerator if lid does not seal.
Good for 4-6 months on shelf and 4-6 weeks in refrigerator.

20160308

Linux Terminal Commands

Simply, a reference/cheat-sheet for terminal commands.


  1. chown
    • chown username:groupname *, and let the shell expand the * to the contents of the current directory. This will change permissions for all files/folders in the current directory, but not the contents of the folders.
    • chown -R username:groupname ., which would change the permissions on the current directory, and then recurs down inside of it and all sub-folders to change the permissions.
    • chown -R username:groupname * will change the permissions on all the files and folders recursively, while leaving the current directory itself alone. This style and the first style are what I find myself using most often.
  2. chmod 
    • If you want to set permissions on all files to a+r, and all directories to a+x, and do that recursively through the complete subdirectory tree, use:
      chmod -R a+rX *
      
      The X (that is capital X, not small x!) is ignored for files (unless they are executable for someone already) but is used for directories.
  3. apt
    1. If there are GPG errors
      • sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [ALPHANUMERIC]
    2. To remove a repository
      • sudo apt-add-repository --remove ppa:name/repository
    3. To force install of dependencies
      • sudo apt-get install -f
    4. To install suggested packages
      • sudo apt-get --install-suggests install [package]
  4. dpkg errors
    1. sudo apt-get install -f -y
    2. Then re-run the previous command.
      • sudo dpkg -i --force-all appliation*.deb
  5. GVfs
    1. Mounts
      • gvfs-mount -l
      • Volume(0): xxxxx@gmail.com
          Type: GProxyVolume (GProxyVolumeMonitorGoa)
          Mount(0): xxxxx@gmail.com -> google-drive://xxxxx@gmail.com/
            Type: GProxyShadowMount (GProxyVolumeMonitorGoa)
        Mount(1): xxxxx@gmail.com -> google-drive://xxxxx@gmail.com/
      • If unmounted, it will only show Volume(0)
    2. Rules
      • cd /usr/share/gvfs/mounts then do ls
      • There should be listed a number of mount point rules.
    3. Dependencies
      • Within the directory: /usr/lib/gvfs/ are gvfs related deps.
      • Check to see if you have gvfsd and gvfsd-fuse installed.
    4. Error When Integrating Google Drive with Files
  6. Links
    1. Make
      • $ ln -s /path/to/link /linked/path
    2. Remove
      • $ rm /path/to/link/to/remove
    3. Rename
      • $ mv oldsymlink newsymlink
  7. Mounts
    1. Bind Mounts (How to use bind mounts)
      • $ mount -o bind /opt/var_log /var/log
      • You will now see this reflected when running the mount command:
        • # mount | grep var
        • /opt/var_log on /var/log type none (rw,bind)
    2. If you want this to persist across reboots, you’ll just need to update your /etc/fstab with the bind mount as well.
      • # /etc/fstab
      • /opt/var_log              /var/log                 none    bind    0 0
    3. gvfs - See GVfs
  8. GOA - gnome-online-accounts
    1. Install GNOME Control Center (GNOME System Settings) and GNOME Online Accounts:
      1. $ sudo apt-get install gnome-control-center gnome-online-accounts
    2. Launching GNOME Control Center
      1. Using a command to launch GNOME Control Center
        1. $ Exec=env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --overview
      2. Editing the GNOME Control Center .desktop file
        1. $ mkdir -p ~/.local/share/applications/
        2. $ cp /usr/share/applications/gnome-control-center.desktop ~/.local/share/applications/
        3. $ sed -i '/^OnlyShowIn/d' ~/.local/share/applications/gnome-control-center.desktop
      3. To get GNOME Control Center to display all the available panels:
        1. $ sed -i 's/^Exec.*/Exec=env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --overview/' ~/.local/share/applications/gnome-control-center.desktop
  9. Command output write to file
    To write the output of a command to a file, there are basically 8 commonly used ways.
    1. command > output.txt
      The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten.
    2. command >> output.txt
      The standard output stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.
    3. command 2> output.txt
      The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, it gets overwritten.
    4. command 2>> output.txt
      The standard error stream will be redirected to the file only, it will not be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.
    5. command &> output.txt
      Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, it gets overwritten.
    6. command &>> output.txt
      Both the standard output and standard error stream will be redirected to the file only, nothing will be visible in the terminal. If the file already exists, the new data will get appended to the end of the file..
    7. command | tee output.txt
      The standard output stream will be copied to the file, it will still be visible in the terminal. If the file already exists, it gets overwritten.
    8. command | tee -a output.txt
      The standard output stream will be copied to the file only, it will still be visible in the terminal. If the file already exists, the new data will get appended to the end of the file.