Skip to content

Instantly share code, notes, and snippets.

@bartv2
bartv2 / split.awk
Created July 3, 2022 15:44
Split a kjot text export into multiple files
/^###/ { header=1 }
/^# / && header {
if (/^# Page/) {
page=substr($0, 8)
} else {
if (page) {
page=""
dir=substr($0, 3)
} else {
dir=dir "/" substr($0, 3)
@bartv2
bartv2 / Dockerfile
Created March 17, 2020 20:56
azure-cli Dockerfile
FROM alpine
ENV AZ 2.0.62
RUN apk add -U python3 bash && \
apk add --virtual=build gcc python3-dev musl-dev libffi-dev openssl-dev make && \
pip3 install azure-cli==${AZ} && \
ln -s /usr/bin/python3 /usr/bin/python && \
apk del --purge build
#!/bin/bash
# Unlock the directory, we need the unencrypted versions of the files
git crypt unlock
# Re-initialize git crypt, generating a new key
rm .git/git-crypt/keys/default
git crypt init
# Make the key available to the current users
@bartv2
bartv2 / info.php
Created September 16, 2013 20:30
owncloud public app interface
<?php
/**
* Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCP\App;
@bartv2
bartv2 / switch2publicAPI.sh
Created July 19, 2013 11:50
Script used to change the apps to use the OCP functions instead of the core ones
#!/bin/bash
find -name *.php -print0 | xargs -0 sed -i -e '
s/OC_API::register/OCP\\API::register/gi;
s/OC_App::addNavigationEntry/OCP\\App::addNavigationEntry/gi;
s/OC_App::setActiveNavigationEntry/OCP\\App::setActiveNavigationEntry/gi;
s/OC_App::registerPersonal/OCP\\App::registerPersonal/gi;
s/OC_App::registerAdmin/OCP\\App::registerAdmin/gi;
s/OC_App::getAppInfo/OCP\\App::getAppInfo/gi;