Friday, June 29, 2018

Change file associations in KDE


You should just need to, Right click any file in dolphin, go to properties, then file type options. under application preference order, move the app you want to open that file to the top of the list, then click Apply.
All files of that type should now open with the app. you chose.

 https://ubuntuforums.org/showthread.php?t=2287371

Embedded python argv problem

Workaround is to start embedded script with:
 
import sys

if not hasattr(sys, 'argv'):
    sys.argv  = [''] 
 
 https://github.com/google/oauth2client/issues/642

Thursday, June 28, 2018

Imagej / Fiji replace NaN

Use

Process -  Math - Macro



the last zero can be any value

Monday, June 18, 2018

Ubuntu 16 install Teamviewer 12

Bear in mind I have had this installed since 16.04 was in development and now in 16.10.
So some time has passed since then...but I seem to remember struggling with the 64 bit .deb
Went through some old notes and found my install went like this.
Code:
sudo dpkg --add-architecture i386
You have already done this
Code:
sudo apt-get update
And this also is already done
Code:
wget http://download.teamviewer.com/download/teamviewer_i386.deb
I choose the 32bit .deb
Code:
sudo dpkg -i --force-depends teamviewer_i386.deb


In case “dpkg” indicates missing dependencies, complete the installation by executing the following command:

Code:
sudo apt-get install -f
complete the installation by executing the following command:
Code:
sudo teamviewer --daemon start
Source: https://ubuntuforums.org/showthread.php?t=2340067

Sunday, June 17, 2018

Format usb stick / drive using Linux

Get the tool:
sudo apt-get update
sudo apt-get install dosfstools

Mount the stick via GUI
Check its path using:
df -m
(yes there are other more sleek ways to check it)

unmount the drive:
sudo umount /dev/sd<...>

format (FAT32 used as example here):
mkdosfs -F 32 -I /dev/sd<...>

Do not mix up drives, this erases all data irreversibly!

Friday, June 15, 2018

Set older kernel as default grub entry

 
First, make a backup copy of /etc/default/grub. If something goes wrong, you can easily revert to the known-good copy.
 
sudo cp /etc/default/grub /etc/default/grub.bak

Then edit the file using the text editor of your choice (e.g. gedit, etc.).
 
sudo -H gedit /etc/default/grub

Find the line that contains GRUB_DEFAULT - this is what you'll want to edit to set the default. You must know the full name of the kernel you want - e.g. Ubuntu, with 
Linux 3.13.0-53-generic - along with the full name of the "advanced menu" - e.g. Advanced options for Ubuntu.

To list all kernels do:
 dpkg --list | grep linux-image

You then combine those two strings with > and set GRUB_DEFAULT to them as:  

GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-53-generic" (including quotes).

Save it, then build the updated grub menu.
sudo update-grub 

Sources:
https://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry
https://www.cyberciti.biz/faq/howto-display-all-installed-linux-kernel-version/

KDE Linux update settings 16.04, prevent automatic updates

Start->System->Update Manager

More...->Advanced->Configure Software Sources

Enter sudo password for current account
In "Software Sources" choose "Updates" tab
Select radio button "Only notify about available updates"

Press “Close”, the choices will be saved this way.