Showing posts with label mint. Show all posts
Showing posts with label mint. Show all posts

Saturday, September 12, 2020

Binding Mouse Buttons on Linux Mint Tricia

 Following describes how was the mouse buttons response and configured for

Tinytech GM-924 on Linux Mint 19.3 Tricia.


Initial response

A. Firefox web browser

Within the Firefox web browser, the left and right mouse buttons functioned as normal. The center scroll button caused the audio volume to increase or decrease. When scroll button was clicked, an X appeared.

At the left side were 2 buttons. Both only showed an X when clicked.

Hold down Left+Right button, the auto scroll appears. If this doesn't appear in Firefox web browser, you can set it up in Firefox menu.

Menu ->Preferences. Search for scroll.

Enable "Auto Scrolling", restart Firefox web browser.

Sometimes, there isn't any response to the mouse after I touched the USB connection. I have not found any reason for this. However, you can enable the mouse again by pressing the button above the scroll button.

B. Command prompt window

On the command line terminal window.

Left click on a text line, will highlight a word.

Left double click on a text line, will highlight the whole sentence.

Left+Right button click will paste the last highlight text. 

Right button will open the options windows.

Scroll button works the same as Left+Right button click.

Scroll front and back scrolls up and down the screen window.


How does Linux mint detect these buttons? 

Open command line terminal and run a simple test by clicking each of the button. 

 xev -event button

Here are the results I got;

  • Left button - Button 1, state 0x100
  • Right button - Button 3, state 0x400
  • Left+Right button - Button 2, state 0x200
  • Scroll button - Button 2, state 0x200
  • Scroll button push forwxbindkeys - Associate a combination of keys or mouse buttons with a shell commandard - Button 5, state 0x1000
  • Scroll button pull backwards - Button 4, state 0x800
  • Side forward button - Button 9, state 0x0
  • Side back button - Button 8, state 0x0

How to program the side forward and back buttons?

Install the package xbindkeys and xvkbd, from the description it says;

xbindkeys - xbindkeys is a program that allows you to launch shell commands with
 your keyboard or your mouse under the X Window System.
It links commands to keys or mouse buttons, using a configuration file.
It's independent of the window manager and can capture all keyboard keys

xvkbd - xvkbd is a virtual (graphical) keyboard program for X Window System
 which provides facility to enter characters onto other clients
 (software) by clicking on a keyboard displayed on the screen.  This
 may be used for systems without a hardware keyboard such as kiosk
 terminals or handheld devices.  This program also has facility to
 send characters specified as the command line option to another
 client.

I refer to syntax at http://xahlee.info/linux/linux_xvkbd_tutorial.html

The configuration here is per user. It means, the file must be configured for each user in the system.

  1. Edit the file ~/.xbindkeys 
  2. Restart xbindkeys service

pkill -f xbindkeys

xbindkeys

Here are 2 example of the file ~/.xbindkeys

Example 1: Launch xed and nemo

In order launch nemo file manager, with the side front button AND to lauch xed text editor with the side back button.

# bind side left forward button
"xed"
  m:0x0 + b:8
"nemo"
  m:0x0 + b:9

 

Example 2: Supertuxkart 

Use the numpad 4 is view from left and numpad 6 is view from right. This is for laptops that doesn't have the side full numeric keypad that is normally found on desktop keyboards.

Lets program the side front for numpad 4, side back button for numpad 6.

"xvkbd -text '\[KP_4]' "
  m:0x0 + b:8
"xvkbd -text '\[KP_6]' "
  m:0x0 + b:9


Sunday, June 14, 2020

Install Postgresql 12 on Linux Mint

Overview

Linux mint is a Linux distro based on a popular debian based Linux known as Ubuntu. One reason this Linux is popular, is that it fits on many older computers with lower end hardware specifications, and have support for a wide array of monitors. At the same time, this Linux supports many of the modern hardware drivers.

The current Linux Mint is version 19.3 with the code name "Tricia", is released on 18th December 2019. This is developed from Ubuntu version named Bionic. Among the features that one should know about Tricia includes:

  • It is a long term support (LTS) which means, patches will be maintained till 2023.
  • Installation of Linux Mint have better hardware detection and supports modern BIOS installation to utilise password at BIOS.
  • Include a movie player that utilises hardware optimisation.
  • Its Linux desktop environment called Cinnamon, is light weight enough for many lower spec computer. Computers with lower speed hard disk have always suffered in a windows environment, Cinnamon greatly improves any windows experience.
  • Higher level of security for those who are paranoid about PC security.

Postgresql 12

Among the world's most popular open sourced relational database management system (RDBMS) is Postgresql. Default installation will also create a database called postgres and a user with the same name, postgres. Installation comes with a separate application for the server, and a client. A tool, psql is to manage the server from the command line. There are many other applications that can manage Postgresql with a graphical point and click approach.

Version 12 is released on 3rd October 2019 with the following features:
  • Improved table indexing features. Such as rebuild index table without blocking writes to an index, and this reduces down time.
  • Partitioning of tables to improved queries from a limited set of data.
  • JSON document query support.
  • Just-in-time compilation to process large data (data warehouse) more efficiently.

Installation

Linux Mint 19.x by default installs Postgresql version 10. In order to install version 12, Linux Mint must have the latest packages installed to reduce chances of package dependency errors. These are summary of steps in order to install Postgresql version 12.

  1. Add Postgresql repository
  2. Update existing system
  3. Install Postgresql 12 server. This includes the server (postgresql-12) and client (postgresql-client-12) application.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main" > /etc/apt/sources.list.d/postgresql.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt upgrade

sudo apt install postgresql-12


Once installed, it will prompt

pg_ctlcluster 12 main start

Following are among the files and locations at default install.

  • The database will be stored at /var/lib/postgresql/12/main
  • Logging information at /var/log/postgresql/postgresql-12-main.log
Documentation can be display with the command;

man postgresql

Accessing the server

Default installation includes the user postgres. Access the server using this user.

sudo -u postgres psql

Here are a list of psql commands to get you started.

Once in psql, here are several commands to browse the database;

Display server version (the Uppercase is a matter of good practice)
SELECT version();

List database schema
\l

Switch database schema
\c database_name

Describe a table
\d table_name

Get the last command
\g

Show history of commands
\s

Help with a command
\h command_name

Exit Postgresql client
\q

You can refer to previous posting "Create database and user" to further try the database.

* Install PHP 7.4 notes (not related to postgresql)
sudo apt-get install -y php7.4-{bcmath,bz2,intl,gd,mbstring,pgsql,zip}
sudo apt-get install -y php7.4-{curl,common,xml,xsl}

Thursday, July 12, 2018

Chinese Input on Linux Mint

Linux is flexible enough to support users from around the world with various types of input method.

On Linux Mint there are 2 approach or framework for input methods. They are Fcitx and Ibus. These enable users to switch between typing Latin (e.g. a b c) and others like Chinese Pin Yin (e.g. 平 阔). To get a details on these frameworks there is a 2012 article "GNOME and input method integration". Language models are developed on top of any of these frameworks, depending on the target user devices.

Do you need to have both input method frameworks? The short answer is No. Only one is needed for the operating system being used. On Linux where users can change their Desktop Managers, then all the preferred input method framework should be installed.

Sunpinyin is a popular utility for chinese input on Linux that is available on Fcitx and Ibus.It is open source licensed with LGPLv2 and CDDL dual-licenses.

I choose the approach of Ibus since doing a apt-cache search yielded the following;

ibus-sunpinyin - sunpinyin engine for ibus
libsunpinyin-dev - Simplified Chinese Input Method from SUN (development)
libsunpinyin3-dbg - Simplified Chinese Input Method from SUN (debug)
libsunpinyin3v5 - Simplified Chinese Input Method from SUN (runtime)
sunpinyin-data - Statistical language model data from open-gram
fcitx-sunpinyin - fcitx wrapper for Sunpinyin IM engine
python-sunpinyin - Simplified Chinese Input Method from SUN (Python binding)
sunpinyin-utils - Simplified Chinese Input Method from SUN (utilities)
ucimf-sunpinyin - ucimf wrapper for Sunpinyin IM engine
xsunpinyin - Standalone XIM server for Sunpinyin

Ibus was first on the list.

I might have missed some steps as I did this over several weeks. There wasn't any rush and there were other chores that needed to get done.

Here are the steps taken.

Step 1: Install Sunpinyin

Open a command line terminal and type

sudo apt-get install ibus-sunpinyin sunpinyin-utils

Step 2: Install the language

At Menubar click Applications ->Settings ->Input Method

Choose Language tab then click Install/Remove Languages...
Click Add.
Choose Chines, China (UTF8), then click Install.

Back to the Language Settings window, click "Input method" tab. In Input method, choose "IBus".

In Language support, Simplified Chinese click the Install button. Follow the instructions.



Step 3: Load it.

Logout and log back in.

At the Menubar, appears the Input Method applet with the text "EN".


Click on "EN" and select "Simplified Chinese".

Open a text editor or web browser and try out typing in Chinese.

Done.

Note: If this disrupts special keys on the keyboard, try to setup and use fcitx, instead. You can only use either one at a time.

Friday, April 13, 2018

Howto Install Evernote on Linux Mint


One of the tools to capture my notes on a PC and Android mobile device is Evernote. Searching online today, it is clear that Evernote is not available on Linux (Mint), however it has been implied that their API is sufficient for anyone to develop a version of Evernote (Evernote on Linux). This means no Evernote application on Linux. Good news for the Linux community as the API documentations are available at https://dev.evernote.com/

Nixnote by baumgarr provides you access to Evernote on Linux Mint along with a user manual in PDF. Download the version suitable for you at https://sourceforge.net/projects/nevernote/files

Nixnote2 on Linux Mint


My set up (inxi -S)
Kernel: 4.10.0-38-generic x86_64 (64 bit)
Distro: Linux Mint 18.3 Sylvia
Desktop: Cinnamon 3.6.7



Step 1: Download nixnote

Locate the file online from Sourceforge and download. The file I downloaded to my Download folder is

nixnote2-2.0.2_amd64.deb

Step 2: Install from command prompt


$ cd ~/Download
$ sudo apt install ./nixnote2-2.0.2_amd64.deb
$ apt install libcurl3 libcurl3-nss

This installed the dependency packages libcurl3, libpoppler-qt5-1 and tidy.

Troubleshoot: Error

QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
ERROR 2018-04-13 00:50:37.788 ( sql/databaseconnection.cpp @ 44 ) Error opening database:  QSqlError(-1, "Driver not loaded", "Driver not loaded")


Solution: At CLI type

$ apt install lua5.2-sql-sqlite3
$ apt install libqt4-sql-sqlite

Step 3: Run Nixnote

At the Desktop Menu ->Internet ->Nixnote2

Troubleshoot: Nothing appears after click Nixnote2.

At CLI the error shows:

nixnote2: error while loading shared libraries: libpoppler-qt4.so.4: cannot open shared object file: No such file or directory

Solution: Open CLI and type


$ apt install libpoppler-qt4-4
$ nixnote2

Usage

Once its started, Click in the menu File ->Add another user. Key in your new user name.
Click File ->User Account Maintenance. Choose the new user.
Click Tools ->Synchronised

Wait for it to download from Evernote.

Blog Archive