Jitsi Meet, my favourite video conferencing platform (and a way to share audio when using it in Linux)

During the current COVID-19 lockdown I have been using video conferencing platforms a lot for family virtual meet-ups, quizzes and multi-player games by Jackbox Games. Zoom seems to be the most popular video conference platform at the moment, although several articles in the media have pointed out some of its security limitations (see, e.g., ‘‘Zoom is malware’: why experts worry about the video conferencing platform‘). Although many people like Zoom, my favourite video conferencing platform is Jitsi Meet.

For an excellent third-party video introduction to Jitsi Meet, watch the video: ‘Using Jitsi: A free, no-registration video conferencing site‘. WIRED Magazine’s recent article on Jitsi Meet is also worth reading: ‘Want to Ditch Zoom? Jitsi Offers an Open-Source Alternative‘.

The reasons I prefer Jitsi Meet to Zoom include the following:

  1. no subscriptions are required to use all the features of Jitsi Meet;
  2. unlike Zoom, Jitsi Meet does not require you to sign up;
  3. unlike Zoom, Jitsi Meet does not require the installation of an application — it runs in Google Chrome or Firefox;
  4. unlike the free version of Zoom, Jitsi Meet does not impose a time limit on the length of the meeting;
  5. unlike the free version of Zoom, Jitsi Meet does not have a limit on the number of meeting attendees;
  6. Jitsi Meet provides end-to-end encryption for one-to-one video calls*;
  7. I find the performance of Jitsi Meet better than Zoom, which seems to be corroborated in basic benchmarking by Jitsi Meet’s developers (‘WebRTC vs. Zoom – A Simple Congestion Test‘);
  8. I find image quality better in Jitsi Meet;
  9. I find Jitsi Meet on a desktop/laptop more intuitive and easier to use than Zoom;
  10. if I share audio in Zoom for Linux, the audio is very distorted**;
  11. I find the UI of the Jitsi Meet app for Android easy to use (the app can be installed via Google Play);
  12. Jitsi Meet is open-source, so anyone can inspect the source code;
  13. if I wanted to, I could download the Jitsi software to my own server and set up a Jitsi Meet server to handle meetings instead of using the Cloud server provided by 8×8, Inc. (the company that develops the Jitsi Meetings software).

* Neither platform currently provides end-to-end encryption for group meetings, although the developers of Jitsi Meet are apparently working on implementing end-to-end encryption for group meetings using a new feature of Google Chrome called ‘Insertable Streams’.

** There is a work-around for this problem in Zoom for Linux; see my answer to the Unix & Linux Stack Exchange question ‘Play audio output as input to Zoom’. In the case of Jitsi Meet in Linux, PulseAudio Volume Control can be used to share audio, as I explain further down.

Jitsi Meet requires no installation; it runs in a browser window. Either Google Chrome or Firefox can be used, although I find it runs better in Google Chrome. Actually, an Ubuntu 16.04 user told me that Firefox hangs when he tries to join a Jitsi Meet meeting, but Jitsi Meet works fine in Firefox in my two Gentoo Linux installations and in my family’s Lubuntu 18.04 installation. When using Google Chrome, to be able to share your screen you need to install the Google Chrome extension ‘Jitsi Meetings’ by meet.ji.si in the Google Chrome Web Store.

One of my family here at home has a laptop running Windows 10. Google Chrome, but not Firefox, displays a ‘Share audio’ tick box when the ‘Share your screen’ icon is clicked (see ‘Jitsi Meet features update, April 2020‘). The ‘Share audio’ feature is needed when, for example, you are casting via the Internet to remote players a multi-user game running on your machine. During the current COVID-19 lockdown we have been having fun playing Jackbox Games Party Pack 6 this way with family and friends in different locations (see ‘(My Solution) Best method for Virtual Couch Multiplayer‘). Each household connects a laptop to their TV via HDMI and joins the Jitsi Meet meeting. The Jackbox Games games are cast via Jitsi Meet from the laptop at my house, and the group of players in each household can view and hear the game on their TV and participate using their mobile phones as per the Jackbox Games paradigm.

Jitsi Meet provides a ‘Share audio’ function in Windows only, but I found a work-around to to be able to share any application’s audio in Linux if I ever want to use my Linux machines to cast games by Jackbox Games or other suppliers. For once, I have found PulseAudio useful! I use PulseAudio Volume Control to redirect the audio output from the desired application (be it a game, music player, video player or whatever) to the microphone input. The precise way to do this depends on the audio hardware your machine has, but an example is given in the blog post: ‘Redirect Audio Out to Mic In (Linux)‘.

My family’s desktop machine running Lubuntu 18.04 uses a Webcam with an integral microphone connected via USB, and external powered speakers connected to the machine’s Line Out green-coloured 3.5 mm jack socket. The contents of the tabs in PulseAudio Volume Control when no applications that produce audio are running are shown in the following screenshots:

PulseAudio Volume Control - Configuration

PulseAudio Volume Control - Playback

PulseAudio Volume Control - Recording

PulseAudio Volume Control - Output Devices

PulseAudio Volume Control - Input Devices

I make sure ‘All Streams’ is selected on the ‘Playback’ and ‘Recording’ tabs, ‘All Output Devices’ is selected on the ‘Output Devices’ tab, and ‘All Input Devices’ is selected on the ‘Input Devices’ tab.

Let us say I have launched Audacious to play some music and I want to cast that music to members of a Jitsi Meet meeting. When I am using Jitsi Meet for a meeting in Google Chrome, the contents of the PulseAudio Volume Control tabs on this machine are as follows:

PulseAudio Volume Control - Playback

PulseAudio Volume Control - Recording

PulseAudio Volume Control - Output Devices

PulseAudio Volume Control - Input Devices

To redirect the audio from e.g. Audacious to the meeting members, I select (click on the square button with the green disc and white tick) ‘Monitor of Built-in Audio Analogue Stereo’ on the ‘Input Devices’ tab, and on the ‘Recording’ tab I click on Chrome input: RecordStream from ‘Camera Analogue Mono’ and select Chrome input: RecordStream from ‘Monitor of Built-in Audio Analogue Stereo’, as shown below.

PulseAudio Volume Control - Recording

PulseAudio Volume Control - Input Devices

With the above settings in PulseAudio volume control, all the members of the meeting will be able to hear clearly the audio from Audacious. To switch back to my microphone to speak, I simply click on Chrome input: RecordStream from ‘Monitor of Built-in Audio Analogue Stereo’ on the ‘Recording’ tab and select Chrome input: RecordStream from ‘Camera Analogue Mono’ again.

Using Bash scripts in Linux to delete the history, cookies and cache files of Firefox, Google Chrome and Thunderbird

The browsing data stored by Firefox, Google Chrome and Thunderbird can be deleted using the respective application’s GUI. But you can also do that using a Bash script, which could be useful if you want to delete unnecessary/unwanted files before e.g. backing up your home directory, or if you want a quick and easy way to clear-out browsing data. In this post I list the scripts and Desktop Configuration files I have created in Gentoo Linux and in Lubuntu 18.04 to remove browsing data.

In the case of Thunderbird, I am not sure if it is safe to delete Thunderbird’s cache files so my script only deletes cookies. Anyway, that could be added later if it transpires there is no harm in deleting Thunderbird’s cache files.

I am using the following 64-bit versions of the two browsers and e-mail client:

  • Mozilla Firefox 74.0
  • Mozilla Thunderbird 68.5.0 in Gentoo Linux only
  • Google Chrome 80.0.3987.132 in Gentoo Linux
  • Google Chrome 67.0.3396.99 in Lubuntu 18.04

I have not tested my scripts with other versions of Firefox, Chrome and Thunderbird, nor in other installations, so please do check carefully the directory paths and commands in the script against the directory paths in your installation before selecting ‘[D]elete‘ in the running script.

In Lubuntu 18.04 I had to install sqlite3 first:

$ sudo apt install sqlite3

In Gentoo Linux it was already installed:

$ eix -I sqlite
[I] dev-db/sqlite
     Available versions:  (3) 3.29.0^t 3.30.1^t 3.31.1^t
       {debug doc icu +readline secure-delete static-libs tcl test tools ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  3.31.1(3)^t(19:53:28 13/03/20)(icu readline secure-delete -debug -doc -static-libs -tcl -test -tools ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
     Homepage:            https://sqlite.org/
     Description:         SQL database engine

Firefox and Thunderbird

I created the Bash script Firefox_or_Thunderbird_-_Clear_data.sh listed below. The user can select only Firefox or only Thunderbird, or both, and the script enables the user to choose whether to just view the current situation or to delete the data. The script checks if the applications are running and will not do anything if they are. In fact, the script offers the user the option to terminate the applications if they happen to be running. The script is still usable if either Firefox or Thunderbird are not installed. The same script can be used in Gentoo and in Lubuntu 18.04, and I believe it would also work in Ubuntu but have not tested it with that distribution.

#!/bin/bash
#
# If Delete is selected for Firefox, this script deletes the entire history, cookies, site data and cache.
# If Delete is selected for Thunderbird, this script deletes the cookies and leaves the cache intact.
#
echo
echo "WARNING:"
echo "The Firefox Browser must not be running if you are going to list or delete its data files."
echo "The Thunderbird e-mail client must not be running if you are going to list or delete its data files."
echo
FIREFOX=$( ls $HOME/.mozilla/firefox 2>/dev/null | grep .default )
THUNDERBIRD=$( ls $HOME/.thunderbird 2>/dev/null | grep .default )
while true
do
   echo -n "[F]irefox, [T]hunderbird, [B]oth or [E]xit: "
   read -n1 PROMPT2
   echo
   case $PROMPT2 in
      [fF]* ) CHOICE2="F"; break;;
      [tT]* ) CHOICE2="T"; break;;
      [bB]* ) CHOICE2="B"; break;;
      [eE]* ) exit;;
      * )     echo "Invalid entry.";;
   esac
