Skip to content

Instantly share code, notes, and snippets.

View juliushaertl's full-sized avatar

Julius Härtl juliushaertl

View GitHub Profile
@juliushaertl
juliushaertl / google-location-history-to-gpx.md
Last active February 1, 2024 08:59
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
@juliushaertl
juliushaertl / gist:5905622
Last active January 6, 2024 11:59
uploadscript for uberload webspace
#!/bin/bash
# uberload
# usage: uberload <folder> <source>
# this script uploads a given file or folder to a folder on my uberspace host
# if the source is a folder it gets compressed using pbzip2
# the url of the file will be put into the clipboard (os x)
# notification when the file is uploaded using terminal-notifies
# this also works with any other ssh server
SSHUSER="sshuser"
#!/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
@juliushaertl
juliushaertl / 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:$NC_PASSWORD@nextcloud.local"
SUBDIR="${1:-}"
echo "=> Parent etags"
dirnames() {

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.

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
@juliushaertl
juliushaertl / 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
@juliushaertl
juliushaertl / 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