Skip to content

Instantly share code, notes, and snippets.

#
# Christian Kujau <lists@nerdbynature.de>
#
# Zero-padding examples in Bourne shell
# Based on some wonderful examples from
# http://jonathanwagner.net/2007/04/zero-padding-in-bash
#
if [ -z "$2" ]; then
echo "Usage: `basename $0` (`awk '/^\t[a-z0-9]*\)$/' "$0" | xargs echo | sed 's/) /|/g'` [count]"
--- core/templates/login.php.orig 2013-07-10 01:41:17.395088962 +0200
+++ core/templates/login.php 2013-07-10 21:09:49.787218394 +0200
@@ -34,8 +34,6 @@
required<?php p($_['user_autofocus'] ? '' : ' autofocus'); ?> />
<label for="password" class="infield"><?php p($l->t('Password')); ?></label>
<img class="svg" id="password-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/>
- <input type="checkbox" id="show" name="show" />
- <label for="show"></label>
</p>
<input type="checkbox" name="remember_login" value="1" id="remember_login"/><label
@ckujau
ckujau / mount-smb-shares.sh
Last active January 1, 2016 03:59
mount/umount smb shares demo
#!/bin/sh
#
# Mount/unmount SMB shares
#
case $1 in
mount)
logger -s "$0 sleeping 60 seconds..."
sleep 60
mount -t cifs -o ro,guest //server/share1 /mnt/share1
mount -t cifs -o rw,username=foo,password=secret //server/share2 /mnt/share2
@ckujau
ckujau / oc_contacts_cards converter
Last active June 11, 2016 02:31
Trying to convert Owncloud addressbook data from oc_contacts_cards to oc_cards
#!/bin/sh
#
# oc_contacts_cards
# FROM: id, addressbookid, carddata, uri, lastmodified, fullname
# id|fullname|carddata|uri|addressbookid|lastmodified
#
# oc_cards
# TO: id, addressbookid, carddata, uri, lastmodified, etag, size
# id|addressbookid|carddata|uri|lastmodified|etag|size
#
@ckujau
ckujau / htpasswd.sh
Last active August 26, 2023 22:24
Generate an .htpasswd file without the Apache tools
#!/bin/bash
#
# Generate an SSHA password for .htpasswd files
# * https://www.nginx.com/resources/wiki/community/faq/#how-do-i-generate-an-htpasswd-file-without-having-apache-tools-installed
# * https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic_user_file
#
if [ -z "$1" ]; then
echo "Usage: $(basename $0) [user]"
exit 1
else
@ckujau
ckujau / matomo_manifest.sh
Last active January 18, 2020 21:03
Matomo manifest.inc.php generator
#!/bin/sh
#
# Matomo manifest.inc.php generator
#
if [ ! -d "$1" ]; then
echo "Usage: $(basename $0) [matomo-dir]"
exit 1
else
DIR="${1}"
fi
@ckujau
ckujau / get-signal.sh
Last active October 14, 2019 14:11
Workaround for #1630
#!/bin/sh
#
# (c)2018 Christian Kujau <lists@nerdbynature.de>
#
# A (far too complicated) script to get the Ubuntu package of
# Signal on a non-Debian based Desktop.
#
# Packages for rpm-based linux distributions like Fedora #1630
# https://github.com/signalapp/Signal-Desktop/issues/1630
#
@ckujau
ckujau / lanyon_base_tmpl.diff
Last active November 22, 2020 17:36
Some (unsubmitted) patches to my Nikola installation.
--- themes/lanyon/templates/base.tmpl.orig 2020-11-21 13:03:35.415560169 -0800
+++ themes/lanyon/templates/base.tmpl 2020-11-21 13:20:55.148189847 -0800
@@ -22,8 +22,8 @@ ${template_hooks['extra_head']()}
<!-- Toggleable sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-item">
- <p>A reserved <a href="https://getnikola.com" target="_blank">Nikola</a> theme that places the utmost gravity on content with a hidden drawer. Made by <a href="https://twitter.com/mdo" target="_blank">@mdo</a> for Jekyll,
- ported to Nikola by <a href="https://twitter.com/ralsina" target="_blank">@ralsina</a>.</p>
+ <!-- <p>A reserved <a href="https://getnikola.com" target="_blank">Nikola</a> theme that places the utmost gravity on content with a hidden drawer. Made by <a href="https://twitter.com/mdo" target="_blank">@mdo</a> for Jekyll,
+ ported to Nikola by <a href="https://twitter.com/ralsina" target="_blank">@ralsina</a>.</p>-->