Skip to content

Instantly share code, notes, and snippets.

@perguth
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perguth/5c99244436d24cfa4123 to your computer and use it in GitHub Desktop.
Save perguth/5c99244436d24cfa4123 to your computer and use it in GitHub Desktop.
A trimmed version of the fixubuntu.com script (removed the superfluous nonpersistent firewall rule). Fixes the privacy violations by Ubuntu 12.10 till 14.04.0x. See: https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks @wedv @wedv
#!/bin/bash
GS="/usr/bin/gsettings"
CCUL="com.canonical.Unity.lenses"
# Figure out the version of Ubuntu that you're running
V=$(/usr/bin/lsb_release -rs)
# The privacy problems started with v12.10, so earlier versions should do nothing
# Added check because 14.04.1 isn't a number
if [[ $V == "14.04.1" || $V == "14.04.2" || $V == "14.04.3" ]]; then
$V=14.04
fi
# Minimum version check
MIN=`echo $V'>'12.10 | bc -l`
# Maximum version check
FIXED_VER=15.04
MAX=`echo $FIXED_VER'>'$V | bc -l`
if [[ $MIN -eq 0 || $MAX -eq 0 ]]; then
echo "Good news! This version of Ubuntu is not known to invade your privacy."
exit 0 # The script should exit if Ubuntu version is outside of range
fi
# Check if Canonical schema is present. Take first match, ignoring case.
SCHEMA="$($GS list-schemas | grep -i $CCUL | head -1)"
if [[ -z "$SCHEMA" ]]
then
printf "Error: could not find Canonical schema %s.\n" "$CCUL" 1>&2
exit 1
else
CCUL="$SCHEMA"
fi
# Turn off "Remote Search", so search terms in Dash aren't sent to the internet
$GS set "$CCUL" remote-content-search none
# If you're using a version earlier than v13.10, uninstall unity-lens-shopping
if [[ $V < 13.10 ]]; then
sudo apt-get remove -y unity-lens-shopping
# If you're using a later version, disable remote scopes
else
$GS set "$CCUL" disabled-scopes \
"['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope',
'more_suggestions-populartracks.scope', 'music-musicstore.scope',
'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope',
'more_suggestions-skimlinks.scope']"
fi;
# Block connections to Ubuntu's ad server, just in case
if ! grep -q "127.0.0.1 productsearch.ubuntu.com" /etc/hosts; then
echo -e "\n127.0.0.1 productsearch.ubuntu.com" | sudo tee -a /etc/hosts >/dev/null
fi
echo "All done. Enjoy your privacy."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment