Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (2) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (31) javascript (3) Linux (167) Mac (19) Machine Learning (1) mySQL (48) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (47) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

Tuesday, 25 June 2019

Linux mouse gpm

The following gets the mouse working in the console;

gpm -m /dev/input/mice -t imps2

https://www.linuxquestions.org/questions/slackware-14/setting-up-a-usb-mouse-in-slackware-401496/

put the following in rc.gpm and make bootable - chmod +x /etc/rc.d/rc.gpm

#!/bin/sh
# Start/stop the GPM mouse server:

if [ "$1" = "stop" ]; then
echo "Stopping gpm..."
gpm -k
else # assume $1 = start:
echo "Starting gpm..."
gpm -m /dev/mouse -t imps2
fi


Finally do ln -si /dev/input/mice /dev/mouse to create link
For usb /dev/mouse points to /dev/input/mice
For PS/2 /dev/mouse points to /dev/psaux


Optionally add/comment the following lines in /etc/X11/XF86Config for usb

#Option "Protocol"    "PS/2"
#Option "Device"      "/dev/psaux"
Option "Protocol" "imps/2"
Option "Device" "/dev/mouse"


Slightly related note: for keyboard, the following should be present:
#Option "XkbLayout"  "us"
Option "XkbLayout"  "uk"

Tuesday, 18 June 2019

backup and restore mysql

Backup;
mysqldump -u [username] -p [databaseName] > [filename]-$(date +%F).sql
 
Restore; 
mysql -u [username] -p [databaseName] < [filename].sql

See here for more details...