Skip to content

Instantly share code, notes, and snippets.

View mmichaelb's full-sized avatar
🎓

Michael B. mmichaelb

🎓
  • DB Systel GmbH
  • Germany
View GitHub Profile
@mmichaelb
mmichaelb / cheatsheet.adoc
Last active March 31, 2023 09:27
ActivityWatch Stopwatch Aggregation Cheat Sheet

Stopwatch related Aggregation Cheat Sheet

Gather the data from ActivityWatch

Select the time range and type in the following command

stopwatch_events = query_bucket(find_bucket("aw-stopwatch"));
RETURN = stopwatch_events;
@mmichaelb
mmichaelb / Telegram_SSH_Login_notifier.md
Last active May 1, 2024 13:57
"Intelligent" Telegram SSH Login notifier on Linux using PAM

"Intelligent" Telegram SSH Login notifier on Linux using PAM

This login notifier uses IP information to send silent telegram notifications if the login source seem to be trustable.

Telegram Bot setup

First, please read this awesome Medium tutorial on how to setup the Telegram bot.

Telegram Linux setup

@mmichaelb
mmichaelb / keybase.md
Created January 11, 2020 15:08
keybase.md

Keybase proof

I hereby claim:

  • I am mmichaelb on github.
  • I am mmichaelb (https://keybase.io/mmichaelb) on keybase.
  • I have a public key whose fingerprint is 2463 F790 3522 87C3 70A7 EB31 E307 4CE4 7196 E8D3

To claim this, I am signing this object:

@mmichaelb
mmichaelb / multipart_length_calculation.go
Last active October 5, 2019 14:56
Simple method to calculate the Multipart file length of a multipart upload with a single file.
package multipartdetection
import (
"bufio"
"bytes"
"errors"
)
const (
// MultipartBodySniffLength declares the amount of bytes to read from the multipart body in
@mmichaelb
mmichaelb / argon2_test.go
Last active April 29, 2018 18:53
Golang Argon2id Algorithms Benchmark
package main
import (
"bytes"
tvdburgtArgon2 "github.com/tvdburgt/go-argon2"
goCryptoArgon2 "golang.org/x/crypto/argon2"
"log"
"strconv"
"testing"
)
import pymongo
import gridfs
# MongoDB constants
__DATABASE_NAME__ = 'sharexserver'
__UPLOAD_COLLECTION_NAME__ = 'uploads'
__GRID_FS_PREFIX_NAME__ = 'uploads'
# System file constants
__UPLOAD_FILE_DIRECTORY__ = './files/'