done
FRUNNING="N"
pgrep -u $USER firefox > /dev/null
if [[ $? -eq 0 ]]; then
   FRUNNING="Y"
   while true
   do
      echo
      echo -n "The Firefox browser is running. Do you wish to close it now? [Y/N]: "
      read -n1 PROMPT0
      echo
      case $PROMPT0 in
         [yY]* ) CHOICE0="Y"; break;;
         [nN]* ) CHOICE0="N"; break;;
         * )     echo "Invalid entry.";;
      esac
   done
   if [[ $CHOICE0 == "Y" ]]; then
      FPID=$( pgrep -u $USER firefox )
      FPID=$( echo $FPID | cut -d" " -f1 )
      kill -1 $FPID
      FRUNNING="N"
   fi
fi
TRUNNING="N"
pgrep -u $USER thunderbird > /dev/null
if [[ $? -eq 0 ]]; then
   TRUNNING="Y"
   while true
   do
      echo -n "The Thunderbird e-mail client is running. Do you wish to close it now? [Y/N]: "
      read -n1 PROMPT1
      echo
      case $PROMPT1 in
         [yY]* ) CHOICE1="Y"; break;;
         [nN]* ) CHOICE1="N"; break;;
         * )     echo "Invalid entry.";;
      esac
   done
   if [[ $CHOICE1 == "Y" ]]; then
      FPID=$( pgrep -u $USER thunderbird )
      FPID=$( echo $FPID | cut -d" " -f1 )
      kill -1 $FPID
      TRUNNING="N"
   fi
fi
ABORT="N"
if [[ $FRUNNING == "Y" ]]; then
   if [[ $CHOICE2 == "F" ]] || [[ $CHOICE2 == "B" ]]; then
      echo
      echo "Please quit Firefox then re-run this script."
      echo
      ABORT="Y"
   fi
fi
if [[ $TRUNNING == "Y" ]]; then
   if [[ $CHOICE2 == "T" ]] || [[ $CHOICE2 == "B" ]]; then
      echo
      echo "Please quit Thunderbird then re-run this script."
      echo
      ABORT="Y"
   fi
fi
if [[ $ABORT == "N" ]]; then
   while true
   do
      echo
      echo -n "[D]elete, [L]ist or [E]xit: "
      read -n1 PROMPT3
      echo
      case $PROMPT3 in
         [dD]* ) CHOICE3="D"; break;;
         [lL]* ) CHOICE3="L"; break;;
         [eE]* ) exit;;
         * )     echo "Invalid entry.";;
      esac
   done
   if [[ $CHOICE3 == "D" ]]; then
      if [[ $CHOICE2 == "F" ]] || [[ $CHOICE2 == "B" ]]; then
         if [ -z "$FIREFOX" ]; then
            echo "Firefox directory does not exist"
         else
            echo
            echo "Deleting Firefox History..........."
            echo "==================================="
            sqlite3 ${HOME}/.mozilla/firefox/${FIREFOX}/places.sqlite "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;"
            sqlite3 ${HOME}/.mozilla/firefox/${FIREFOX}/places.sqlite "delete from moz_historyvisits;"
            echo
            echo "Deleting Firefox Cookies........"
            echo "================================"
            sqlite3 ${HOME}/.mozilla/firefox/${FIREFOX}/cookies.sqlite "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies; delete from moz_cookies;"
            echo
            echo "Deleting Firefox Site Data........"
            echo "=================================="
            ls ${HOME}/.mozilla/firefox/${FIREFOX}/storage/default/ | grep http
            find ${HOME}/.mozilla/firefox/${FIREFOX}/storage/default -name "http*" -type d -exec rm -r "{}" \; -prune
            echo
            echo "Deleting Firefox Cache..........."
            echo "================================="
            NUM=$( ls -1 ${HOME}/.cache/mozilla/firefox/${FIREFOX}/cache2/entries | wc -l )
            SIZ=$( du -sbh ${HOME}/.cache/mozilla/firefox/${FIREFOX}/cache2/entries )
            SIZ=$( echo $SIZ | cut -d" " -f1 )
            echo "Files: $NUM Size: $SIZ"
            find ${HOME}/.cache/mozilla/firefox/${FIREFOX}/cache2/entries -type f -delete 2>/dev/null
            echo
         fi
      fi
      if [[ $CHOICE2 == "T" ]] || [[ $CHOICE2 == "B" ]]; then
         if [ -z "$THUNDERBIRD" ]; then
            echo "Thunderbird directory does not exist"
         else
            echo "Deleting Thunderbird Cookies........"
            echo "===================================="
            sqlite3 ${HOME}/.thunderbird/${THUNDERBIRD}/cookies.sqlite "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies; delete from moz_cookies;"
         fi
      fi
   fi
   if [[ $CHOICE3 == "L" ]]; then
      if [[ $CHOICE2 == "F" ]] || [[ $CHOICE2 == "B" ]]; then
         if [ -z "$FIREFOX" ]; then
            echo "Firefox directory does not exist"
         else
            echo
            echo "Current Firefox History........."
            echo "================================"
            sqlite3 ${HOME}/.mozilla/firefox/${FIREFOX}/places.sqlite "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;" | more
            echo
            echo "Current Firefox Cookies........"
            echo "==============================="
            sqlite3 ${HOME}/.mozilla/firefox/${FIREFOX}/cookies.sqlite "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies;" | more
            echo
            echo "Current Firefox Site Data........"
            echo "================================="
            ls ${HOME}/.mozilla/firefox/${FIREFOX}/storage/default/ | grep http | more
            echo
            echo "Current Firefox Cache..........."
            echo "================================="
            NUM=$( ls -1 ${HOME}/.cache/mozilla/firefox/${FIREFOX}/cache2/entries | wc -l )
            SIZ=$( du -sbh ${HOME}/.cache/mozilla/firefox/${FIREFOX}/cache2/entries )
            SIZ=$( echo $SIZ | cut -d" " -f1 )
            echo "Files: $NUM Size: $SIZ"
            echo
         fi
      fi
      if [[ $CHOICE2 == "T" ]] || [[ $CHOICE2 == "B" ]]; then
         if [ -z "$THUNDERBIRD" ]; then
            echo "Thunderbird directory does not exist"
         else
            echo "Current Thunderbird Cookies......"
            echo "================================="
            sqlite3 ${HOME}/.thunderbird/${THUNDERBIRD}/cookies.sqlite "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies;" | more
         fi
      fi
   fi
fi
printf "\n"
read -rep $'\n Press ENTER to exit ' PROMPT4

Listed below is the Desktop Configuration file Firefox_or_Thunderbird_-_Clear_data.desktop for KDE in Gentoo Linux that I created in the ~/Desktop/ directory. I downloaded a nice PNG icon from the Web, which I saved as ~/Pictures/Icons/Mozilla.png, although of course the Desktop Configuration file can be modified if the icon file were to be stored elsewhere. Obviously change the username accordingly.

[Desktop Entry]
Comment[en_GB]=Clear Firefox or Thunderbird caches and cookies
Comment=Clear Firefox or Thunderbird caches and cookies
Exec=/home/fitzcarraldo/Firefox_or_Thunderbird_-_Clear_data.sh
GenericName[en_GB]=Clear Firefox or Thunderbird caches and cookies
GenericName=Clear Firefox or Thunderbird caches and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/Mozilla.png
MimeType=
Name[en_GB]=Firefox_or_Thunderbird_-_Clear_data
Name=Firefox_or_Thunderbird_-_Clear_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo

The equivalent Desktop Configuration file I created for Lubuntu 18.04 is very similar:

[Desktop Entry]
Comment[en_GB]=Clear Firefox or Thunderbird caches and cookies
Comment=Clear Firefox or Thunderbird caches and cookies
Exec=/home/fitzcarraldo/Firefox_or_Thunderbird_-_Clear_data.sh
GenericName[en_GB]=Clear Firefox or Thunderbird caches and cookies
GenericName=Clear Firefox or Thunderbird caches and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/Mozilla.png
MimeType=
Name[en_GB]=Firefox_or_Thunderbird_-_Clear_data
Name=Firefox_or_Thunderbird_-_Clear_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-LXDE-SubstituteUID=false
X-LXDE-Username=fitzcarraldo

Google Chrome

I created the following Bash script Google-Chrome_-_Clear_data.sh for the Google Chrome browser in Gentoo Linux. Different scripts have to be used in Gentoo Linux and in Lubuntu 18.04 because the paths are different.

#!/bin/bash
#
# If Delete is selected, this script deletes the entire cache, the code cache,
# the Visited Links file and the Top Sites file.
#
echo
echo "WARNING:"
echo "The Google Chrome browser must not be running if you are going to list or delete its data files."
echo
while true
do
   echo -n "[D]elete, [L]ist or [E]xit: "
   read -n1 PROMPT1
   echo
   case $PROMPT1 in
      [dD]* ) CHOICE1="D"; break;;
      [lL]* ) CHOICE1="L"; break;;
      [eE]* ) exit;;
      * )     echo "Invalid entry.";;
   esac
