1275 words

Ubuntu - Add .AppImage to the dock as a favourite.

Here is the source article. All credit to the original author.

Desired outcome:

  • Launch an ".AppImage" application from an icon on the dock.

Prerequisites:

  • The .AppImage for the application.
  • Path to the .AppImage on local system
    • I chose "/home/USER_NAME/Programs/"
  • Icon for the .AppImage
    • Find the Standard Notes image on their website.
    • I chose to keep the icon in same location as the ".AppImage"

Note

  • I'm setting this up for the standard notes application. If you follow this guide for another application make sure to change the name.

Steps to achieve desired outcome:

  • Using a text editor, in my case vim, create a .desktop file in "/usr/share/applications/".
sudo vim /usr/share/applications/standard-notes.desktop
  • I've prefixed the .desktop file name with "standard-notes" as that's the application name.

  • Add the following text to the file making sure to change paths and names to suit your set-up.

    #!/usr/bin/env xdg-open
    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Exec=/home/**USER_NAME**/Programs/standard-notes-3.5.14-linux-x86_64.AppImage
    Name=Standard Notes
    Comment=Standard Notes
    Icon=/home/**USER_NAME**/Programs/standard-notes-icon.png
    
  • Make the file executable:

    sudo chmod +x /usr/share/applications/standard-notes.desktop
    
  • Logout and back in.

  • After logging in search for your application in the "dash menu".

    • You can do this by pressing the "super-key" and typing in the application name.
  • Launch the application. This will make the icon visible on the dock.

  • Right click the icon and choose "Add to favourites".

#appimage #standardnotes #ubuntu

Calibre error on Ubuntu 20.04 - fix.

Here is the source blog post. I have copied the text below almost word for word and added some formatting for my own viewing. All credit to the original blog post author.

  • open a terminal and issue the following

    calibre
    
  • If we get the error below we need to edit a file – "server.py" to fix that.

    AttributeError: 'NoneType' object has no attribute 'cancel'
    
  • Head to the directory, using cd command-line utility, where our server.py is stored.

    cd /usr/lib/calibre/calibre/utils/ipc/
    
  • open the file server.py using a text-editor.

    sudo vim server.py
    
  • We need to the edit the code from Line 110. So, it goes like this

    #self._listener._unlink.cancel()
    if self._listener._unlink is not None:
    self._listener._unlink.cancel()
    
  • We have put a hash before the original code and subsequently appended the file with an "if" statement.

  • Try running calibre again in terminal. It should now launch the application.

  • In certain circumstances it may still throw an indentation error.

    if self._listener._unlink is not None:
                                     ^
    TabError: inconsistent use of tabs and spaces in indentation
    
  • If so, use proper tabs and spaces at the beginning of the "self.listener.unlink.cancel()" code. It should resolve the issue.

#calibre #fix #ubuntu

VMware Workstation - Hardware graphics acceleration is not available - Fix.

Error message when booting VM:

Hardware graphics acceleration is not available

As a result, this virtual machine may experience very low graphics performance. >Follow the instructions provided by your graphics card vendor or Linux distribution in >order to update your computer's OpenGL drivers.

Checks

  • Check that you have OpenGL acceleration on your host.
glxinfo | grep direct
  • expected output :
Direct rendering: yes

Fix:

  • Edit the file ~/.vmware/preferences and look for a line that starts with "mks.gl.allowBlacklistedDrivers", if it is not present - you can add it into the file.
mks.gl.allowBlacklistedDrivers = "TRUE" 

Info taken from this AskUbuntu thread.

Internet archive address here.

#linux #VMware

Linux - Mounting a NAS cifs share.

Written below are the manual steps followed by a bash script that can be used to automate the task.

Manual steps.

  1. Install CIFS package

Run:

