Skip to content

Instantly share code, notes, and snippets.

View geostarling's full-sized avatar

Jiří Špaček geostarling

  • Czech Technical University
  • Prague
View GitHub Profile
@geostarling
geostarling / mozlz4a.py
Last active October 6, 2020 19:36 — forked from Tblue/mozlz4a.py
MozLz4a compression/decompression utility
#!/usr/bin/env python3
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
# This file format is in fact just plain LZ4 data with a custom header (magic number [8 bytes] and
# uncompressed file size [4 bytes, little endian]).
#
# This Python 3 script requires the LZ4 bindings for Python, see: https://pypi.python.org/pypi/lz4
#
@geostarling
geostarling / mbsync-notify.sh
Created October 26, 2018 10:02 — forked from dennisse/mbsync-notify.sh
mbsync-notify.sh
#!/usr/bin/env bash
# This file:
#
# - Uses mbsync to check your email if you have a connection to the server.
# - Slows down syncing if you're on battery
# - Notifies you of new emails
#
#
# Usage:
#
#!/bin/bash
# vim: tabstop=4
GRANT_TYPE='client_credentials'
############### Functions ###############
parse_json() {
local input=$1
local attr=$2