done
CRUNNING="N"
pgrep -u $USER chrome > /dev/null
if [[ $? -eq 0 ]]; then
   CRUNNING="Y"
   while true
   do
      echo
      echo -n "The Google Chrome browser is running. Do you wish to close it now? [Y/N]: "
      read -n1 PROMPT0
      echo
      case $PROMPT0 in
         [yY]* ) CHOICE0="Y"; break;;
         [nN]* ) CHOICE0="N"; break;;
         * )     echo "Invalid entry.";;
      esac
   done
   if [[ $CHOICE0 == "Y" ]]; then
      FPID=$( pgrep -u $USER chrome )
      FPID=$( echo $FPID | cut -d" " -f1 )
      kill -1 $FPID
      CRUNNING="N"
   fi
fi
if [[ $CRUNNING == "Y" ]]; then
   echo
   echo "Please quit Google Chrome then re-run this script."
   echo
else
   if [[ $CHOICE1 == "D" ]]; then
      echo
      echo "Deleting URLs..........."
      echo "========================"
      sqlite3 ${HOME}/.config/google-chrome/Profile\ 2/History "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls; delete from urls;"
      echo
      echo "Deleting Cookies........"
      echo "========================"
      sqlite3 ${HOME}/.config/google-chrome/Profile\ 2/Cookies "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies; delete from cookies;"
      if [[ -d ${HOME}/.cache/google-chrome/Profile\ 2/Cache ]]; then
         echo
         echo "Deleting Chrome Cache......."
         echo "====================="
         NUM=$( ls -1 ${HOME}/.cache/google-chrome/Profile\ 2/Cache | wc -l )
         SIZ=$( du -sbh ${HOME}/.cache/google-chrome/Profile\ 2/Cache )
         SIZ=$( echo $SIZ | cut -d" " -f1 )
         echo "Files: $NUM Size: $SIZ"
         rm -r ${HOME}/.cache/google-chrome/Profile\ 2/Cache
      fi
      if [[ -d ${HOME}/.cache/google-chrome/Profile\ 2/Code\ Cache ]]; then
         echo
         echo "Deleting Code Cache......"
         echo "========================="
         rm -r ${HOME}/.cache/google-chrome/Profile\ 2/Code\ Cache
      fi
      if [[ -f ${HOME}/.config/google-chrome/Profile\ 2/Visited\ Links ]]; then
         echo
         echo "Deleting Visited Links......"
         echo "============================"
         rm ${HOME}/.config/google-chrome/Profile\ 2/Visited\ Links
      fi
      if [[ -f ${HOME}/.config/google-chrome/Profile\ 2/Top\ Sites ]]; then
         echo
         echo "Deleting Top Sites......"
         echo "========================"
         rm ${HOME}/.config/google-chrome/Profile\ 2/Top\ Sites
      fi
   fi
   if [[ $CHOICE1 == "L" ]]; then
      echo
      echo "Current URLs..........."
      echo "======================="
      sqlite3 ${HOME}/.config/google-chrome/Profile\ 2/History "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls;" | more
      echo
      echo "Current Cookies........"
      echo "======================="
      sqlite3 ${HOME}/.config/google-chrome/Profile\ 2/Cookies "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies;" | more
      if [[ -d ${HOME}/.cache/google-chrome/Profile\ 2/Cache ]]; then
         echo
         echo "Current Chrome Cache............."
         echo "================================="
         NUM=$( ls -1 ${HOME}/.cache/google-chrome/Profile\ 2/Cache | wc -l )
         SIZ=$( du -sbh ${HOME}/.cache/google-chrome/Profile\ 2/Cache )
         SIZ=$( echo $SIZ | cut -d" " -f1 )
         echo "Files: $NUM Size: $SIZ"
      fi
   fi
fi
printf "\n"
read -rep $'\n Press ENTER to exit ' PROMPT2

And below is the Desktop Configuration file Google-Chrome_-_Clear_data.desktop for Gentoo Linux. I downloaded a nice PNG icon from the Web, which I saved as ~/Pictures/Icons/Google-Chrome.png, although of course the Desktop Configuration file can be adjusted if the icon file were stored elsewhere. Obviously change the username accordingly.

[Desktop Entry]
Comment[en_GB]=Clear Google Chrome cache and cookies
Comment=Clear Google Chrome cache and cookies
Exec=/home/fitzcarraldo/Google-Chrome_-_Clear_data.sh
GenericName[en_GB]=Clear Google Chrome cache and cookies
GenericName=Clear Google Chrome cache and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/Google-Chrome.png
MimeType=
Name[en_GB]=Google-Chrome_-_Clear_data
Name=Google-Chrome_-_Clear_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

Below is the version of the script Google-Chrome_-_Clear_data.sh for Lubuntu 18.04:

#!/bin/bash
#
# If Delete is selected, this script deletes the entire cache, the code cache,
# the Visited Links file and the Top Sites file.
#
echo
echo "WARNING:"
echo "The Google Chrome browser must not be running if you are going to list or delete its data files."
echo
while true
do
   echo -n "[D]elete, [L]ist or [E]xit: "
   read -n1 PROMPT1
   echo
   case $PROMPT1 in
      [dD]* ) CHOICE1="D"; break;;
      [lL]* ) CHOICE1="L"; break;;
      [eE]* ) exit;;
      * )     echo "Invalid entry.";;
   esac
done
CRUNNING="N"
pgrep -u $USER chrome > /dev/null
if [[ $? -eq 0 ]]; then
   CRUNNING="Y"
   while true
   do
      echo
      echo -n "The Google Chrome browser is running. Do you wish to close it now? [Y/N]: "
      read -n1 PROMPT0
      echo
      case $PROMPT0 in
         [yY]* ) CHOICE0="Y"; break;;
         [nN]* ) CHOICE0="N"; break;;
         * )     echo "Invalid entry.";;
      esac
   done
   if [[ $CHOICE0 == "Y" ]]; then
      FPID=$( pgrep -u $USER chrome )
      FPID=$( echo $FPID | cut -d" " -f1 )
      kill -1 $FPID
      CRUNNING="N"
   fi
fi
if [[ $CRUNNING == "Y" ]]; then
   echo
   echo "Please quit Google Chrome then re-run this script."
   echo
else
   if [[ $CHOICE1 == "D" ]]; then
      echo
      echo "Deleting URLs..........."
      echo "========================"
      sqlite3 ${HOME}/.config/google-chrome/Default/History "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls; delete from urls;"
      echo
      echo "Deleting Cookies........"
      echo "========================"
      sqlite3 ${HOME}/.config/google-chrome/Default/Cookies "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies; delete from cookies;"
      if [[ -d ${HOME}/.cache/google-chrome/Default/Cache ]]; then
         echo
         echo "Deleting Chrome Cache......."
         echo "====================="
         NUM=$( ls -1 ${HOME}/.cache/google-chrome/Default/Cache | wc -l )
         SIZ=$( du -sbh ${HOME}/.cache/google-chrome/Default/Cache )
         SIZ=$( echo $SIZ | cut -d" " -f1 )
         echo "Files: $NUM Size: $SIZ"
         rm -r ${HOME}/.cache/google-chrome/Default/Cache
      fi
      if [[ -d ${HOME}/.cache/google-chrome/Default/Code\ Cache ]]; then
         echo
         echo "Deleting Code Cache......"
         echo "========================="
         rm -r ${HOME}/.cache/google-chrome/Default/Code\ Cache
      fi
      if [[ -f ${HOME}/.config/google-chrome/Default/Visited\ Links ]]; then
         echo
         echo "Deleting Visited Links......"
         echo "============================"
         rm ${HOME}/.config/google-chrome/Default/Visited\ Links
      fi
      if [[ -f ${HOME}/.config/google-chrome/Default/Top\ Sites ]]; then
         echo
         echo "Deleting Top Sites......"
         echo "========================"
         rm ${HOME}/.config/google-chrome/Default/Top\ Sites
      fi
   fi
   if [[ $CHOICE1 == "L" ]]; then
      echo
      echo "Current URLs..........."
      echo "======================="
      sqlite3 ${HOME}/.config/google-chrome/Default/History "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls;" | more
      echo
      echo "Current Cookies........"
      echo "======================="
      sqlite3 ${HOME}/.config/google-chrome/Default/Cookies "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies;" | more
      if [[ -d ${HOME}/.cache/google-chrome/Default/Cache ]]; then
         echo
         echo "Current Chrome Cache............."
         echo "================================="
         NUM=$( ls -1 ${HOME}/.cache/google-chrome/Default/Cache | wc -l )
         SIZ=$( du -sbh ${HOME}/.cache/google-chrome/Default/Cache )
         SIZ=$( echo $SIZ | cut -d" " -f1 )
         echo "Files: $NUM Size: $SIZ"
      fi
   fi
fi
printf "\n"
read -rep $'\n Press ENTER to exit ' PROMPT2

And below is the Desktop Configuration file Google-Chrome_-_Clear_data.desktop for Lubuntu 18.04. I downloaded a nice PNG icon from the Web, which I saved as ~/Pictures/Icons/Google-Chrome.png, although of course the Desktop Configuration file can be adjusted if the icon file were stored elsewhere. Obviously change the username accordingly.

[Desktop Entry]
Comment[en_GB]=Clear Google Chrome cache and cookies
Comment=Clear Google Chrome cache and cookies
Exec=/home/fitzcarraldo/Google-Chrome_-_Clear_data.sh
GenericName[en_GB]=Clear Google Chrome cache and cookies
GenericName=Clear Google Chrome cache and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/Google-Chrome.png
MimeType=
Name[en_GB]=Google-Chrome_-_Clear_data
Name=Google-Chrome_-_Clear_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-LXDE-SubstituteUID=false
X-LXDE-Username=fitzcarraldo

