Skip to content

Instantly share code, notes, and snippets.

Julian Andres Klode julian-klode

Block or report user

Report or block julian-klode

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View raisetdp
#!/bin/sh
write() {
file="$1"
shift
echo "$@" | sudo tee "$file"
}
case "$1" in
View query_n26.py
#!/usr/bin/python3
import json
import requests
import os
import sys
import time
from collections import OrderedDict
from typing import Any, Dict, Iterator
View goledger.go
///bin/true; exec /usr/bin/env go run "$0" "$@"
package main
import (
"flag"
"log"
"os"
"regexp"
"runtime/pprof"
"strings"
View lxd-dev-profile.yaml
config:
raw.idmap: both 1000 1000
user.user-data: |
#cloud-config
users:
- name: jak
gecos: Julian Andres Klode
plain_text_passwd: 'ubuntu'
home: /home/jak
shell: /bin/bash
View gpgmime.py
#!/usr/bin/env python3
"""Encrypt/Decrypt GPG/MIME messages"""
import os
import sys
import email.mime.application
import email.mime.multipart
import email.mime.message
import errno
@julian-klode
julian-klode / README.md
Last active Jun 8, 2019
Setting up a server-side encrypted maildir
View README.md

This describes the idea behind an encrypted maildir on the server, with multiple clients that have access to it, and store unencrypted copies.

Initial setup:

  1. Generate a gpg key like maildir@jak-linux.org
  2. Import the public key into the keyring on the server
  3. Import private and public keys into keyring on the clients

On the server:

  1. Create an empty Maildir
View test.py
#!/usr/bin/python3
import json
import os
import socket
import sys
socketFd=int(os.environ["APT_HOOK_SOCKET"])
View hooks.md

JSON Hooks

APT 1.6 introduces support for hooks that talk JSON-RPC 2.0. Hooks act as a server, and APT as a client.

Wire protocol

APT communicates with hooks via a UNIX domain socket in file descriptor $APT_HOOK_SOCKET. The transport is a byte stream (SOCK_STREAM).

View -
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
View dpkg-delta.c
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "jkdiff.h"
struct tar_header {
char name[100];
char mode[8];
char uid[8];
char gid[8];
You can’t perform that action at this time.