Skip to content

Connect with Android Keepass to Hetzner’s Storage Box

Connect with Android Keepass to Hetzner’s Storage Box published on

The goal is to connect Keepass2Android (used version 1.07b-r0) on Android to the Keepass database on a Hetzner Storage Box. In https://blog.chloesoe.ch/?p=546 it is described, how to connect and store your Keepass DB to the Storage Box.

Now we want to connect the mobile phone to that database.

  1. In Keepass Android choose "Open File" and then "SFTP (SSH File Transfer)"
  2. There you have to enter the connection details:
    1. Host: $USERNAME.your-storagebox.de
    2. Port: 23
    3. Username: Your user name ;-)
      4: Authentication mode: Privat/Public Key

      1. choose "Send public key". You could send it via e-mail; the public key is not sensitive. Make sure you send it somwhere, where you can access it like in https://blog.chloesoe.ch/?p=546 described.
      2. Save the public key to a file pubkey_android (you could change the key name at the end of the line of thet new file if you like).
      3. If you safed it like that, then you could run this:
        read -p "Enter your Hetzner's username: " USERNAME
        rsync --progress -e 'ssh -p23'  $USERNAME@$USERNAME.your-storagebox.de:.ssh/authorized_keys .
        cat pubkey_android >> authorized_keys
        rsync --progress -e 'ssh -p23'  authorized_keys $USERNAME@$USERNAME.your-storagebox.de:.ssh/
    4. Initial directory: /home
  3. Now you can connect and choose your Keepass database file.

Force HTTPS in Tomcat

Force HTTPS in Tomcat published on

To force every webapp to use https instead of http, add the following part in $TOMCATHOME/conf/web. Insert it at the second last line, before end tag </web-apps>

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Entire Application</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

Sign a PDF on Linux with SuisseID

Sign a PDF on Linux with SuisseID published on

Assumed, your SuisseID Smartcard already is working on your Linux workstation.

  1. Download LocalSigner from Open eGov Plattform of Confoederatio Helvetica
  2. Untar it to ~/opt or wherever you want
    tar xvzf localsigner_4.1.3_linux.tar.gz --directory=~/opt
  3. Make sure you use Java 8 (Oracle or OpenJDK). I had some issues with openJDK 10
  4. run localsigner
    ~/opt/LocalSigner/local-signer.sh
  5. If the PDF is not PDF/A, then a "convert" button is shown, hit it
  6. the rest is self-explanatory, select a source and a destination, then click on "sign" on the bottom-right
  7. to check the signature, there is a command line tool. Run:
    pdfsig ~/path/signed-file.pdf

Debian: Customizing steps after minimal installation

Debian: Customizing steps after minimal installation published on

Install vim:

apt install -y vim

customize ~/.vimrc for root und administrator (or main user). To paste via PuTTY into a ViM window, you have to add set mouse-=a first.

syntax on
set laststatus=2
set nobackup
colorscheme elflord
set hlsearch
set mouse-=a
"auto jump to the line where closed
if has("autocmd")
  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
    \| exe "normal! g'\"" | endif
endif

~/.bashrc (root)

PS1='\[\e[1;31m\]\u@\h:\[\e[0;33m\]\w\$\[\e[0;37m\] '
export LC_COLLATE="C"
export LS_OPTIONS='--color=auto --group-directories-first'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
alias grep='grep --color'

Administrator .bashrc, uncomment:

force_color_prompt=yes

Add at the end at " some more ls aliases"

export LC_COLLATE="C"
export LS_OPTIONS='--color=auto --group-directories-first'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS' 
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'

Install/configure some stuff

apt install -y zip bash-completion
dpkg-reconfigure keyboard-configuration

Enable bash-completion /etc/bash.bashrc (uncomment)

# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

rsync through SSH

rsync through SSH published on

If you want to RSYNC through SSH and there are probably a lot of data, then use following steps:

Install screen, so you can exit your SSH session during rsyncing.

Open scren:

screen

Start a rsync from remote to your local dir:

rsync -av -e ssh username@ipadressordns:/remote/his/folder /home/my/folder/ > rsync.log 2>&1

after you started this, use CTRL+Z and with the command `bg` you make sure, the command is running in the background.
now you can use tail, to stalk the progress of the sync

tail -f rsync.log

you can leave the screen with CTRL+A then D and you can exit the SSH connection and go having a beer.
The next day you can look at your syncing with:

# resume screen from day before
screen -r

# put sync command in foreground (if it is still running)
fg

# check sync file
vim rsync.log

# start another sync like above, to make sure, everything was synced correctly

helpful: <a href="http://troy.jdmz.net/rsync/index.html">http://troy.jdmz.net/rsync/index.html</a>;

Rsync with Sudo on Remote

rsync -av -e "ssh" --rsync-path="sudo rsync" /source/ user@server.com:/destination/