Below are a few examples of the output when I launch the scripts.

Here is the output of the script that deals with Firefox and/or Thunderbird when I only list the current situation:


WARNING:
The Firefox Browser must not be running if you are going to list or delete its data files.
The Thunderbird e-mail client must not be running if you are going to list or delete its data files.
 
[F]irefox, [T]hunderbird, [B]oth or [E]xit: b 
 
The Firefox browser is running. Do you wish to close it now? [Y/N]: y 
The Thunderbird e-mail client is running. Do you wish to close it now? [Y/N]: y 
 
[D]elete, [L]ist or [E]xit: l 
 
Current Firefox History.........
================================
2020-03-19 17:27:24|https://www.accuweather.com/en/gb/united-kingdom-weather
2020-03-19 17:27:20|https://www.youtube.com/
2020-03-19 17:27:30|https://www.theguardian.com/uk
2020-03-19 17:27:38|http://www.jb.com.br/
2020-03-19 17:27:38|https://www.jb.com.br/
 
Current Firefox Cookies........
===============================
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:22|accounts.google.com
2020-03-19 17:27:23|.doubleclick.net
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:24|.accuweather.com
2020-03-19 17:27:24|.google.com
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:25|www.accuweather.com
2020-03-19 17:27:25|.accuweather.com
2020-03-19 17:27:24|.accuweather.com
2020-03-19 17:27:25|www.accuweather.com
2020-03-19 17:27:30|.theguardian.com
2020-03-19 17:27:36|.theguardian.com
2020-03-19 17:27:36|.theguardian.com
2020-03-19 17:27:39|.denakop.com
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|.tt-10969-0.seg.t.tailtarget.com
2020-03-19 17:27:43|.t.tailtarget.com
2020-03-19 17:27:44|www.jb.com.br
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:43|.t.tailtarget.com
2020-03-19 17:27:44|www.jb.com.br
2020-03-19 17:27:44|.tt-10969-0.seg.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:46|www.jb.com.br
2020-03-19 17:27:46|.www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
 
Current Firefox Site Data........
=================================
https+++www.google.com
https+++www.theguardian.com
https+++www.youtube.com
 
Current Firefox Cache...........
=================================
Files: 383 Size: 15M
 
Current Thunderbird Cookies......
=================================


 Press ENTER to exit

Here is the output of the script that deals with Firefox and/or Thunderbird when I delete only the Firefox data:

 
WARNING:
The Firefox Browser must not be running if you are going to list or delete its data files.
The Thunderbird e-mail client must not be running if you are going to list or delete its data files.
 
[F]irefox, [T]hunderbird, [B]oth or [E]xit: f 
 
[D]elete, [L]ist or [E]xit: d 
 
Deleting Firefox History...........
===================================
2020-03-19 17:27:24|https://www.accuweather.com/en/gb/united-kingdom-weather
2020-03-19 17:27:20|https://www.youtube.com/
2020-03-19 17:27:30|https://www.theguardian.com/uk
2020-03-19 17:27:38|http://www.jb.com.br/
2020-03-19 17:27:38|https://www.jb.com.br/
 
Deleting Firefox Cookies........
================================
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:20|.youtube.com
2020-03-19 17:27:22|accounts.google.com
2020-03-19 17:27:23|.doubleclick.net
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:24|.accuweather.com
2020-03-19 17:27:24|.google.com
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:24|www.accuweather.com
2020-03-19 17:27:25|www.accuweather.com
2020-03-19 17:27:25|.accuweather.com
2020-03-19 17:27:24|.accuweather.com
2020-03-19 17:27:25|www.accuweather.com
2020-03-19 17:27:30|.theguardian.com
2020-03-19 17:27:36|.theguardian.com
2020-03-19 17:27:36|.theguardian.com
2020-03-19 17:27:39|.denakop.com
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|.tt-10969-0.seg.t.tailtarget.com
2020-03-19 17:27:43|.t.tailtarget.com
2020-03-19 17:27:44|www.jb.com.br
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:43|.t.tailtarget.com
2020-03-19 17:27:44|www.jb.com.br
2020-03-19 17:27:44|.tt-10969-0.seg.t.tailtarget.com
2020-03-19 17:27:44|.t.tailtarget.com
2020-03-19 17:27:46|www.jb.com.br
2020-03-19 17:27:46|.www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
2020-03-19 17:27:43|www.jb.com.br
 
Deleting Firefox Site Data........
==================================
https+++www.google.com
https+++www.theguardian.com
https+++www.youtube.com
 
Deleting Firefox Cache...........
=================================
Files: 383 Size: 15M
 


 Press ENTER to exit

Here is the output of the script that deals with Google Chrome when I just list the current situation:


WARNING:
The Google Chrome browser must not be running if you are going to list or delete its data files.
 
[D]elete, [L]ist or [E]xit: l 
 
Current URLs...........
=======================
2020-03-19 17:30:41|https://duckduckgo.com/
2020-03-19 17:30:44|https://www.youtube.com/
2020-03-19 17:30:49|https://www.accuweather.com/en/gb/united-kingdom-weather
2020-03-19 17:30:57|http://www.folha.uol.com.br/
2020-03-19 17:30:57|https://www.folha.uol.com.br/
 
Current Cookies........
=======================
2020-03-19 17:30:49|.accuweather.com
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:31:11|.bt.uol.com.br
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:30:57|.accuweather.com
2020-03-19 17:30:45|accounts.google.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:46|.doubleclick.net
2020-03-19 17:31:08|player.mais.uol.com.br
2020-03-19 17:30:50|.google.com
2020-03-19 17:31:11|.dna.uol.com.br
2020-03-19 17:31:05|paywall.folha.uol.com.br
2020-03-19 17:30:58|.www.accuweather.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:30:50|.scorecardresearch.com
2020-03-19 17:30:50|.scorecardresearch.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:31:05|.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:30:58|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:58|www.accuweather.com
2020-03-19 17:30:58|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:30:58|.accuweather.com
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:00|.t.tailtarget.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|paywall.folha.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:30:49|www.accuweather.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:31:08|.uol.com.br
2020-03-19 17:30:57|www.accuweather.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:06|player.mais.uol.com.br
2020-03-19 17:31:06|player.mais.uol.com.br
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:30:58|.uol.com.br
2020-03-19 17:30:58|.navdmp.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:06|ivccf.ivcbrasil.org.br
2020-03-19 17:31:10|.tt-10162-1.seg.t.tailtarget.com
2020-03-19 17:31:04|.tt-12340-4.seg.t.tailtarget.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:05|.tt-10162-1.seg.t.tailtarget.com
2020-03-19 17:31:05|.tt-12340-4.seg.t.tailtarget.com
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:00|.t.tailtarget.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:30:57|www.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:31:04|.prg.smartadserver.com
2020-03-19 17:31:22|www.folha.uol.com.br
2020-03-19 17:31:20|.uol.com.br
2020-03-19 17:31:10|.uol.com.br
 
Current Chrome Cache.............
=================================
Files: 317 Size: 8.6M


 Press ENTER to exit

Here is the output of the script that deals with Google Chrome when I delete the browser data:


WARNING:
The Google Chrome browser must not be running if you are going to list or delete its data files.
 
[D]elete, [L]ist or [E]xit: d 
 
Deleting URLs...........
========================
2020-03-19 17:30:41|https://duckduckgo.com/
2020-03-19 17:30:44|https://www.youtube.com/
2020-03-19 17:30:49|https://www.accuweather.com/en/gb/united-kingdom-weather
2020-03-19 17:30:57|http://www.folha.uol.com.br/
2020-03-19 17:30:57|https://www.folha.uol.com.br/
 
Deleting Cookies........
========================
2020-03-19 17:30:49|.accuweather.com
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:31:11|.bt.uol.com.br
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:30:57|.accuweather.com
2020-03-19 17:30:45|accounts.google.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:46|.doubleclick.net
2020-03-19 17:31:08|player.mais.uol.com.br
2020-03-19 17:30:50|.google.com
2020-03-19 17:31:11|.dna.uol.com.br
2020-03-19 17:31:05|paywall.folha.uol.com.br
2020-03-19 17:30:58|.www.accuweather.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:30:50|.scorecardresearch.com
2020-03-19 17:30:50|.scorecardresearch.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:30:44|.youtube.com
2020-03-19 17:31:05|.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:30:58|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:51|www.accuweather.com
2020-03-19 17:31:10|www.folha.uol.com.br
2020-03-19 17:30:58|www.accuweather.com
2020-03-19 17:30:58|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:30:58|.accuweather.com
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:30:50|.accuweather.com
2020-03-19 17:31:01|.uol.com.br
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:31:11|.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:00|.t.tailtarget.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|paywall.folha.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:30:49|www.accuweather.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:31:08|.uol.com.br
2020-03-19 17:30:57|www.accuweather.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:06|player.mais.uol.com.br
2020-03-19 17:31:06|player.mais.uol.com.br
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:30:58|.uol.com.br
2020-03-19 17:30:58|.navdmp.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:30:51|.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:06|ivccf.ivcbrasil.org.br
2020-03-19 17:31:10|.tt-10162-1.seg.t.tailtarget.com
2020-03-19 17:31:04|.tt-12340-4.seg.t.tailtarget.com
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:05|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:04|www.folha.uol.com.br
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:05|.tt-10162-1.seg.t.tailtarget.com
2020-03-19 17:31:05|.tt-12340-4.seg.t.tailtarget.com
2020-03-19 17:31:05|.t.tailtarget.com
2020-03-19 17:31:00|.t.tailtarget.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:30:57|www.accuweather.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.rubiconproject.com
2020-03-19 17:31:04|.smartadserver.com
2020-03-19 17:30:50|www.accuweather.com
2020-03-19 17:31:04|.prg.smartadserver.com
2020-03-19 17:31:22|www.folha.uol.com.br
2020-03-19 17:31:20|.uol.com.br
2020-03-19 17:31:10|.uol.com.br
 
