Random Tips And Tricks (Part 2)

Configure Extra Mouse Buttons Under Linux

This solution is tested on Linux Mint (Sarah) and Xubuntu 16.04.
So I have a Logitech M505 mouse and I love using the vertical scroll button to minimize and maximize the active window. I have never used these buttons according to its original function, they were always configured to minimize and maximize Window.

What you need to install?
  • xbindkeys
  • xvkbd
  • xdotool
  • wmctrl

Install them with one command: sudo apt install xbindkeys xvkbd xdotool wmctrl

1. Create sample configuration file

xbindkeys -d > ~/.xbindkeysrc
This will create a sample configuration file in your home directory.

Please remove the "Examples of commands:" section from this file to avoid furtherer conflicts.

  control+shift + q
2. Determine the ID of the buttons you want to use

It is very simple. Just run xev command.

For example my left button code (button 1):

ButtonPress event, serial 37, synthetic NO, window 0x4800001,  
    root 0xc5, subw 0x0, time 7138218, (103,85), root:(965,1564),
    state 0x10, button 1, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x4800001,  
    root 0xc5, subw 0x0, time 7138264, (103,85), root:(965,1564),
    state 0x110, button 1, same_screen YES

Example with grep to easier determine button ID:
xev | egrep -o 'button [0-9]{1,2}'

3. Configure .xbindkeysrc

So in my case I want to configure only two buttons:

  • Left Scrolling for minimize window
  • Right Scrolling for maximize window

I had to add only these two section to .xbindkeysrc:

  • Minimize (Button 11)
"xdotool getactivewindow windowminimize"
  • Maximize (button 12)
"wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz"

As you can see we had to use two different command: xdotool and wmctrl.

If you want to use your buttons for any other activity I'm pretty sure that after some googleing you will find your solution.

Case Insensitive Search In Oracle DB

alter session set NLS_COMP=ANSI;  
alter session set NLS_SORT=BINARY_CI;  


Change Date & Timestamp Format In Oracle DB

alter session set NLS_DATE_FORMAT='yyyy-mm-dd HH24:mi:ss';  

Redirect all output (stderr, stdout) to a file


LOG="[LOG file location]"  
exec >> $LOG 2>&1  

Redirect nohup output

You can redirect stdout and stderr to differrent files or into the same file.


  1. nohup ./program >stdout.log 2>stderr.log
  2. nohup ./progrem >stoutAndStderr.log 2>&1
  3. abbreviated syntax
    nohup command > output-$(date +%Y%m%d_%H%M%S).log &

Example startup script for OpenHAB:

cat start-daemon.sh


echo Launching the openHAB runtime...  
nohup java \  
    -Dosgi.clean=true \
    -Declipse.ignoreApp=true \
    -Dosgi.noShutdown=true  \
    -Djetty.port=$HTTP_PORT  \
    -Djetty.port.ssl=$HTTPS_PORT \
    -Djetty.home=.  \
    -Dlogback.configurationFile=configurations/logback.xml \
    -Dfelix.fileinstall.dir=addons -Dfelix.fileinstall.filter=.*\\.jar \
    -Djava.library.path=lib \
    -Djava.security.auth.login.config=/opt/openhab/runtime/distribution-1.8.3-runtime/etc/login.conf \
    -Dorg.quartz.properties=./etc/quartz.properties \
    -Dequinox.ds.block_timeout=240000 \
    -Dequinox.scr.waitTimeOnBlock=60000 \
    -Dfelix.fileinstall.active.level=4 \
    -Djava.awt.headless=true \
    -jar $cp $* \
    -console 9898 >nohup-$(date +%Y%m%d_%H%M%S).out &

Move root file system to USB storage (RPI2 & RPI3)

Link: Move root file system to USB storage (RPI2 & RPI3)

Vincze Janos Istvan

Read more posts by this author.


Subscribe to Blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!