Skip to content

Instantly share code, notes, and snippets.

View juliusknorr's full-sized avatar

Julius Knorr juliusknorr

View GitHub Profile
#!/bin/bash
for f in ~/repos/nextcloud/.github/workflow-templates/*.yml
do
filename=$(basename "$f")
target="./.github/workflows/$filename"
if test -f "$target"; then
echo "$target exists, copy new content"
cp $f $target
fi
done
@juliusknorr
juliusknorr / etags.sh
Created June 15, 2023 14:37
Smalls script to get etags for debugging sync issues
#!/bin/bash
NC_USER=admin
NC_PASSWORD=admin
NC_URL="http://$NC_USER:[email protected]"
SUBDIR="${1:-}"
echo "=> Parent etags"
dirnames() {
Index: lib/directeditor.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/directeditor.php (revision c49b4a2fb8609b30d09fc5914753b64c23cab41b)
+++ lib/directeditor.php (date 1578566744661)
@@ -244,7 +244,8 @@
$csp->addAllowedFrameDomain($documentServerUrl);
} else {

To be called with:

git diff --text --word-diff=porcelain | awk -v red="$(tput setaf 1)" -v green="$(tput setaf 2)" -v reset="$(tput sgr0)" -f ~/.dotfiles/scripts/worddiff.awk
@juliusknorr
juliusknorr / gist:75578e1fe9a1e8fee10ffe2f770598bf
Created March 22, 2019 08:17
cleanup bundled js files from gitattributes
cat .gitattributes | grep binary | awk '/./{gsub(/^\//, "", $1); print $1 }' | xargs git checkout --
for i in `seq 1 100`; do wget https://picsum.photos/3000/2000/?random -O $i.jpg; done
@juliusknorr
juliusknorr / github-merge-report.py
Created February 3, 2018 00:54
github-merge-report for sending list of updated pull requests of the last day
from github import Github
from datetime import datetime, timedelta
date = datetime.today() - timedelta(days=1)
g = Github("username", "apikey")
query = "org:nextcloud type:pr is:merged base:master updated:>=%s" % date.strftime("%Y-%m-%d")
prs = g.search_issues(query, sort="updated", order="desc")
@juliusknorr
juliusknorr / google-location-history-to-gpx.md
Last active October 9, 2024 21:32
google-location-history-to-gpx

convert google takeout archive for location history from kml to gpx and split file into one per day

gpsbabel -i kml -f Location\ History.kml -o gpx -F out.gpx
gpsbabel -t -i gpx -f out.gpx -x track,merge,pack,split,title="ACTIVE LOG # %Y%m%d" -o gpx -F split.gpx
python2 gpxsplitter.py split.gpx
@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.