Deleting Chrome Cache.......
=====================
Files: 317 Size: 8.6M
 
Deleting Code Cache......
=========================
 
Deleting Visited Links......
============================
 
Deleting Top Sites......
========================


 Press ENTER to exit

Update March 23, 2020: For those of you who would prefer a single script that can delete the browsing history, cookies and cache files of Google Chrome and/or Firefox and/or Thunderbird, I have now created the script clear_browser_data.sh shown below with appropriate Desktop Configuration files for Gentoo Linux and Lubuntu 18.04. In addition I have now added the ability to list and delete the history and cache files of Thunderbird, as I have checked that deleting those is not detremental to Thunderbird. Furthermore, this new script finds the directories itself rather than having them partially hard-coded in the script, so I am using the same script in both Gentoo and Lubuntu 18.04. That said, I have not tested the script with other versions of Chrome, Firefox and Thunderbird, nor with other Linux distributions, so do not select [D]elete until you have checked that the directories evaluated by the script match the directories in your installation.

#!/bin/bash
#
########################################################################
#
# Bash script to enable the user to list and/or delete browser data of:
# Google Chrome browser
# Mozilla Firefox browser
# Mozilla Thunderbird e-mail client
#
########################################################################
#
# Check for existence of the applications' directories
FIREFOX=$( ls $HOME/.mozilla/firefox 2>/dev/null | grep profiles.ini )
THUNDERBIRD=$( ls $HOME/.thunderbird  2>/dev/null | grep profiles.ini )
CHROME=$( ls -d $HOME/.config/google-chrome 2>/dev/null )
if [ -z "$CHROME" ]; then
   echo
   echo "Chrome directory does not exist"
else
   # Chrome directory locations
   #
   CLOCALST=$( find $HOME/.config/google-chrome -type f -name "Local State" )
   CCURPROF=$( cat "$CLOCALST" | awk -F "," '{for (I=1;I<=NF;I++) if ($I~/"info_cache"/) {print $(I)};}' | awk -F "info_cache" '{print $2}' | awk -F '"' '{print $3}' )   
   CHISTORY=$( find $HOME/.config/google-chrome/"$CCURPROF" -type f -name "History" )
   CCOOKIES=$( find $HOME/.config/google-chrome/"$CCURPROF" -type f -name "Cookies" )
   CVISITED=$( find $HOME/.config/google-chrome/"$CCURPROF" -type f -name "Visited Links" )
   CTOPSITS=$( find $HOME/.config/google-chrome/"$CCURPROF" -type f -name "Top Sites" )
   CCACHEDF=$( find $HOME/.cache/google-chrome/"$CCURPROF" -type d -name "Cache" )
   CCODECAC=$( find $HOME/.cache/google-chrome/"$CCURPROF" -maxdepth 2 -type d -name "Code Cache" )
   echo; echo "Chrome is using profile: $CCURPROF"
   
fi
if [ -z "$FIREFOX" ]; then
   echo
   echo "Firefox directory does not exist"
else
   # Firefox file locations. First get the current Profile Name
   # The profiles are listed in 'profiles.ini'.
   # If profiles.ini does not contain a line 'Locked=1' then the current profile
   # is followed by the line 'Default=1'. If profiles.ini does contain 'Locked=1'
   # then the current profile is followed by the line 'Locked=1'
   #
   FPROFILE=$( find $HOME/.mozilla/firefox/ -type f -name "profiles.ini" )
   if grep -q "Locked=1$" "$FPROFILE"; then
      FCURPROF=$( grep -B 1 "Locked=1$" "$FPROFILE" | grep -v Locked )
   else
      FCURPROF=$( grep -B 1 "Default=1$" "$FPROFILE" | grep -v Default )
   fi
   FCURPROF=$( echo "$FCURPROF" | cut -d"=" -f2 )
   FHISTORY=$( find $HOME/.mozilla/firefox/"$FCURPROF" -type f -name "places.sqlite" )
   FCOOKIES=$( find $HOME/.mozilla/firefox/"$FCURPROF" -type f -name "cookies.sqlite" )
   FSITEDAT=$( find $HOME/.mozilla/firefox/"$FCURPROF" -type d -name "default" )
   FCACHEDF=$( find $HOME/.cache/mozilla/firefox/"$FCURPROF" -type d -name "entries" )
   echo; echo "Firefox is using profile: $FCURPROF"
fi
if [ -z "$THUNDERBIRD" ]; then
   echo
   echo "Thunderbird directory does not exist"
else
   # Thunderbird file locations. First get the current Profile Name
   # The profiles are listed in 'profiles.ini'.
   # If profiles.ini does not contain the line 'Locked=1' then the current profile
   # is followed by the line 'Default=1'. If profiles.ini does contain 'Locked=1'
   # then the current profile is followed by the line 'Locked=1'
   #
   TPROFILE=$( find $HOME/.thunderbird/ -type f -name "profiles.ini" )
   if grep -q "Locked=1$" "$TPROFILE"; then
      TCURPROF=$( grep -B 1 "Locked=1$" "$TPROFILE" | grep -v Locked )
   else
      TCURPROF=$( grep -B 1 "Default=1$" "$TPROFILE" | grep -v Default )
   fi
   TCURPROF=$( echo "$TCURPROF" | cut -d"=" -f2 )
   THISTORY=$( find $HOME/.thunderbird/"$TCURPROF" -type f -name "places.sqlite" )
   TCOOKIES=$( find $HOME/.thunderbird/"$TCURPROF" -type f -name "cookies.sqlite" )
   TCACHEDF=$( find $HOME/.cache/thunderbird/"$TCURPROF" -type d -name "entries" )
   echo; echo "Thunderbird is using profile: $TCURPROF"
