Skip to content

Instantly share code, notes, and snippets.

View juliusknorr's full-sized avatar

Julius Knorr juliusknorr

View GitHub Profile
@juliusknorr
juliusknorr / nextcloud-app-test-pr.md
Last active October 11, 2017 10:40
Testing a pull request for Nextcloud apps

If you have installed an app from the app store and want to help testing a pull request you can easily apply the changes by using the patch commandline tool.

Take the pull request URL, append .patch to it and download the file:

Example for PR: nextcloud/deck#320

wget https://github.com/nextcloud/deck/pull/320.path

Apply the patch to your apps directory:

API documentation DRAFT

The OCS Registration API allows you to register for an account, check the status of the registration and get initial login credentials from within clients.

The base URL for all calls to the API is: <nextcloud_base_url>/ocs/v2.php/apps/registration/api/v1

If cloud providers implement that api they need to provide all of the endpoints described in the following.

All calls to OCS endpoints require the OCS-APIRequest header to be set to true.

import json, requests
from icalendar import Calendar, Event, Alarm
from datetime import date, datetime, time, timedelta
from calendar import monthrange
from html.parser import HTMLParser
pars = HTMLParser()
addr = "19935"
year = 2018
@juliusknorr
juliusknorr / mysql_convert_mb4.sh
Created October 26, 2016 10:38
convert a mysql table to utf8mb4 (useful for migration to mb4 on Nextcloud)
#!/bin/bash
#
# CHANGE VALUES OF DATABASE AND MYSQL TO MATCH YOUR SETUP
DATABASE="devncmaster"
MYSQL="mysql -N --database=$DATABASE"
# convert database with all tables to utf8mb4
echo "ALTER DATABASE $DATABASE CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin;" | $MYSQL
@juliusknorr
juliusknorr / hackzogtum.user.js
Created October 9, 2016 11:10
hackzogtum.user.js
// ==UserScript==
// @name Hackzogtum Donate via Amazon
// @version 1.70
// @description Donate money to Hackzogtum, while shopping at different Shops
// @match *://www.amazon.de/*
// @grant GM_getValue
// @grant GM_setValue
// @updateURL
### Keybase proof
I hereby claim:
* I am juliushaertl on github.
* I am juliushaertl (https://keybase.io/juliushaertl) on keybase.
* I have a public key whose fingerprint is 8E35 BE84 64C4 39E6 66C5 19DB 4C61 4C6E D2CD E6DF
To claim this, I am signing this object:
From ed547aeb2c6f10da3639e5212b47f4e3aea450d6 Mon Sep 17 00:00:00 2001
From: Julius Haertl <[email protected]>
Date: Tue, 9 Sep 2014 22:31:49 +0200
Subject: [PATCH] Patch for sidebar iteration functionality
sidebar-new will move the selected folder to the next with new messages.
If the end is reached, it will start at the top.
Useful macros would be:
#!/usr/bin/env python
#
# Change byte order of 4-byte words
# Usage: ./revert.py "\x00\x01\x02\x03"
#
# output \x03\x02\x01\x00
import sys
if len(sys.argv) != 2:
@juliusknorr
juliusknorr / gist:8665354
Created January 28, 2014 10:31
vagrant provision output
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
puppet agent --onetime --no-daemonize --user puppet --verbose --debug --certname test01.example.com --certdir=/tmp/puppet-1390904213-511/certs --privatekeydir=/tmp/puppet-1390904213-511/private_keys --color=false --server puppet.example.com --detailed-exitcodes || [ $? -eq 2 ]
Stdout from the command:
Debug: Failed to load library 'selinux' for feature 'selinux'
Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:path=>"/etc/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Using settings: adding file resource 'vardir': 'File[/var/lib/puppet]{:path=>"/var/lib/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
@juliusknorr
juliusknorr / Guardfile
Created July 2, 2013 11:31
Guardfile for latex file auto build
# encoding: utf-8
# gem install guard
# brew install rubber
require 'guard/guard'
module ::Guard
class Thesis < ::Guard::Guard
def run_all
end