Skip to content

Instantly share code, notes, and snippets.

View dAnjou's full-sized avatar
🔚
Moving to GitLab

Max Ludwig dAnjou

🔚
Moving to GitLab
View GitHub Profile
@dAnjou
dAnjou / _.md
Last active November 14, 2023 11:49
Automatically unlock KeePass database with GNOME Keyring

(Tested with KeePassXC on Fedora 25)

By default when using GNOME Keyring you have a keyring that is unlocked when you log in (usually called "Login"). You can make use of that by storing a KeePass database password in this keyring and using it to automatically unlock your KeePass database.

Store the KeePass database password in GNOME Keyring. You'll have to set a label and at least one attribute/value pair. The label is displayed in a GNOME keyring manager (e.g. Seahorse), the attribute/value pair should be a unique identifier because it's needed for the lookup. I suggest to use keepass as attribute and the database name as value (make sure it doesn't contain any spaces).

secret-tool store --label="KeePass <database_name>" keepass <database_name>

Then create a script to launch and immediately unlock your KeePass database.

@dAnjou
dAnjou / _README_.md
Last active August 29, 2015 14:04
Testing import of Excel files

Usage

Run like this for example:

python2 excel_test.py | column -t

Output should look like this:

first_name   last_name  email                     gender
Salomé 笑薇 rjenkins@linktype.com Ms.
@dAnjou
dAnjou / _error_
Created July 22, 2012 20:41
Flask: circular import problem
Traceback (most recent call last):
File "server.py", line 8, in <module>
from models import User
File "/home/max/Projekte/flask-testing-stuff/models.py", line 1, in <module>
from server import db
File "/home/max/Projekte/flask-testing-stuff/server.py", line 8, in <module>
from models import User
ImportError: cannot import name User
@dAnjou
dAnjou / flask-upload
Created June 5, 2012 12:35
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@dAnjou
dAnjou / gitted.sh
Last active October 5, 2015 19:37
Script to find Git repos and show their status
#!/bin/bash
find "$@" -type d -name ".git" -execdir bash -c '
if [ ! $(git status | grep -o nothing) ]
then
x=$(basename "$PWD")
y=$(dirname "$PWD")
origin_url=$(git config --get remote.origin.url)
echo -e "\e[1;32m${x}\e[0m (${y}) ${origin_url}" >&2
git status -s >&2