Category Archives: How To

How to disable the Forward/Back buttons on mouse

Source: https://unix.stackexchange.com/ by Gilles

Start the program xev in a terminal. Move the mouse inside the xev window; you’ll see a lot of stuff scroll by. Press each button in turn. Then switch back to the terminal window and press Ctrl+Cxev shows a description of each input event, in particular ButtonPress and ButtonReleasefor mouse clicks (you’ll also see a number of MotionNotify for mouse movements and other events).

It’s likely that your forward and back buttons are mapped to mouse buttons, maybe buttons 8 and 9:

ButtonPress event, serial 29, synthetic NO, window 0x2e00001,
    root 0x105, subw 0x0, time 2889100159, (166,67), root:(1769,98),
    state 0x0, button 8, same_screen YES

If that’s the case, remap these buttons to a different action in your browser; or to disable the buttons altogether, put these lines in a file called ~/.Xmodmap:

! Disable buttons 8 and 9
pointer = 1 2 3 4 5 6 7 0 0

Test it with the command xmodmap ~/.Xmodmap. Most desktop environments and window managers run this command automatically when you log in; if yours doesn’t, arrange for it to run when X starts.

It’s also possible that your mouse sends a keyboard event when you press these buttons:

KeyPress event, serial 32, synthetic NO, window 0x2e00001,
    root 0x105, subw 0x0, time 2889100963, (957,357), root:(2560,388),
    state 0x0, keycode 166 (keysym 0x1008ff26, XF86Back), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

In that case, put lines like these in ~/.Xmodmap:

keycode 166 = NoSymbol
keycode 167 = NoSymbol

Helpful link: Reprogram mouse buttons

Advertisements

How to Install the MySQL ODBC Driver on Ubuntu 16.04 or Linux Mint 18.x

Source: https://www.datasunrise.com/blog/

# Download the ODBC driver:

Download ODBC driver for Ubuntu 16.04

wget https://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-64bit.tar.gz

# Extract:

tar -xvf mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-64bit.tar.gz

# Copy the driver to the ODBC folder:

sudo cp mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-64bit/lib/libmyodbc5* /usr/lib/x86_64-linux-gnu/odbc/

# Install:

sudo mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-64bit/bin/myodbc-installer -d -a -n "MySQL" -t "DRIVER=/usr/lib/x86_64-linux-gnu/odbc/libmyodbc5w.so;"

# Check:

sudo mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-64bit/bin/myodbc-installer -s -a -c2 -n "test" -t "DRIVER=MySQL;SERVER=127.0.0.1;DATABASE=mysql;UID=root;PWD=password"

[Result should be “Success”]

# Download the 32-bit ODBC driver:

Download 32-bit ODBC driver for Ubuntu 16.04

wget https://dev.mysql.com/get/Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-32bit.tar.gz

# Extract:

tar -xvf mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-32bit.tar.gz

# Copy the driver to the ODBC folder:

sudo cp mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-32bit/lib/libmyodbc5* /usr/lib/i386-linux-gnu/odbc/

# Install:

sudo mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-32bit/bin/myodbc-installer -d -a -n "MySQL" -t "DRIVER=/usr/lib/i386-linux-gnu/odbc/libmyodbc5w.so;"

# Check:

sudo mysql-connector-odbc-5.3.10-linux-ubuntu16.04-x86-32bit/bin/myodbc-installer -s -a -c2 -n "test" -t "DRIVER=MySQL;SERVER=127.0.0.1;DATABASE=mysql;UID=root;PWD=password"

[Result should be “Success”]

GRUB shows Windows 7 instead of Windows 10

source: link

author: david6

After installing Windows 10, every time I get a kernel update or I run the update-grub2 it always shows Windows 7 instead of Windows 10. How do I fix this permanently?

The reason why it still shows Windows 7 instead of Windows 10 is that the file /usr/lib/os-probes/mounted/20microsoft does not contain the label for Windows 10, so during the os-prober detection of the OS it falls back to Windows 7.

To correct this, you need to make the following changes to the /usr/lib/os-probes/mounted/20microsoft file:

NOTE: Always make a backup of the file before modifying it!

if item_in_dir -q bootmgr "$2"; then
        # there might be different boot directories in different case as:
        # boot Boot BOOT
        for boot in $(item_in_dir boot "$2"); do
                bcd=$(item_in_dir bcd "$2/$boot")
                if [ -n "$bcd" ]; then
                        if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then
                                long="Windows 10 (loader)"
                        elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
                                long="Windows 8 (loader)"
                        elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
                                long="Windows 7 (loader)"

the changes above are changing the line if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then to elif grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then, and adding if grep -qs "W.i.n.d.o.w.s. .1.0" "$2/$boot/$bcd"; then and long="Windows 10 (loader)" above that line and saving it.

Once saved, then running os-prober now looks like this:

terrance@terrance-ubuntu:~$ sudo os-prober
[sudo] password for terrance: 
/dev/sdf1:Windows 10 (loader):Windows:chain

then running update-grub2 it will now make the updates to your /boot/grub/grub.cfgpermanent anytime you get a kernel update so it will show the correct version of Windows now (example below):

terrance@terrance-ubuntu:~$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.19.0-26-generic
Found initrd image: /boot/initrd.img-3.19.0-26-generic
Found linux image: /boot/vmlinuz-3.13.0-58-generic
Found initrd image: /boot/initrd.img-3.13.0-58-generic
Found linux image: /boot/vmlinuz-3.13.0-57-generic
Found initrd image: /boot/initrd.img-3.13.0-57-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 (loader) on /dev/sdf1
done

Hope this helps!