Skip to content

Instantly share code, notes, and snippets.

from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import PageObject
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('first', help='First file (first page becomes first page)')
parser.add_argument('second', help='Second file (first page becomes second page)')
parser.add_argument('output', nargs='?', help='Output file name (optional)')
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
print('Installed GTK+ version is ' +
class MyWindow(Gtk.Window):
def __init__(self):
dreua /
Created December 22, 2020 14:59
Apache reverse proxy configuration for OnlyOffice + Humhub
# MDomain in humhub site config to make it one certificate.
# TODO on next patchday: remove http config
<VirtualHost *:80>
DocumentRoot /var/www/
ErrorLog /var/www/
CustomLog /var/www/ combined
dreua / asdfbrackets
Last active December 20, 2022 18:13
On German keyboards, typing the brackets and braces like {[]} is quite annyoing (especialy when programming) so I remapped them to AltGr+asdf which is much better imo. This is tested on Fedora Linux but it should work on most Linuxes.
View asdfbrackets
# Save this file as /usr/share/X11/xkb/symbols/asdfbrackets
# Thanks to: BRPocock's answer at
partial alphanumeric_keys
xkb_symbols "asdfbrackets" {
name[Group1]="brackets on AltGr+asdf";
key <AC01> { [ a, A, braceleft, AE ] };
dreua /
Last active April 24, 2023 14:13
Simple instructions for adding a shortcut to nautilus which opens a terminal at the current location

I copied this from "RobotMan" on

I added a new feature to Nautilus with the precious help of the maintainers.

This new feature allow you to map custom keyboard shortcuts to launch the scripts in the scripts folder ( ~/.local/share/nautilus/scripts ).

So, when you add an executable in that folder it will appear in the right-click context menu, but now if you create a special configuration file ( ~/.config/nautilus/scripts-accels ) you can assign a shortcut to it.

For example make a script called Terminal with the following content:

dreua /
Last active April 28, 2023 01:30 — forked from Geekfish/
pyPDF2 merge 2 pdf pages into one
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2 import PageObject
# Theses files are just for testing, no point in merging these
reader = PdfFileReader(open("Nextcloud Manual.pdf",'rb'))
# this defines the output page format (relevant if not the same)