fi
#
MENU=""
while [[ $MENU != "E" ]] && [[ $MENU != "e" ]]; do
   echo
   echo -n "[C]hrome, [F]irefox, T[hunderbird or [E]xit: "
   read -n1 MENU
   echo
   case $MENU in
      [Cc] ) ;;
      [Ff] ) ;;
      [Tt] ) ;;
      [Ee] ) ;;
      * ) echo; echo " Enter 'C/c', 'F/f', 'T/t' or 'E/e'"
   esac
   #########
   # Chrome
   #########
   while [[ $MENU == "C" ]] || [[ $MENU == "c" ]]; do
      pgrep -u $USER chrome > /dev/null
      if [[ $? -eq 0 ]]; then
         echo
         echo -n "Chrome Browser is open, do you wish to close it now? [Y/N]: "
         read -n1 YN
         echo
         if [[ $YN == "Y" ]] || [[ $YN == "y" ]]; then
            CPID=$( pgrep -u $USER chrome )
            CPID=$( echo $CPID | cut -d" " -f1 )
            kill -1 $CPID
         else
            echo
            echo " Cannot list or delete browser URLs if the browser is open"
            break
         fi
      fi
      if [ -z "$CHROME" ]; then
         echo
         echo "Chrome directory does not exist"
         break
      else
         CPROMPT=""
         echo
         echo -n "[D]elete, [L]ist or [E]xit: "
         read -n1 CPROMPT
         echo
         case $CPROMPT in
            [Dd] ) echo; echo " Chrome is using profile: $CCURPROF";;
            [Ll] ) echo; echo " Chrome is using profile: $CCURPROF";;
            [Ee] ) ;;
            * ) echo; echo " Enter 'D/d', 'L/l' or 'E/e'";;
         esac
         if [[ $CPROMPT == "E" ]] || [[ $CPROMPT == "e" ]]; then MENU=""; fi
         if [[ $CPROMPT == "D" ]] || [[ $CPROMPT == "d" ]]; then
            echo
            echo " Deleting Chrome URLs............."
            echo " ================================="
            sqlite3 "$CHISTORY" "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls; delete from urls;" | sed 's/^/ /'
            echo
            echo " Deleting Chrome Cookies.........."
            echo " ================================="
            sqlite3 "$CCOOKIES" "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies; delete from cookies;" | sed 's/^/ /'
            if [[ -d "$CCACHEDF" ]]; then
               echo
               echo " Deleting Chrome Cache............"
               echo " ================================="
               NUM=$( ls -1 "$CCACHEDF" | wc -l )
               SIZ=$( du -sbh "$CCACHEDF" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
               rm -r "$CCACHEDF"
            fi
            if [[ -d "$CCODECAC" ]]; then
               echo
               echo " Deleting Chrome Code Cache......."
               echo " ================================="
               NUM=$( ls -1 "$CCODECAC" | wc -l )
               SIZ=$( du -sbh "$CCODECAC" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
               rm -r "$CCODECAC"
            fi
            if [[ -f "$CVISITED" ]]; then
               echo
               echo " Deleting Visited Links..........."
               echo " ================================="
               rm "$CVISITED"
            fi
            if [[ -f "$CTOPSITS" ]]; then
               echo
               echo " Deleting Chrome Top Sites........"
               echo " ================================="
               rm "$CTOPSITS"
            fi
         fi
         if [[ $CPROMPT == "L" ]] || [[ $CPROMPT == "l" ]]; then
            echo
            echo " Current Chrome URLs.............."
            echo " ================================="
            sqlite3 "$CHISTORY" "select datetime(last_visit_time/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),url from urls;" | sed 's/^/ /' | more
            echo
            echo " Current Chrome Cookies..........."
            echo " ================================="
            sqlite3 "$CCOOKIES" "select datetime(creation_utc/1000000 + (strftime('%s', '1601-01-01')),'unixepoch'),host_key from cookies;" | sed 's/^/ /' |more
            if [[ -d "$CCACHEDF" ]]; then
               echo
               echo " Current Chrome Cache............."
               echo " ================================="
               NUM=$( ls -1 "$CCACHEDF" | wc -l )
               SIZ=$( du -sbh "$CCACHEDF" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
            fi
            if [[ -d "$CCODECAC" ]]; then
               echo
               echo " Current Chrome Code Cache............."
               echo " ======================================"
               NUM=$( ls -1 "$CCODECAC" | wc -l )
               SIZ=$( du -sbh "$CCODECAC" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
            fi
         fi
         CPROMPT=""
      fi
   done
   ##########
   # Firefox
   ##########
   while [[ $MENU == "F" ]] || [[ $MENU == "f" ]]; do
      pgrep -u $USER firefox > /dev/null
      if [[ $? -eq 0 ]]; then
         echo
         echo -n "Firefox Browser is open, do you wish to close it now? [Y/N]: "
         read -n1 YN
         echo
         if [[ $YN == "Y" ]] || [[ $YN == "y" ]]; then
            FPID=$( pgrep -u $USER firefox )
            FPID=$( echo $FPID | cut -d" " -f1 )
            kill -1 $FPID
         else
            echo
            echo " Cannot list or delete browser URLs if the browser is open"
            break
         fi
      fi
      if [ -z "$FIREFOX" ]; then
         echo
         echo "Firefox directory does not exist"
         break
      else
         FPROMPT=""
         echo
         echo -n "[D]elete, [L]ist or [E]xit: "
         read -n1 FPROMPT
         echo
         case $FPROMPT in
            [Dd] ) echo; echo " Firefox is using profile: $FCURPROF";;
            [Ll] ) echo; echo " Firefox is using profile: $FCURPROF";;
            [Ee] ) ;;
            * ) echo; echo " Enter 'D/d', 'L/l' or 'E/e'";;
         esac
         if [[ $FPROMPT == "E" ]] || [[ $FPROMPT == "e" ]]; then MENU=""; fi
         if [[ $FPROMPT == "D" ]] || [[ $FPROMPT == "d" ]]; then
            echo
            echo " Deleting Firefox History........."
            echo " ================================="
            sqlite3 "$FHISTORY" "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;" | sed 's/^/ /'
            sqlite3 "$FHISTORY" "delete from moz_historyvisits;"
            echo
            echo " Deleting Firefox Cookies........."
            echo " ================================="
            sqlite3 "$FCOOKIES" "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies; delete from moz_cookies;" | sed 's/^/ /'
            echo
            echo " Deleting Firefox Site Data......."
            echo " ================================="
            ls "$FSITEDAT" | grep http | sed 's/^/ /'
            find "$FSITEDAT" -name "http*" -type d -exec rm -r "{}" \; -prune
            echo
            echo " Deleting Firefox Cache..........."
            echo " ================================="
            if [[ $( ls -A "$FCACHEDF" ) ]]; then # Directory not empty
               NUM=$( ls -1 "$FCACHEDF" | wc -l )
               SIZ=$( du -sbh "$FCACHEDF" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
               find "$FCACHEDF" -type f -delete
            fi
         fi
         if [[ $FPROMPT == "L" ]] || [[ $FPROMPT == "l" ]]; then
            echo
            echo " Current Firefox History.........."
            echo " ================================="
            sqlite3 "$FHISTORY" "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;" | sed 's/^/ /' | more
            echo
            echo " Current Firefox Cookies.........."
            echo " ================================="
            sqlite3 "$FCOOKIES" "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies;" | sed 's/^/ /' | more
            echo
            echo " Current Firefox Site Data........"
            echo " ================================="
            ls "$FSITEDAT" | grep http | sed 's/^/ /' | more
            echo
            echo " Current Firefox Cache..........."
            echo " ================================"
            NUM=$( ls -1 "$FCACHEDF" | wc -l )
            SIZ=$( du -sbh "$FCACHEDF" )
            SIZ=$( echo $SIZ | cut -d" " -f1 )
            echo " Files: $NUM Size: $SIZ"
         fi
         FPROMPT=""
      fi
   done
   ##############
   # Thunderbird
   ##############
   while [[ $MENU == "T" ]] || [[ $MENU == "t" ]]; do
      pgrep -u $USER thunderbird > /dev/null
      if [[ $? -eq 0 ]]; then
         echo
         echo -n "Thunderbird e-mail client is open, do you wish to close it now? [Y/N]: "
         read -n1 YN
         echo
         if [[ $YN == "Y" ]] || [[ $YN == "y" ]]; then
            TPID=$( pgrep -u $USER thunderbird )
            TPID=$( echo $TPID | cut -d" " -f1 )
            kill -1 $TPID
         else
            echo
            echo " Cannot list or delete Thunderbird URLs if the e-mail client is open"
            break
         fi
      fi
      if [ -z "$THUNDERBIRD" ]; then
         echo
         echo "Thunderbird directory does not exist"
         break
      else
         TPROMPT=""
         echo
         echo -n "[D]elete, [L]ist or [E]xit: "
         read -n1 TPROMPT
         echo
         case $TPROMPT in
            [Dd] ) echo; echo " Thunderbird is using profile: $TCURPROF";;
            [Ll] ) echo; echo " Thunderbird is using profile: $TCURPROF";;
            [Ee] ) ;;
            * ) echo; echo " Enter 'D/d', 'L/l' or 'E/e'";;
         esac
         if [[ $TPROMPT == "E" ]] || [[ $TPROMPT == "e" ]]; then MENU=""; fi
         if [[ $TPROMPT == "D" ]] || [[ $TPROMPT == "d" ]]; then
            echo
            echo " Deleting Thunderbird History........."
            echo " ====================================="
            sqlite3 "$THISTORY" "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;" | sed 's/^/ /'
            sqlite3 "$THISTORY" "delete from moz_historyvisits;"
            echo
            echo " Deleting Thunderbird Cookies........."
            echo " ====================================="
            sqlite3 "$TCOOKIES" "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies; delete from moz_cookies;" | sed 's/^/ /'
            echo
            echo " Deleting Thunderbird Cache..........."
            echo " ====================================="
            if [[ $( ls -A "$TCACHEDF" ) ]]; then # Directory not empty
               NUM=$( ls -1 "$TCACHEDF" | wc -l )
               SIZ=$( du -sbh "$TCACHEDF" )
               SIZ=$( echo $SIZ | cut -d" " -f1 )
               echo " Files: $NUM Size: $SIZ"
               find "$TCACHEDF" -type f -delete
            fi
         fi
         if [[ $TPROMPT == "L" ]] || [[ $TPROMPT == "l" ]]; then
            echo
            echo " Current Thunderbird History.........."
            echo " ====================================="
            sqlite3 "$THISTORY" "SELECT datetime(moz_historyvisits.visit_date/1000000,'unixepoch'), moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id;" | sed 's/^/ /' | more
            echo
            echo " Current Thunderbird Cookies.........."
            echo " ====================================="
            sqlite3 "$TCOOKIES" "select datetime(creationTime/1000000,'unixepoch'),host from moz_cookies;" | sed 's/^/ /' | more
            echo
            echo " Current Thunderbird Cache..........."
            echo " ===================================="
            NUM=$( ls -1 "$TCACHEDF" | wc -l )
            SIZ=$( du -sbh "$TCACHEDF"  )
            SIZ=$( echo $SIZ | cut -d" " -f1 )
            echo " Files: $NUM Size: $SIZ"
         fi
         TPROMPT=""
      fi
   done
done
echo

Listed below is the Desktop Configuration file clear_browser_data.desktop for KDE in Gentoo Linux that I created in the ~/Desktop/ directory. I downloaded a nice PNG icon from the Web, which I saved as ~/Pictures/Icons/broom.png, although of course the Desktop Configuration file can be modified if the icon file were to be stored elsewhere. Obviously change the username accordingly.

[Desktop Entry]
Comment[en_GB]=Clear Chrome, Firefox or Thunderbird caches and cookies
Comment=Clear Chrome, Firefox or Thunderbird caches and cookies
Exec=/home/fitzcarraldo/clear_browser_data.sh
GenericName[en_GB]=Clear browser caches and cookies
GenericName=Clear browser caches and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/broom.png
MimeType=
Name[en_GB]=clear_browser_data
Name=clear_browser_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=fitzcarraldo

Listed below is the Desktop Configuration file clear_browser_data.desktop for LXDE in Lubuntu 18.04 that I created in the ~/Desktop/ directory. I downloaded a nice PNG icon from the Web, which I saved as ~/Pictures/Icons/broom.png, although of course the Desktop Configuration file can be modified if the icon file were to be stored elsewhere. Obviously change the username accordingly.

