thorko.deLinux / Unix systems administrator

Latest SysadminDB entries


GPG cheatsheet

Sign and encrypt file with specific key

gpg -e -r <recipient> -u <id of signing key> --sign -o <output file> <file>
gpg -e -r info@thorko.de -u 4A9C0FC09269797E706BB5A6D53E9087CA40E908 --sign -o test.gpg test

Export public key

gpg --armor --output <YOUR-KEY>.asc --export <YOUR-KEY-ID>
gpg --armor --output test.asc --export 4A9C0FC09269797E706BB5A6D53E9087CA40E908

Export secret key

gpg --armor --output <YOUR-SECRET>.asc --export-secret-keys <YOUR-KEY-ID>
gpg --armor --output test-sec.asc --export-secret-keys 4A9C0FC09269797E706BB5A6D53E9087CA40E908



Set special character on keys

First you need to figure out which keycode the key uses when you press it. To do so you start xev and type the key

KeyPress event, serial 40, synthetic NO, window 0x5c00001,
root 0xe7, subw 0x0, time 42471470, (1095,-519), root:(1095,250),
state 0x10, keycode 49 (keysym 0x5e, asciicircum), same_screen YES,
XLookupString gives 1 bytes: (5e) "^"
XmbLookupString gives 1 bytes: (5e) "^"
XFilterEvent returns: False

now create a file calles ~/.Xmodmap

keycode 49 = asciicircum



Owncloud - server replied: Locked

When getting the error message "the file is locked" you need to do the following steps to resolve this issue

~$ occ maintenance:mode --on
mysql> DELETE FROM oc_file_locks WHERE 1;
~$ occ maintenance:mode --off



Git usage

set global settings for git

git config --global user.name "Mark Wallberg"
git config --global user.email "mark@wallberg.de"

use password file

# create a .netrc file in your home
machine git.github.org
login mark
password lm@te

checkout a single file (sparse-checkout)

git clone -n https://git.github.org/script && cd script
git config core.sparsecheckout true
echo trunk/file > .git/info/sparse-checkout
git read-tree -m -u HEAD

Initialize Git repository for apache

git --bare init
git update-server-info



KDE 5 Plasma - disable "New Session" on lock screen

Add these lines to ~/.config/kdeglobals

[KDE Action Restrictions][$i]
action/start_new_session=false



(c) 2014 by thorko.de