How to Schedule Automatic Updates on Ubuntu Server 16.04

If is not there install unattended-upgrade package:

sudo apt-get install unattended-upgrades

or simply reconfigure the package:

sudo dpkg-reconfigure unattended-upgrades

If needed, configure the proxy for apt:

 echo ‘Acquire::http::Proxy “http://%5B2001:db8:abcd:3f0d::1]:8123/”;’ | sudo tee –append /etc/apt/apt.conf

Then edit /etc/apt/apt.conf.d/10periodic configuring when update, upgrade and autoclean should run:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "7";
APT::Periodic::AutocleanInterval "14";
APT::Periodic::Unattended-Upgrade "7";

Edit /etc/apt/apt.conf.d/50unattended-upgrades changing the setting for what kind of update you what to apply and when the machine should reboot:

// 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";
};

// Automatically reboot *WITHOUT CONFIRMATION*
//  if the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "true";

// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
//  Default: "now";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";

If you what to run unattended-upgrade one a week only for example on Saturday…

touch -t 201608200200 /var/lib/apt/periodic/upgrade-stamp

Via: https://help.ubuntu.com/16.04/serverguide/automatic-updates.html
https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo
http://serverfault.com/questions/454510/debian-running-unattended-upgrades-on-a-particular-day-of-the-week/547740

How to Redirect only selected drive on RDP session

The option to add on .rdp file to redirect only selected drive (the default is every) is:

drivestoredirect:s:C:

This redirect only drive C:

If you are working with Windows 2012 R2 Remote App, you should use powershell to add the required custom properties:

Set-RDSessionCollectionConfiguration –CollectionName MyCollection -CustomRdpProperty “drivestoredirect:s:C:”

If you are using Windows 7 as client, remember to update “Remote Desktop Client” (mstsc) otherwise selected redirection is not working.

Via: http://microsoftplatform.blogspot.ch/2013/01/adding-custom-rdp-properties-in-windows.html

Problem: Set “Start In” folder for Remote App on Windows 2012 R2

Unfortunately is not possible on Windows 2012 R2 Remote Desktop Service App define a StartIn/Working folder. I had a Java Application that require a specified working folder to run without problem.

The workaround is to create a batch and publish this batch instead of application:

[Code]
Start “%ApplicationName%” /d “%path to startdir%” “%path to executable%”
Exit
[/Code]

Then change the icon of published application following this guide: https://241931348f64b1d1.wordpress.com/2016/09/07/how-to-change-remote-app-icon-on-windows-2012-r2/

How to Change Remote App Icon on Windows 2012 R2

Changeing icon on RDS Remote App is possible only from Powershell.

Open administrative Powershell, import RemoteDesktop module and check first the current IconIndex and IconPath settings:

Import-Module RemoteDesktop

Get-RDRemoteApp -alias “MyApp” | fl

Then set the IconPath and IconIndex to the desired value. Found IconIndex counting the icons present on EXE,DLL,ICO until you reach the desired one starting from 0:

Get-RDRemoteApp -Alias “MyApp” | Set-RDRemoteApp -IconPath “C:\MyProg\MyProg.ico” -IconIndex 0

It’s possible also to change directly the .ico file you found on C:\Windows\RemotePackages\CPubFarms\CPubRemoteApps on the broker if you already have the icon on .ico format.

How to Force Upgrade to Windows 10 Anniversary Update (1607)

Update version 1607 is making its way to compatible devices via Windows Update, but as you may be aware, depending on the type of device, the location or region of that device or some other criteria.

If you want to upgrade now, first check on “Settings > Update & Security > Windows Update > Advanced Options” that “Defer upgrades” option is not flagged.

Then go here: https://support.microsoft.com/en-us/help/12387/windows-10-update-history?ocid=update_setting_client

and click on “Get the Anniversary Update Now”; that will force the download of the Windows 10 Update Assistant.

Problem:The following packages have been kept back: docker-io

On one of my docker host with Ubuntu 16.04 running apt-get upgrade I receive the message:

The following packages have been kept back: docker-io

then to upgrade one or all of the kept-back packages, without doing a distribution upgrade (dist-upgrade can be quite dangerous) is to issue the command:

apt-get install <list of packages kept back>

this will resolve the kept-back issues and will ask to install additional packages and dependencies.