sudo apt-get install cifs-utils
  1. Create a directory where you will mount the NAS share. Create one for each share you will mount.
    For example

    sudo mkdir /mnt/FOLDER_NAME
    
  2. Create a hidden file in /home/LOCAL_USER. The file name will be used in /etc/fstab later.

  • In a terminal session run the following command (don't forget the "." before the file name):

    vim .FILE_NAME 
    
  • Add the detail of the user account that will access the share. The credentials file format should look like the example below

  • Save the file and quit out of VIM.

    username=USER_NAME
    password=PASSWORD
    
  1. Edit /etc/fstab using an editor, like VIM.
  • From a terminal session run: sudo vim /etc/fstab/
  • Add the following lines to the bottom of your fstab file. make sure to edit your specific details.
  • after updating the fstab file, save and quit VIM. //192.168.0.100/share01 /mnt/share01 cifs credentials=/home/LOCAL_USER/.creds,gid=1000,uid=1000,vers=2.0 //192.168.0.100/share02 /mnt/share02 cifs credentials=/home/LOCAL_USER/.creds,gid=1000,uid=1000,vers=2.0
  • After updating /etc/fstab run the command below from a terminal session to mount the shares
sudo mount -a

Bash script.

Follow these step to create the script file and enable its execution.

Copy the text below in to a file using any text editor. Add your specific details, such as user name and folder names. Save the file with any name, but make sure the file extension is .sh.

#!/bin/sh
# Mount NAS cif shares
# Created: 
# Tested: Ubuntu 20.04

# Install CIFS package
apt-get install cifs-utils

# Creates mount points. The directory names after '/mnt/' can be of your choosing
mkdir /mnt/share01
mkdir /mnt/share02

# Create hidden file in /home/**<user_name>**. The file name will be used in the lines added to /etc/fstab later.
echo 'username=USERNAME_TO_ACCESS_SHARE\npassword=PASSWORD_FOR_USER' >/home/LOCAL_USER/.creds

# Add share locations to /etc/fstab
echo '//192.168.0.100/share01 /mnt/share01 cifs credentials=/home/LOCAL_USER/.creds,gid=1000,uid=1000,vers=2.0\n//192.168.0.100/share02 /mnt/share02 cifs credentials=/home/LOCAL_USER/.creds,gid=1000,uid=1000,vers=2.0' >>/etc/fstab

# mount shares
mount -a

To run the script you must first change the mode to allow you to execute the script file. To do this you must run the following command in a terminal session

chmod +x YOUR_FILE_NAME.sh

Now you can execute the script. From within the directory where your file is located run the following

sudo ./YOUR_SCRIPT_NAME.sh

#linux #shares #ubuntu

Scanner notes

Model: MFC-L2710DW series - IPP Everywhere

Brother website for driver download

How to Install...

Requirements:

  • The following ports are required to be open.
  • Inbound direction : UDP Port 54925
  • Outbound direction : TCP Port 54921

Install the driver:

  1. Turn on your MFC/DCP and connect the USB cable.
  2. Open the terminal and go to the directory where the driver is.
  3. Install the scanner driver - sudo dpkg -i --force-all (scanner-drivername)
  4. Check if the driver is installed - sudo dpkg -l | grep Brother

Adding Scanner to computer

  1. Add network scanner entry -

    sudo brsaneconfig4 -a name=(name your device) model=(model name) ip=xx.xx.xx.xx
    

    Example:

    sudo brsaneconfig4 -a name=brother_scranner model=L2710DW ip=192.168.0.111
    
  2. Confirm network scanner entry:

    sudo brsaneconfig4 -q | grep (name of your device)
    
  3. Install scanner application

Scanner application that worked well:
Name: XSane
Version: 0.999-8ubuntu2
Source: ubuntu-focal-universe
Note: This was available in the Ubuntu software centre.

#linux #scanner #ubuntu

Exposing tiny links

Here are some methods of exposing tiny links. I took these from a blog post that's included at the bottom of this page. I've also included an internet archive link in case the blog-post disappears.

curl cmd to expose full link.

curl -sLI https://short/url | grep -i Location

Website options.

Sources:

#internet

Librem 13v4 keyboard issue

Link to PureOS bug tracker

A stable workaround is to add file /etc/udev/hwdb.d/70-keyboard.hwdb

Note: The space before "KEYBOARDKEY56=102nd" is required. If you receive the output "/etc/udev/hwdb.d/70-keyboard.hwdb:3: Property expected, ignoring record with no properties" after running "sudo systemd-hwdb update", you have likley missed the space before "KEYBOARDKEY56=102nd".

# Purism Librem 13 V2/V3/V4
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnPurism*:pn*Librem13v[2-4]*:pvr*
 KEYBOARD_KEY_56=102nd

and running:

sudo systemd-hwdb update
sudo udevadm trigger

#keyboard #librem