Category Archives: Linux

Linux based Operating Systems

Thunderbird 60 gcontactsync Blocked after enabling OAuth2

These notes apply to Kubuntu 18.04 and Thunderbird 60.9.1.

After Google restricted access for LSA’s (Less Secure Apps) it was necessary to change the Gmail account authentication method from “Normal Password” to OAuth2. After this gcontactsync failed – after logging into Google and successfully allowing access to Contacts it was blocked. After extensively trawling the net for a solution one was found. This said the problem was due to Thunderbird being corrupted and the solution offered was a complete rebuild – drastic but it worked!

The rebuild steps are follows:

Save Update History

Save version history, using apt policy,, which might be needed to rollback later, e.g. when TB automatically updates when not desired.

$ sudo apt policy thunderbird
thunderbird:
  Installed: 1:60.2.1+build1-0ubuntu0.18.04.2
  Candidate: 1:60.2.1+build1-0ubuntu0.18.04.2
  Version table:
 *** 1:60.2.1+build1-0ubuntu0.18.04.2 500
        500 http://au.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     1:52.7.0+build1-0ubuntu1 500
        500 http://au.archive.ubuntu.com/ubuntu bionic/main amd64 Packages<<

Example rollback

$ sudo apt install thunderbird=1:52.7.0+build1-0ubuntu1

Backup Address Books

In Address Book export each address book in LDIF format to Desktop\Contacts. The exported files names take the same name as the address book, e.g. Personal Address Book = Personal Address Book.ldif

Exit Thunderbird

Ensure all Thunderbird windows are closed

Uninstall Thunderbird

Using Synaptic Package Manager search for “thunderbird” and mark for complete removal and apply

Rename Thunderbird data folders

mv /home/user/.thunderbird /home/user/.thunderbird 60.9.1 backup
mv /home/user/.cache/.thunderbird /home/user/.cache/.thunderbird 60.9.1 backup

This effectively wipes all traces of Thunderbird data.

Install Thunderbird

Using Synaptic Package Manager search for “thunderbird” and Mark for installation and Apply

Launch Thunderbird

Search for Thunderbird and launch. From launchpad right-click Thunderbird and pin it to Desktop icons and Search and Launch.

  1. Add Google account by following the installation wizard
  2. In Config Editor Edit > Preferences > Advanced > Config Editor set the following:
    • Set “app.update.enabled” to false to disable automatic updates!!!
    • Set “general.useragent.compatMode.firefox” set to true to prevent Google Calendar continually asking for passwords and allow gcontactsync to display Google contacts lists to sync with
  3. Restore contacts in Address Book by importing saved address books
  4. Add gcontactsync and setup sync’ing of required address books with respective Google contact lists – should work now
  5. Add Provider for Google Calendar to synchronise calendars
  6. Add other email accounts as required

Notes for installing Thunderbird manually

Download required version from Thunderbird Releases

Install as follows

$ tar -zxvf thunderbird-60.9.1.tar.bz2  #creates thunderbird folder off Downloads
$ sudo su
# mkdir /opt/thunderbird
# cp thunderbird /opt
# exit

Create Thunderbird launcher

$ kate ~/Desktop/Thunderbird.desktop
[Desktop Entry]
Comment[en_GB]=Thunderbird email client
Comment=Thunderbird email client
Exec=/opt/thunderbird/thunderbird
GenericName[en_GB]=
GenericName=
Icon=/opt/thunderbird/chrome/icons/default/default256.png
MimeType=
Name[en_GB]=Thunderbird
Name=Thunderbird
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
Version=60.9.1
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Add Suspend icon to the KDE Application Menu

To add the Suspend icon to the KDE Application Menu

  1. Click the KDE icon (bottom left hand corner) to bring up the Application Menu
  2. Click “Power/Session” on right-hand list to bring up list of Shutdown Options
  3. Right-click Suspend and select Add to Favorites

Similarly you can add or remove other shutdown icons.

 

 

Linux Content Search Tool

Use Catfish to find files and file content quickly – note content search only works for text type files. Use Recoll for other file types.

Install using Synaptic Package Manager or from Terminal as follows:

sudo apt install catfish

Run it by selecting it from from Utilities or use the Search function and enter Catfish to locate.

Once running you should see screen below.

To search for content first click the settings cog and check “Search File Contents”. This will then force Catfish to search for the string in the files within the top directory you have selected to the left of the search box. In this example we are searching for the content string “tooltip” within files in the the top folder “scss”. The number of hits (3) and files are displayed that contain “tooltip” in the main window. To open a file double-click it.

To search for file names only uncheck “Search File Contents”

Create macOS install usb using Linux

If you don’t have a spare Mac or your Mac is too old to download macOS from the Apple App Store then use the method below.

Create account on hackintosh.download

The download required macOS from https://www.hackintosh.download/category/3-macos/

Insert a usb (16GB+ recommended) into Linux PC usb port and run Terminal

Use fdisk to determine your usb dev name letter, e.g. /dev/sdc. double check the target device letter to avoid overwriting the wrong drive.

sudo fdisk -l

Use dm2img to copy macOS (OS X El Capitan in this example) to your usb device (sdc in this example). This completely overwrites whatever is on the usb drive already!

sudo apt install dmg2img  # install dmg2img if not installed

sudo dmg2img -v -i ./EL_Capitan.dmg  -o /dev/sdc
Output from dmg2img...
dmg2img v1.6.7 (c) vu1tur (to@vu1tur.eu.org)

./EL_Capitan.dmg --> /dev/sdc

reading property list, 361779 bytes from address 6237611619 ...
partition 0: begin=192, size=430, decoded=284
partition 1: begin=908, size=430, decoded=284
partition 2: begin=1611, size=356137, decoded=239844

decompressing:
opening partition 0 ...         [2] 100.00%  ok
opening partition 1 ...         [2] 100.00%  ok
opening partition 2 ...      [5991] 100.00%  ok

When complete eject the usb.

Insert usb in your Mac and when power-up holding down the Alt | Option key until the Install usb icon is displayed in the middle of the screen.

Select the install usb to install macOS

Once in Recovery mode select Disk Utility to erase disk (if new drive or clean install)

Exit Disk Utility

Select mac OS to install from main menu and install to your main HDD or SSD

Note: the download source above is not Apple approved. To be safe, once your Mac is up and running, download the mac OS again from the Apple Store and re-create the install usb and carry out a clean install again.

Alternative MacOS (English) Source

user:~$ cd Downloads/
mkdir macosdownload
git clone https://github.com/kholia/OSX-KVM.git macOS-Big-Sur
Cloning into 'macOS-Big-Sur'...
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 991 (delta 0), reused 1 (delta 0), pack-reused 986
Receiving objects: 100% (991/991), 223.56 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (501/501), done.
Checking out files: 100% (94/94), done.
user:~$ ~/Downloads/macosdownload$ cd macOS-Big-Sur/

user:~/Downloads/macosdownload/macOS-Big-Sur$ ./fetch-macOS.py
[+] Fetching https://swscan.apple.com/content/catalogs/others/index-11-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
[+] Fetching http://swcdn.apple.com/content/downloads/41/23/061-26578-A_FF0C6M87LS/ylvl0phx6uy3i444qt9p57n8wz0xnylmd9/InstallAssistantAuto.smd
[+] Fetching https://swdist.apple.com/content/downloads/41/23/061-26578-A_FF0C6M87LS/ylvl0phx6uy3i444qt9p57n8wz0xnylmd9/061-26578.English.dist
.
. 
.                            
 #    ProductID    Version   Post Date  Title                                                                                                                               
 1    061-26578    10.14.5  2019-10-14  macOS Mojave
 2    061-26589    10.14.6  2019-10-14  macOS Mojave
 3    041-91758    10.13.6  2019-10-19  macOS High Sierra
 4    041-88800    10.14.4  2019-10-23  macOS Mojave
 5    041-90855    10.13.5  2019-10-23  Install macOS High Sierra Beta
 6    061-86291    10.15.3  2020-03-23  macOS Catalina
 7    001-04366    10.15.4  2020-05-04  macOS Catalina
 8    001-15219    10.15.5  2020-06-15  macOS Catalina
 9    001-36735    10.15.6  2020-08-06  macOS Catalina
