Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# This script will stop the service, backup the data folder including
# the database, the attachments and keys of your vaultwarden installation.
# Only the last 14 backups will be kept. If you want to keep more or less, please
# adjust the time on the last line of the script
# for this script to work to work adjust the following 4 folders to your environment
# timestamp added to the backup filename e.g. 20220130-1325
NOW=$(date +'%Y%m%d-%H%M')

How to import own modules in Jupyter

Solution one: do it inside jupyter

Here is what I do on my projects in jupyter notebook,

import sys
sys.path.append("../") # go to parent dir
from customFunctions import *
cat > /etc/apk/repositories << EOF; $(echo)
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
EOF
apk update

The best way to store your dotfiles: A bare Git repository

ORIGINAL BLOG POST https://www.atlassian.com/git/tutorials/dotfiles

Disclaimer: the title is slightly hyperbolic, there are other proven solutions to the problem. I do think the technique below is very elegant though.

Recently I read about this amazing technique in an Hacker News thread on people's solutions to store their dotfiles. User StreakyCobra showed his elegant setup and ... It made so much sense! I am in the process of switching my own system to the same technique. The only pre-requisite is to install Git.

@cblte
cblte / hookfile.sh
Last active September 13, 2021 01:04
PHP Script to execute shellscript (hookfile.sh) via Github Webhook in a secure way. Environment works for uberspace.de. Static site gen is hugo (gohugo.io)
#!/bin/bash
# --------------------
# place this file anywhere where it can be execute fromthe webhook.php file.
# make sure, you put the correct path to this file into the webhook.php
# webdirectory is a directory accessible via internet, but not the main websites directory
# .. ideally webdirectory is a access via subdomain
# --------------------
# set PATH
@cblte
cblte / gitlab-webhook-push.php
Created April 22, 2021 18:25 — forked from pitchart/gitlab-webhook-push.php
A simple php script to manage gitlab push webhook
<?php
/**
* GitLab Web Hook
* See https://gitlab.com/kpobococ/gitlab-webhook
*
* This script should be placed within the web root of your desired deploy
* location. The GitLab repository should then be configured to call it for the
* "Push events" trigger via the Web Hooks settings page.
*
* Each time this script is called, it executes a hook shell script and logs all
<html>
<head>
<style>
body {
font-family: Verdana, sans-serif;
margin: auto;
padding: 20px;
text-align: left;
background-color: #fff;
@cblte
cblte / main.go
Created April 9, 2021 08:10 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@cblte
cblte / AsciidocCheatsheet.adoc
Created March 26, 2021 12:31 — forked from powerman/AsciidocCheatsheet.adoc
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

@cblte
cblte / check-fornewmacbook.sh
Created November 26, 2020 22:48
Check for new MacBook Pro on coolblue and mediamarkt
#!/bin/bash
urlcb="https://www.coolblue.nl/en/laptops/apple-macbook/apple-macbook-pro/13-inch-screen/processor:apple-m1-chip"
urlmm="https://www.mediamarkt.nl/nl/category/_apple-mac-755619.html?searchParams=%2FSearch.ff%3FfilterTabbedCategory%3Donlineshop%26filterCategoriesROOT%3DComputer%25C2%25A7MediaNLnlc482710%26filterCategoriesROOT%252FComputer%25C2%25A7MediaNLnlc482710%3DApple%2BMac%25C2%25A7MediaNLnlc755619%26filteravailability%3D1%26filterProcessormodel%3DApple%2BM1%26channel%3Dmmnlnl%26followSearch%3D9954%26disableTabbedCategory%3Dtrue%26navigation%3Dtrue&sort=&view=&page="
text1=$'NEW MAC NEW MAC! Check the Website!\n\n'
countcb=`curl -s -L $urlcb | grep -c -E -i "alt=\"Apple .* MYD.{3}\/"`
countmm=`curl -s -L $urlmm | grep -c -E "name\":\"APPLE MacBook Pro.*M1"`