Skip to content

Instantly share code, notes, and snippets.

Raphi raphiz

View GitHub Profile
@raphiz
raphiz / synchronize_ftp.sh
Created Nov 12, 2014
Synchronize FTP server with a local directory (Linux)
View synchronize_ftp.sh
#!/usr/bin/env bash
# Requires: curlftpfs, unison and fuse.
# Configuration:
MOUNTPOINT=/mnt/my_ftp_share/
LOCAL="/home/user/directory"
FTP_HOST="example.com"
FTP_USER="user"
FTP_PASS="secrit"
@raphiz
raphiz / android-backup-extractor.sh
Created Dec 28, 2014
Converts the contents of a .ab android backup file into a .tar archive
View android-backup-extractor.sh
#!/usr/bin/env bash
#
# Converts the contents of a .ab android backup file into a .tar archive
#
# Usage: android-backup-extractor.sh SOURCE <DESTINATION>
#
# Requirements: dd, openssl
# License: MIT
# Autor: Raphael Zimmermann (http://raphael.li)
#
@raphiz
raphiz / deploy.sh
Created Dec 28, 2014
Easily deploy Composer Apps to a remote FTP server using curlftpfs, rsync and git
View deploy.sh
#!/usr/bin/env bash
# Requires: fuse, curlftpfs, rsync, git and composer
set -u
REPOSITORY="https://github.com/raphiz/php-raphael.li.git"
FTP_HOST="myhost.com"
FTP_USER="user"
FTP_PASS="secrit"
FTP_SUBFOLDER="httpdocs"
@raphiz
raphiz / nsupdate.sh
Last active Feb 2, 2020
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 / deploy.sh
Last active Aug 29, 2015
FTP Deplozment Script
View deploy.sh
#!/usr/bin/env bash
# Abort if a command fails!
set -e
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
if [ ! -n "$HOST" ];then
echo "missing option \"HOST\", aborting"
exit 1
@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 / euklid.py
Created Jan 24, 2016
A quick & dirty implementation of the Euclidean algorithm in python
View euklid.py
#!/usr/bin/env python
# coding=utf-8
from tabulate import tabulate
a = 180
b = 101
def euklid(x_p, y_p, q_p=None, r_p=None, u_p=None, s_p=None, v_p=None, t_p=None, result=None):
@raphiz
raphiz / README.md
Last active Jan 26, 2016
Moodle HSR Autologin Raw
View README.md

Autologin for https://moodle.hsr.ch/ with the power of userscripts.

Please note that you should from a security point of view store the username and password using the browsers built-in password manager! To do so, store the before installing these scripts and remove the highlighted two lines from moodle_autologin_2.js. Otherwise, replace the and values with your credentials.

@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>"
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:
You can’t perform that action at this time.