10    001-36801    10.15.6  2020-08-12  macOS Catalina
11    001-51042    10.15.7  2020-09-24  macOS Catalina
12    001-57224    10.15.7  2020-10-27  macOS Catalina
13    001-68446    10.15.7  2020-11-11  macOS Catalina
14    001-79699     11.0.1  2020-11-12  macOS Big Sur

Choose a product to download (1-14):

This will download a .pkg file from which you can extract the .app require to create a bootable usb

  1. Right-click on the .pkg file > select “Show Package Contents”
  2. Open the Contents/SharedSupport folder and locate the file named InstallESD.dmg

For further information see:
how-to-install-macos-big-sur-with-opencore-on-linux

Note: to get install version of app file open dmg file to copy app file to Applications folder

 

Useful Linux Terminal Commands

Display details about firmware, cache, memory

$ sudo lshw -C memory
  *-firmware                
       description: BIOS
       vendor: FUJITSU // Phoenix Technologies Ltd.
       physical id: 0
       version: 6.00 R1.06.3012.A1
       date: 04/21/2011
       size: 110KiB
       capacity: 4032KiB
       capabilities: pci pnp upgrade shadowing escd cdboot bootselect int13floppynec int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer int10video acpi usb ls120boot zipboot biosbootspecification
  *-cache:0
       description: L1 cache
       physical id: 5
       slot: L1 Cache
       size: 64KiB
       capacity: 64KiB
       capabilities: burst synchronous internal write-through data
       configuration: level=1
...
  *-memory
       description: System Memory
       physical id: 2a
       slot: System board or motherboard
       size: 16GiB
     *-bank:0
          description: DIMM DDR3 Synchronous 1067 MHz (0.9 ns)
          product: 99U5471-021.A00LF
          vendor: Toshiba
          physical id: 0
          serial: DE131F7C
          slot: Slot-1
          size: 4GiB
          width: 64 bits
          clock: 1067MHz (0.9ns)
...

Test and Benchmark 3D Graphics

sudo apt install glmark2
glmark2

Create bootable usb using DD

This method depends on the iso file being designed as bootable, e.g Kaspersky Rescue Disk or Bitdefender Rescue CD, etc.

Plug in the USB flash drive and list its device name using fdisk

sudo fdisk -l
.
.
.
Disk /dev/sdc: 3.8 GiB, 4009754624 bytes, 7831552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x052e500d

Device     Boot Start     End Sectors  Size Id Type
/dev/sdc1  *     2048 7831551 7829504  3.8G  c W95 FAT32 (LBA)

Unmount the device partition, e.g. sdc1.

umount /dev/sdc1

Copy the iso. file to the device (sdc) not the partition (sdc1). Note the larger block size (4M, default 512bytes) to speed up the transfer. The usb light will flash during copying. Note this can take a long time depending on iso file size. Be patient. When finished dd displays a summary report of bytes copied.

sudo dd if=filename.iso of=/dev/sdc bs=4M

Finally flush the io buffers and eject

sync

sudo eject /dev/sdc

Downgrade Linux Thunderbird

For those who have upgraded to latest Thunderbird to find Calendar add-on is suddenly not compatible. The quick fix is to roll-back to last version as follows:

Display Thunderbird available versions

apt-cache show thunderbird | grep Version

Select last version to rollback to, e.g.

sudo apt-get install thunderbird=1:52.9.1+build3-0ubuntu0.14.04.1

 

 

 

Stretch YouTube Video To Fit Browser Window

Fit a YouTube video in the browser window as follows:

Normal YouTube Video URL is https://www.youtube.com/watch?v=grItaOxuyTE&t

To watch in a re-sizable window without switching to Full Screen rewrite the above URLas follows:

https://www.youtube.com/v/grItaOxuyTE&t

Append your YouTube video ID to www.youtube.com/v/VIDEO_ID to display a re-sizeable browser window.

In other words replace /watch?v= with /v/ in the normal URL