thorko.deLinux / Unix systems administrator

Latest SysadminDB entries


Scan your documents and archiv as a searchable PDF

Install packages

~$ apt-get install sane sane-utils ghostscript netpbm pdftk pdfocr tesseract-ocr-deu tesseract-ocr

Now make sure your scanner got detected

~$ scanimage -L
device `genesys:libusb:001:049' is a Canon LiDE 220 flatbed scanner

Scan your document and create a PDF

~$ scanimage --format pnm --resolution 1200 > /tmp/test.pnm
~$ pnmtops /tmp/test.pnm > /tmp/test.ps
~$ ps2pdf /tmp/test.ps /tmp/test.pdf

Once you created the PDF you can run OCR on it

~$ pdfocr -i /tmp/test.pdf -o /tmp/scan.pdf -L -t -l deu



RPM sign packages without passphrase

To sign a package without a passphrase do

~$ expect -c 'set timeout 3600; spawn rpmbuild -bb --sign /tmp/package.spec; expect -exact "Enter pass phrase: " { 
send -- "\r" }; expect eof'



GlusterFS - unable to set quota

Version: >3.7.9

~$ gluster volume quota test list
quota command failed : Failed to start aux mount

check if performance.cache-size is greater than 1.9GB

~$ gluster volume info
Volume Name: test
Type: Replicate
Volume ID: 396d6c35-fc80-49e1-8619-66fa747e0fab
Status: Started
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: tt1.thorko.de:/data/glusterd/data/web_new
Brick2: tt2.thorko.de:/data/glusterd/data/web_new
Brick3: tt3.thorko.de:/data/glusterd/data/web_new
Options Reconfigured:
features.quota-deem-statfs: on
performance.cache-max-file-size: 10MB
network.ping-timeout: 2
performance.cache-refresh-timeout: 10
performance.write-behind-window-size: 4MB
performance.read-ahead: off
performance.cache-size: 2048MB
features.quota: on
features.inode-quota: on

set it to 1024MB

~$ gluster volume set test performance.cache-size 1024MB

Now set the quota limit

~$ gluster volume quota test limit-usage / 10GB



Set default applications in linux

xdg-settings set default-web-browser chromium.desktop
sudo update-alternatives --config x-www-browser
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/google-chrome-stable 200 auto mode
* 1 /usr/bin/chromium 40 manual mode
2 /usr/bin/firefox-esr 70 manual mode
3 /usr/bin/google-chrome-stable 200 manual mode
4 /usr/bin/iceweasel 70 manual mode
5 /usr/bin/konqueror 30 manual mode
6 /usr/bin/qupzilla 80 manual mode
vim ~/.local/share/applications/mimeapps.list
vim .config/mimeapps.list
x-scheme-handler/http=chromium.desktop
x-scheme-handler/https=chromium.desktop
x-scheme-handler/ftp=chromium.desktop
x-scheme-handler/chrome=chromium.desktop



Enable touchpad tapping

List devices

~$ xinput
? Virtual core pointer id=2 [master pointer (3)]
? ? Virtual core XTEST pointer id=4 [slave pointer (2)]
? ? Atmel Atmel maXTouch Digitizer id=10 [slave pointer (2)]
? ? Logitech Performance MX id=11 [slave pointer (2)]
? ? ETPS/2 Elantech Touchpad id=16 [slave pointer (2)]
? Virtual core keyboard id=3 [master keyboard (2)]
? Virtual core XTEST keyboard id=5 [slave keyboard (3)]
? Power Button id=6 [slave keyboard (3)]
? Video Bus id=7 [slave keyboard (3)]
? Video Bus id=8 [slave keyboard (3)]
? Power Button id=9 [slave keyboard (3)]
? Yubico Yubikey 4 OTP+U2F id=12 [slave keyboard (3)]
? Lenovo EasyCamera id=13 [slave keyboard (3)]
? Ideapad extra buttons id=14 [slave keyboard (3)]
? AT Translated Set 2 keyboard id=15 [slave keyboard (3)]

List properties

~$ xinput list-props "ETPS/2 Elantech Touchpad"
Device 'ETPS/2 Elantech Touchpad':
Device Enabled (139): 1
Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Tapping Enabled (299): 1
libinput Tapping Enabled Default (300): 0
libinput Tapping Drag Enabled (301): 0
libinput Tapping Drag Enabled Default (302): 1
libinput Tapping Drag Lock Enabled (303): 0
libinput Tapping Drag Lock Enabled Default (304): 0
libinput Accel Speed (282): 0.000000
libinput Accel Speed Default (283): 0.000000
libinput Natural Scrolling Enabled (287): 0
libinput Natural Scrolling Enabled Default (288): 0
libinput Send Events Modes Available (262): 1, 1
libinput Send Events Mode Enabled (263): 0, 0
libinput Send Events Mode Enabled Default (264): 0, 0
libinput Left Handed Enabled (289): 0
libinput Left Handed Enabled Default (290): 0
libinput Scroll Methods Available (291): 1, 1, 0
libinput Scroll Method Enabled (292): 1, 0, 0
libinput Scroll Method Enabled Default (293): 1, 0, 0
libinput Click Methods Available (305): 1, 1
libinput Click Method Enabled (306): 1, 0
libinput Click Method Enabled Default (307): 1, 0
libinput Disable While Typing Enabled (308): 1
libinput Disable While Typing Enabled Default (309): 1
Device Node (265): "/dev/input/event1"
Device Product ID (266): 2, 14
libinput Drag Lock Buttons (298): <no items>
libinput Horizonal Scroll Enabled (267): 1

Set tapping on 

~$ xinput set-prop "ETPS/2 Elantech Touchpad" "libinput Tapping Enabled" "1"



(c) 2014 by thorko.de