Cheers for all the info, this will really come in handy. I started writing a bash script to wipe out history, and harden the OS recently. I only started it and dont have time to get too much into it so I was hoping some people here could pitch in. I'll start a thread for it, but heres what I've got so far:
#!/bin/bash
#!/bin/bash
mode="safe"
export $mode
# DISABLING DANGEROUS APPS
# Stop Ubuntu from gathering geographical information via GeoIP
gsettings set com.ubuntu.geoip geoip-url ""
function deleteData {
declare -a dataPaths=("${!2}")
for dataPath in ${dataPaths[*]}
do
if [ ! -e ${dataPath} ]; then
echo "${dataPath} not found!"
continue
fi
case $1 in
"safe")
echo -e "$dataPath"
;;
"delete")
if [ ! -f ${dataPath} ]; then
echo -e "Deleting ${dataPath} file"
rm -fv ${delPath}
elif [ ! -d ${dataPath} ]; then
echo -e "Deleting ${dataPath} directory"
rm -frv ${delPath}
fi
;;
*)
echo -e "$delPath"
;;
esac
done
}
# REMOVE BAD STARTUP APPS
function removeStartupApps {
startupDir="/etc/xdg/autostart/"
declare -a startupFiles=("zeitgeist-datahub" "vino-server" "tracker-store")
startupFiles=("${startupFiles[@]/%/.desktop}")
delData=("${startupFiles[@]/#/${startupDir}}")
deleteData "$mode" delData[@]
}
# DELETE APPLICATION DATA
function deleteAppData {
fileList=()
appDir=""
case $1 in
"firefox")
appDir="$HOME/.mozilla/firefox/$(ls ~/.mozilla/firefox/ | grep 'default')/"
fileList=("formhistory.sqlite" "downloads.sqlite" "search.sqlite" "places.sqlite" "cookies.sqlite")
;;
"chromium-browser")
appDir=""
appsList=("")
;;
*)
echo "Incorrect app selected"
;;
esac
delPaths=( "${fileList[@]/#/${appDir}}" )
deleteData "$mode" delPaths[@]
}
appsList[0]="firefox"
appsList[1]="chromium-browser"
for app in ${appsList[*]}
do
deleteAppData $app
done
# DELETE CACHE FOLDERS
cacheDir="$HOME/.cache/"
deleteDir=()
deleteDir[0]="thumbnails"
deleteDir[1]="mozilla"
deleteDir[2]="chromium"
deleteDir[3]="vlc"
delPaths=( "${deleteDir[@]/#/${cacheDir}}" )
deleteData "$mode" delPaths[@]
removeStartupApps
# DELETE LSO COOKIES
echo "Deleting cookies:"
ls $HOME/.macromedia/Flash_Player/#SharedObjects/*/*
sudo rm -rf $HOME/.macromedia/Flash_Player/#SharedObjects/*/*
On safe mode it'll just print the files it would usually delete. With the exception of LSOs, it'll delete them either way.