Skip to content

Instantly share code, notes, and snippets.

@dreua
dreua / oo.example.com.conf
Created Dec 22, 2020
Apache reverse proxy configuration for OnlyOffice + Humhub
View oo.example.com.conf
# MDomain in humhub site config to make it one certificate.
# TODO on next patchday: remove http config
<VirtualHost *:80>
ServerName oo.example.com
DocumentRoot /var/www/oo.example.com/html
ErrorLog /var/www/oo.example.com/log/error.log
CustomLog /var/www/oo.example.com/log/requests.log combined
</VirtualHost>
View testspinbutton.py
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
print('Installed GTK+ version is ' +
'.'.join([str(Gtk.get_major_version()),
str(Gtk.get_minor_version()),
str(Gtk.get_micro_version())]))
class MyWindow(Gtk.Window):
def __init__(self):
View merge_pdfs_doublesided.py
#!/bin/python3
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)')
@dreua
dreua / merge_pdfs.py
Last active Sep 19, 2022 — forked from Geekfish/merge_pdfs.py
pyPDF2 merge 2 pdf pages into one
View merge_pdfs.py
#!/bin/python3
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)
@dreua
dreua / asdfbrackets
Last active Jun 9, 2022
On German keyboards, typing the brackets and braces like {[]} is quite annyoing (especialy when programming in JAVA) 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
# https://ask.fedoraproject.org/en/question/73014/how-to-assign-ctrl-up-to-home-ctrl-down-to-end-ctrl-left-to-page-up-and-ctrl-right-to-page-down/?answer=73021#post-id-73021
partial alphanumeric_keys
xkb_symbols "asdfbrackets" {
name[Group1]="brackets on AltGr+asdf";
key <AC01> { [ a, A, braceleft, AE ] };
@dreua
dreua / Nautilus_Terminal_Shortcut.md
Last active Sep 13, 2022
Simple instructions for adding a shortcut to nautilus which opens a terminal at the current location
View Nautilus_Terminal_Shortcut.md

I copied this from "RobotMan" on http://askubuntu.com/a/696901

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: