Skip to content

Instantly share code, notes, and snippets.

Raphi raphiz

Block or report user

Report or block raphiz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@raphiz
raphiz / pdf_remove_watermark.py
Created Sep 28, 2015
PDF watermark removal
View pdf_remove_watermark.py
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import ContentStream
from PyPDF2.generic import TextStringObject, NameObject
from PyPDF2.utils import b_
wm_text = 'Persönliches Exemplar von'
replace_with = ''
# Load PDF into pyPDF
source = PdfFileReader(open('input.pdf', "rb"))
@raphiz
raphiz / nsupdate.sh
Last active Apr 3, 2019
Update script for nsupdate.info (For Synology NAS systems)
View nsupdate.sh
#!/usr/bin/env sh
DOMAIN="domain.nsupdate.info"
TOKEN="MYTOKEN"
# Evaluate the current remote IP and the one that is currently registerd
CURRENT=$(curl -s https://ipv4.nsupdate.info/myip)
SAVED=$(python2 -c "import socket; print socket.gethostbyname('$DOMAIN')")
LOGFILE=$( cd "$( dirname "${0}" )" && pwd )/log.txt
TEMPFILE=$( cd "$( dirname "${0}" )" && pwd )/tmp
@raphiz
raphiz / suspend.service
Created Sep 19, 2016
Lock screen on suspend - i3 - /etc/systemd/system/
View suspend.service
[Unit]
Description=User suspend actions
Before=sleep.target
[Service]
User=rzi # Replace with your user id - %I does not work somehow :/
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/blurlock # Or i3lock
ExecStartPost=/usr/bin/sleep 1
View gist:4b38da871198ba7d50db42bd3e1c5ff8
curl -v -L https://purl.org/net/pkgwpub/tectonic-default -o tlextras-2016.0r4.tar
> GET /net/pkgwpub/tectonic-default HTTP/1.1
> Host: purl.org
> User-Agent: curl/7.54.1
> Accept: */*
>
{ [5 bytes data]
< HTTP/1.1 302 FOUND
< Server: nginx/1.4.6 (Ubuntu)
< Date: Wed, 09 Aug 2017 05:07:28 GMT
@raphiz
raphiz / docker-compose.yml
Created Dec 15, 2016
Redmine docker-compose
View docker-compose.yml
version: '2'
services:
redmine:
image: redmine
ports:
- 0.0.0.0:8080:3000
environment:
REDMINE_DB_MYSQL: db
REDMINE_DB_PASSWORD: example
depends_on:
@raphiz
raphiz / config.yaml
Last active Sep 22, 2016
My openhsr connect config for HS2016
View config.yaml
login:
username: rzimmerm
email: raphael.zimmermann@hsr.ch
sync:
global-exclude:
- .DS_Store
- Thumbs.db
conflict-handling:
View 00-keyboard.conf
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us_umlauts"
Option "XkbModel" "pc105"
Option "XkbVariant" ""
Option "XkbOptions" "terminate:ctrl_alt_bksp,grp:alt_shift_toggle"
EndSection
@raphiz
raphiz / us_umlauts
Created Jun 13, 2016
My custom xkb keyboard layout (/usr/share/X11/xkb/symbols/us_umlauts/us_umlauts)
View us_umlauts
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
name[Group1]= "English (German Umlauts)";
key <TLDE> { [ grave, asciitilde ] };
key <AE01> { [ 1, exclam ] };
key <AE02> { [ 2, at ] };
key <AE03> { [ 3, numbersign ] };
key <AE04> { [ 4, dollar ] };
View gist:1a7921b66acecdcc3d2eb7f320d25cc2
### Keybase proof
I hereby claim:
* I am raphiz on github.
* I am raphiz (https://keybase.io/raphiz) on keybase.
* I have a public key whose fingerprint is E9C7 3898 CF7C 96D8 D321 37DF 522C C665 31B5 A199
To claim this, I am signing this object:
@raphiz
raphiz / sync.sh
Last active Apr 5, 2016
HSR Skripteserver Sync-Skript
View sync.sh
#!/bin/bash
set -e
###################
## Konfiguration ##
###################
## Ersetze <your username> um nicht jedes mal nach deimem HSR Benutzername gefragt zu werden
# HSR_USERNAME="<your username>"
You can’t perform that action at this time.