[Desktop Entry]
Comment[en_GB]=Clear Chrome, Firefox or Thunderbird caches and cookies
Comment=Clear Chrome, Firefox or Thunderbird caches and cookies
Exec=/home/fitzcarraldo/clear_browser_data.sh
GenericName[en_GB]=Clear browser caches and cookies
GenericName=Clear browser caches and cookies
Icon=/home/fitzcarraldo/Pictures/Icons/broom.png
MimeType=
Name[en_GB]=clear_browser_data
Name=clear_browser_data
Path=/home/fitzcarraldo
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-LXDE-SubstituteUID=false
X-LXDE-Username=fitzcarraldo

Update April 5, 2020: I have modified Lines 24, 37 (a comment), 40 and 55 in the above script. The original Line 24 did not select the Chrome profile name correctly in another installation, the original Line 40 did not select the Firefox profile name correctly in another installation, and the search string for the Thunderbird profile was not tight enough in the original Line 55. The above script now works in three different installations.

Update April 25, 2020: Arrgghh! I installed Thunderbird in Lubuntu 18.04 and discovered that clear_browser_data.sh did not find the Thunderbird cached files to delete. Unlike Thunderbird in Gentoo Linux on my main laptop, the file profiles.ini for Thunderbird (but not Firefox) in my Lubuntu 18.04 installation contains a line ‘Locked=1‘, and the actual profile used by Thunderbird in Lubuntu 18.04 is the profile specified in the line before ‘Locked=1‘, not the profile specified in the line before ‘Default=1‘. Someone I know uses Ubuntu 16.04 and he tells me Firefox in his installation is like this too. So, for reasons I don’t know, profiles.ini contains ‘Locked=1‘ in some Firefox or Thunderbird installations but not in others. Anyway, I have now modified the script to cater for both cases. It checks if the profiles.ini files for Firefox and Thunderbird contain ‘Locked=1‘ and, if they do, finds the currently-used profile from the line before ‘Locked=1‘ instead of the line before ‘Default=1‘. The line numbers mentioned in my previous update will be different now.

Using the ClamAV daemon to scan files placed in my Downloads directory in Gentoo Linux

In a previous post I explained how to automatically detect files placed in my Downloads directory in Linux and scan them for viruses. The method I described in that post used clamscan, the command-line anti-virus scanner of ClamAV. Now, in addition ClamAV has a daemon (a program that runs continuously in the background), clamdscan, that you can enable. So I decided to switch to using clamdscan, as its response to downloaded files is much faster because the process waiting for new files to appear in ~/Downloads/ does not have to load clamscan from disk each time a new file arrives. Anyway, if you want to monitor a download directory in Gentoo Linux (running OpenRC) by using the ClamAV daemon — which will also download virus signature database updates automatically — then the procedure to set this up is given below.

1. Install clamav if it is not installed already:

root # emerge clamav

2. Add the service to the default runlevel:

root # rc-update add clamd default

The daemon will be launched automatically next time the computer boots.

3. The first download of the virus database has to be done manually:

root # freshclam

4. Start the daemon now:

root # rc-service clamd start

5. Create the Bash script ~/monitorDownloadsGUI with the following contents:

#!/bin/bash

DIR=$HOME/Downloads

# Get rid of old log file, if any
rm $HOME/virus-scan.log 2> /dev/null

IFS=$(echo -en "\n\b")

# Optionally, you can use shopt to avoid creating two processes due to the pipe
shopt -s lastpipe
inotifywait --quiet --monitor --event close_write,moved_to --recursive --format '%w%f' $DIR | while read FILE
# Added '--recursive' so that a directory copied into $DIR also triggers clamscan/clamdscan, although downloads
# from the Web would just be files, not directories.
do
# Have to check file length is nonzero otherwise commands may be repeated
if [ -s $FILE ]; then
# Replace 'date >' with 'date >>' if you want to keep log file entries for previous scans.
date > $HOME/virus-scan.log
clamdscan --fdpass --move=$HOME/virus-quarantine $FILE >> $HOME/virus-scan.log
kdialog --title "Virus scan of $FILE" --msgbox "$(cat $HOME/virus-scan.log)"
fi
done

Make it executable:

user $ chmod +x ~/monitorDownloadsGUI

6. Create the directory ~/virus-quarantine/ to store infected files pending investigation/deletion:

user $ mkdir ~/virus-quarantine

7. Install kdialog if it is not already installed:

root # emerge kdialog

8. Use ‘System Settings’ > ‘Startup and Shutdown’ > ‘Autostart’ to add the script ~/monitorDownloadsGUI to the list of script files that are automatically started each time you log in to KDE.

9. Log out then back in again, and you should see that everything is running as expected:

user $ rc-status | grep clam
 clamd                                                             [  started  ]

user $ ps -ef | grep clam | grep -v grep
clamav    1920     1  0 01:48 ?        00:00:00 /usr/sbin/clamd
clamav    1929     1  0 01:48 ?        00:00:00 /usr/bin/freshclam -d

user $ ps -ef | grep GUI | grep -v grep
fitzcarraldo      9143  8971  0 13:56 ?        00:00:00 /bin/bash /home/fitzcarraldo/.config/autostart-scripts/monitorDownloadsGUI.sh

10. To test, surf to http://www.eicar.org/ and download one of the EICAR test files into your ~/Downloads/ directory. You should see a pop-up KDialog window with a message similar to the following:

Virus scan of /home/fitzcarraldo/Downloads/eicarcom2.zip — KDialog

Mon 27 Feb 14:05:26 GMT 2017
/home/fitzcarraldo/Downloads/eicarcom2.zip: Eicar-Test-Signature FOUND
/home/fitzcarraldo/Downloads/eicarcom2.zip: moved to ‘/home/fitzcarraldo/virus-quarantine/eicarcom2.zip’

———– SCAN SUMMARY ———–
Infected files: 1
Time: 0.001 sec (0 m 0 s)

Note that the above-mentioned pop-up window may be preceded by one or more pop-up windows with an error message. I’m using the Chrome browser at the moment, but you may get a similar message if you are using another browser. Here is an example:

Virus scan of /home/fitzcarraldo/Downloads/.com.google.Chrome.Uh3oGm — KDialog ?

Mon 27 Feb 14:16:30 GMT 2017
/home/fitzcarraldo/Downloads/.com.google.Chrome.Uh3oGm: Access denied. ERROR

———– SCAN SUMMARY ———–
Infected files: 0
Total errors: 1
Time: 0.000 sec (0 m 0 s)

Read the error message and click ‘OK’, as this is not an actual problem; it is inotifywait detecting temporary files in the ~/Downloads/ directory during the download process. With larger files sometimes several such messages are displayed, presumably because the file being downloaded is being opened and closed more than once during the downloading process. This issue does not occur if you copy or move a file into ~/Downloads/ from another directory in your installation; try it and see for yourself. Then you only get the one pop-up window with the scan result for the file you put in ~/Downloads/.

Also have a look in ~/virus-quarantine/ and you will see the EICAR test file in that directory. You can delete it if you want (it is not infected with a real virus, so does no harm).

In future be sure to read the messages in the pop-up windows before clicking ‘OK’, as they will inform you that an infected file has been moved to the quarantine directory.

That’s all there is to it. Very simple, and quite handy if you want to check quickly that files you download don’t have a malware payload. Just make sure you download all files into ~/Downloads/ or they will not be checked automatically. Also, if you are given e.g. a USB pen drive with a file on it, you can copy the file to ~/Downloads/ if you want it to be scanned for malware.

WebRTC – A viable alternative to Skype

Skype for Linux 4.3 and upwards requires the use of PulseAudio, which has caused discontent amongst those Linux users who do not use PulseAudio. Although I do use PulseAudio, I recently found out about WebRTC, an API (application programming interface) for browser-based communication offering most of the functions provided by Skype, namely: voice calling, video chat, text chat, file sharing and screen sharing. The official WebRTC site states:

WebRTC is a free, open project that enables web browsers with Real-Time Communications (RTC) capabilities via simple JavaScript APIs. The WebRTC components have been optimized to best serve this purpose.

Our mission: To enable rich, high quality, RTC applications to be developed in the browser via simple JavaScript APIs and HTML5.

WebRTC was originally released by Google but is now a draft standard of the World Wide Web Consortium, and is supported by Chrome, Firefox and Opera browsers. Several commercial Web sites offer WebRTC-based communications to fee-paying customers, but I thought I would try WebRTC by using one of the so-called ‘demo’ WebRTC pages. AppRTC is a WebRTC demo page which can be reached from a link on the official WebRTC site, but I prefer Multi-Party WebRTC Demo by TokBox which offers a more polished experience with better features. Both are free to use and viable substitutes to Skype for video chatting (one-to-one or conference).

So, how do you actually use WebRTC-based sites? Below is a quick guide to get you going.

Text and video chatting

Open the following URL in Chrome or Firefox:

https://opentokrtc.com/

Enter a Room Name that is likely to be unique. I used ‘fitzchat’ (without the quotes), but you can use any name you want.

The other party or parties can do the same thing, i.e. they enter the same Room Name as you, and you will all become connected.

Alternatively, to send an e-mail invitation to someone, click on the URL at the top of the pane on the right-hand side (which is Invite: https://opentokrtc.com/fitzchat in this example, as I chose to name the Room ‘fitzchat’). The partially visible pane at the right-hand side of the browser window will slide into full view when you click on it.

That’s all there is to it. You should see a video window showing each party, and they should see the same. Each party should also be able to hear the other parties. In the top right-hand corner of each video window is an icon (microphone for you; speaker for each of the other parties) which you can click on to mute/un-mute that party.

Click on the partially visible pane at the right-hand side of the browser window. Notice the ‘chat bar’ at the bottom where you enter commands and chat text. Read the grey instructions listed near the top of the pane:

Welcome to OpenTokRTC by TokBox
Type /nick your_name to change your name
Type /list to see list of users in the room
Type /help to see a list of commands
Type /hide to hide chat bar
Type /focus to lead the group
Type /unfocus to put everybody on equal standing

For example, to give myself a meaningful name instead of the default username Guest-0120e48c which was given to me automatically, I entered the following:

           /nick Fitz

Screen sharing

I found that screen sharing already works well in Chrome 36.0.1985.125 but is not yet supported in Firefox 31.0. It will be supported in Firefox 32 or 33, apparently, or you can already use Firefox Nightly providing you add the appropriate preferences via about:config.

To be able to share screens in Chrome, I had to perform two steps: enable a Chrome flag and install a Chrome extension. The two steps, which do not need to be repeated, are given below (see Ref. 1).

To enable screen sharing in Chrome, do the following:

  1. Open a new tab or window in Chrome.
  2. Copy the following link: chrome://flags/#enable-usermedia-screen-capture and paste it in the location bar.
  3. Click on the ‘Enable’ link below ‘Enable screen capture support in getUserMedia().’ at the very top of the screen.
  4. Click on the ‘Relaunch Now’ button at the bottom of the page to restart Chrome.

To install the screen sharing extension in Chrome, do the following:

  1. Launch Chrome and click on the Menu icon.
  2. Click on ‘Settings’.
  3. Click on ‘Extensions’.
  4. Click on ‘Get more extensions’ and search for ‘webrtc’.
  5. Download ‘WebRTC Desktop Sharing’.
  6. This places an icon to the right of the URL bar in Chrome.

To share your screen or just a window, do the following in Chrome:

  1. Click on the ‘Share Desktop’ icon to the right of the URL bar and select either ‘Screen’ or the window you wish to share.
  2. Click ‘Share’.
  3. When sharing has started in a new Chrome window, select the URL of the relevant tab in that window and send it to the other parties via the chat pane on the right-hand side of the first browser window.

To stop sharing, click on ‘Stop sharing’ and click on the ‘Share Desktop’ icon to the right of the URL bar to get it to return to displaying the ‘Share Desktop’ icon instead of the || (Pause) icon.

File sharing

I did not bother to try file sharing using WebRTC, but there are various Web sites you can use to do that. One such is ShareDrop, and googling will find others.

Caveats

Chrome 36.0.1985.125 and Firefox 31.0 were used in this trial (I did not try Opera). I found that video chat worked faultlessly when both parties were using Chrome, and when both parties were using Firefox. However, when one of the parties was using Firefox and the other was using Chrome, I could not see myself in one of the video boxes in the browser window (although I could see the other party in the other video box in the browser window). Furthermore, there was a grey bar across the middle of the video images in the AppRTC demo, whereas the Multi-Party WebRTC Demo video images were normal. Other than those two issues, the experience was smooth and straightforward. My recommendation would therefore be to use Multi-Party WebRTC Demo and for all the parties to use the same browser, be it Chrome or Firefox. If you want to share your screen or a window, the logical choice at the moment would be Chrome.

References

1 LiveMinutes Blog – Beta Testers: How To Activate Screen Sharing!

UPDATE (January 2, 2015): Mozilla has added a button to Firefox 34 to provide account-free video chat using WebRTC. Mozilla calls this feature ‘Firefox Hello’.

https://support.mozilla.org/en-US/kb/where-firefox-hello-button

I have it in Firefox 34.0.5 (I had to drag the ‘Hello’ button from ‘Customise’ | ‘Additional Tools and Features’). It works quite well. I didn’t bother creating an account; I just clicked on the ‘Email’ button to e-mail the automatically-generated URL to someone, and he clicked on the URL in the e-mail he received, which launched Firefox on his laptop and rang Firefox on my laptop. We tried both video and audio-only conversations, and both worked well. Firefox Hello is not as polished as Skype but, if Mozilla keeps working on it, they could end up with a good product.

Can Linux cope with 24 Hours of Happy?

I enjoyed Pharrell Williams’ feel-good songs in ‘Despicable Me‘ and its sequel, ‘Despicable Me 2‘. ‘Happy‘, a very catchy ditty he wrote for the sequel, also features in the World’s first 24-hour-long music video, ‘24 Hours of Happy‘, shot in and around Los Angeles and released on 21 November last year. The song is played a total of 360 times over the duration of the video, each 4-minute take featuring a different person or persons dancing (improvised) along streets, in petrol stations, through Union Station, in a church, around a school, in a moving school bus, around a supermarket, in a bowling alley, and so on. Each 4-minute performance was filmed in one take using Steadicam, and the location at the end of each take segues into the next take. You see the sun rise; you see the bright sunlight of the morning and the warm sunlight of the afternoon; you see the sun set; you see the twinkling city lights at night. The concept is simple yet brilliant.

Clips from some of the takes were used to create the 4-minute official music video for ‘Happy’, so you can watch that on YouTube to get a flavour of the takes, although it does not do justice to the full video.

Williams appears in a different take every hour on the hour, and a few other takes have celebrity cameos, but the vast majority of the participants are unknown extras of all ages, races, shapes, sizes and looks. To quote Williams talking to the Los Angeles Times: “We wanted all humanity in there, not just the model-types you might expect.” Some are good dancers, others not so good. But they all have one thing in common: they’re having fun, so they look good. The joy is infectious, and I found myself watching far longer than I would have expected, having to return to the site again and again. Half the fun is watching the bystanders.

When you open the ’24 Hours of Happy’ site, the take that was in progress at the current time of day starts playing from the beginning. However, you can drag the pointer around the clock dial and watch any take from the 24-hour period. There are also buttons you can click on to jump between takes or to jump to each take featuring Williams. The yellow on-screen controls can be made to disappear by not moving the mouse pointer for 5 seconds.

Still from 24 Hours of Happy, showing on-screen controls

Still from 24 Hours of Happy, showing on-screen controls

The Web site is well-designed and fun to use, so I was not surprised it was voted ‘Site of the Month‘ and ‘Site of the Year Users’ Choice‘ by AWWWARDS, and voted ‘Site of the Month‘ and ‘Site of the Year‘ by TheFWA.

It’s impossible to list them all, but a few of my favourite takes are:

01:36  Very perky woman with ponytail.
05:28  Jogger who has to keep pulling his shorts up!
08:24  Woman on roller skates.
09:52  Very cute little girl.
09:56  Woman with some groovy moves.
10:40  Woman in Union Station. Some of the bystanders are particularly amusing.
11:16  Man with cast on foot.
11:20  Boy with an Afro.
11:36  Three groovy old ladies.
11:44  Chubby guy with style.
12:36  Woman with some groovy moves.
13:32  Dancing couple in pink.
14:20  Two cool guys in dinner jackets inside and outside Union Station.
15:00  Pharrell Williams in a church with a gospel choir.
19:04  Woman with a lizard puppet. The lizard does the lip-synching!
19:36  Guy on stilts.
23:40  Woman with LED hula hoop (love it!).

If you want to start viewing a take made at a specific time of day, you can append the time to the URL, like so:

http://24hoursofhappy.com/09h53am

Obviously I think ’24 Hours of Happy’ is fabulous, but why am I discussing it in a blog predominantly about Linux? Because Firefox 27.0.1 (32-bit) running in Windows 8.1 (64-bit) on my new Acer Aspire XC-600 micro-tower PC (dual-core Intel Pentium G2030 @ 3 GHz & 3 MB cache, 4 GB DDR3 RAM) handles ’24 Hours of Happy’ at 720p with ease, but the story is very different on my main laptop running 64-bit Gentoo Linux with KDE (quad-core Intel Core i7 720QM @ 933 MHz & 6 MB cache, 4 GB DDR3 RAM). Both machines are on my home network, connected to the Internet via high-bandwidth broadband (FTTC).

On my laptop, the latest available versions of Firefox (27.0) and Opera (12.16_p1860-r1) for Gentoo, both 64-bit, do not even complete loading the ’24 Hours of Happy’ site: the black progress bar at the bottom of the home page stops about 7/8th of the way across the page and the KDE Network Monitor widget shows there is no network activity. Clearing Firefox’s Web content cache or increasing the cache’s size to 1 GB make no difference. Konqueror 4.12.2 (configured to use the WebKit browser engine rather than the KHTML engine) loads the site and plays it quite well at 720p to start with, but eventually video becomes choppy and I notice a lot of spawned kio_http processes. The KDE Network Monitor widget shows a continuous 3600 Kib/s data stream, which does not stop when I exit Konqueror. Numerous kio_http processes are spawned and remain after I exit Konqueror, and the 3600 KiB/s activity on the network only ceases when I kill all the kio_http processes. The number of spawned kio_http processes increases if I drag the pointer around the clock to select different takes, and the page just displays ‘LOADING’ ad infinitum if I do this several times. To be fair, if I do this a lot in Firefox running in Windows 8.1, I can get Firefox to stall too. I thought I’d try a lightweight browser and installed NetSurf (3.0-r1), but that couldn’t even render the title on the home page, let alone begin to load the video.

So, does ’24 Hours of Happy’ play nicely in your Linux installation? If it does, what hardware, distribution, desktop environment, browser and quality (360p, 480p, 720p or 1080p) are you using?