Lenovo X1 Carbon and Cisco AnyConnect VPN reconnecting fix

Disable-internet-connection-sharing-ics-service-windows-81This is just a short note on how to fix the Cisco AnyConnect Secure Mobility Client (VPN) dropping the tunnel and reconnecting my Internet connection in Windows 8.1.I have had problems with AnyConnect ever since I got my Lenovo X1 Carbon and have not found a solution until now.The solution was as simple as to disable the “Internet Connection Sharing (ICS)” service.The solution was found on Lenovo Support page http://support.lenovo.com/en_BD/diagnose-and-fix/detail.page?DocID=HT077908

Blocking Unwanted Connections with a Hosts File

You can use a HOSTS file to block ads, banners, 3rd party Cookies, 3rd party page counters, web bugs, and even most hijackers. This is accomplished by blocking the connection(s) that supplies these little gems. This is a simple script that downloads a new hosts file for your operating system and redirects all requests for unwanted connections to 127.0.0.1.
The new hosts file will reduce your bandwidth usage.

The following script will download the new hosts file, make a backup of your current file before the new hosts file is being used.
The new file will be used immediately after you have copied it. You can revert to your old hosts file by copying it back.

#!/bin/bash
wget -O /tmp/new-hostsfile.txt http://winhelp2002.mvps.org/hosts.txt
mv /etc/hosts /etc/hosts.backup
mv /tmp/new-hostsfile.txt /etc/hosts

A more detailed description of the script can be found on http://winhelp2002.mvps.org/hosts.htm.
This has been tested in Ubuntu 13.04 but will work on any operating system that uses a /etc/hosts file, like Windows and linux.

Disable Windows super key in Ubuntu

I am running a virtualized Windows 8 installation on VMware Worlstation in Ubuntu 12.10 and this can be confusing since the window manager uses the same key as my Windows machine to open the launcher. Therefore I use to disable the super key in Ubuntu so that only my Windows machine responds to the key.

This is one way to disable the super key from a console window as the user you are logged in with:

# dconf write /org/compiz/profiles/unity/plugins/unityshell/show-launcher '""'

This command does not require a logoff or restart so you can test the behaviour of the Windows super key immediately.

You might have to install the apt-get install compizconfig-settings-manager package if this command does not work.

Rename AVCHD files using Exiftools

Simple bash script to rename AVCHD/MTS/MOV files to match their recording date and time.

#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: ./rename_video.sh FILETYPE" 1>&2
echo "Example: ./rename_video.sh *.MTS" 1>&2
exit 1
fi
for x in "$@"
do
exiftool '-FileName<DateTimeOriginal' -d %Y%m%d_%H%M_%%f.%%e "$x"
done

The resulting files will be named like YYYYMMDD_HHMM_BASENAME.ext ie 20120703_1635_05600.MTS

Exiftools can also be used to perform the renaming process in Windows as well using a command window

# exiftool "-FileName<DateTimeOriginal" -d %Y%m%d_%H%M_%%f.%%e *.MTS

This script has been tested on Canon Legria and on Panasonic HDC-SD800 video camera MTS-files and Nikon D7000 MOV-files with great success.

Disable DLNA in Windows 7

If you are using your Windows 7 and have a active wireless network, then the chances are that you are sharing your media files with DLNA enabled devices like smartphones, TVs with wireless access and media centers.
This HOWTO describes how you can disable DLNA in Windows 7.

  1. Type “Manage advanced sharing settings” in the Start Menu
  2. Go to “Home and Work”
  3. Under “Media Streaming” you click the “Choose media streaming options” link
  4. Click the “Block all” button followed by the “OK” button

You have now disabled DLNA sharing on your computer.