Skip to content

Instantly share code, notes, and snippets.

View jirutka's full-sized avatar
🇺🇦
Слава Україні!

Jakub Jirutka jirutka

🇺🇦
Слава Україні!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jirutka on github.
  • I am jirutka (https://keybase.io/jirutka) on keybase.
  • I have a public key whose fingerprint is D785 8912 669D 3A20 F4F4 6BD2 F95B D679 104D 3115

To claim this, I am signing this object:

@jirutka
jirutka / acme-challenge.conf
Created November 24, 2018 15:15
nginx example
#
# Server challenge directory for Let's encrypt!
#
location /.well-known/acme-challenge/ {
alias /var/www/acme/;
}
@jirutka
jirutka / cz-qwerty-ng
Last active October 28, 2018 22:10
Czech QWERTY keyboard layout revisited
partial alphanumeric_keys
xkb_symbols "qwerty-ng" {
// 2018 by Jakub Jirutka <jakub@jirutka.cz>
name[Group1]= "Czech (QWERTY/ng)";
// Unmodified, Shift, AltGr, Shift+AltGr
key <TLDE> { [ semicolon, asciitilde, grave, degree ] };
key <AE01> { [ exclam, 1, exclamdown, notsign ] };
@jirutka
jirutka / cz
Created June 6, 2018 23:45
Keyboard layout for X11 that corresponds to the Apple's Czech – QWERTY
partial alphanumeric_keys
xkb_symbols "qwerty-mac" {
// This layout corresponds to the Apple's Czech - QWERTY.
// 2018 by Jakub Jirutka <jakub@jirutka.cz>
include "latin"
name[Group1]= "Czech (QWERTY, Macintosh)";
// Unmodified, Shift, AltGr, Shift+AltGr
@jirutka
jirutka / procs-using-deleted-files
Last active November 30, 2022 15:11
Find processes that use (maps into memory) files which have been deleted or replaced on disk.
#!/bin/sh
#---help---
# Usage: procs-using-deleted-files [options]
#
# Find processes that use (maps into memory) files which have been deleted
# or replaced on disk. If /proc/$PID/map_files is accessible, then it omits
# files that have been replaced by the same files (i.e. content is the same).
#
# Options:
# -e PATT... Case pattern (POSIX shell's "case") specifying paths to exclude
@jirutka
jirutka / rc-service-pid
Last active April 11, 2018 23:50
Script for finding PID of running OpenRC service and vice versa.
#!/bin/sh
#---help---
# Usage: rc-service-pid [-h | SVCNAME | PID]
#
# Prints list of running OpenRC services with their PIDs (services which PID
# cannot be resolved are omitted). If SVCNAME is provided, prints only PID
# of service with name SVCNAME. If PID is provided, prints name of the
# service that started process with the given PID or its ancestor.
#
# Source: <https://gist.github.com/jirutka/5cf0e731dbc39a3a6fff0c6e1a2c2510>
@jirutka
jirutka / Makefile
Created November 13, 2017 22:34
Custom OpenLDAP overlay that adds a “virtual” attribute with person’s full name constructed from other attributes.
LDAP_SRC = ../../..
LDAP_BUILD = $(LDAP_SRC)
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
$(LDAP_BUILD)/libraries/liblber/liblber.la
LIBTOOL = $(LDAP_BUILD)/libtool
CC = gcc
OPT = -O2 -Wall -Wno-discarded-qualifiers -Wno-format-extra-args -pedantic
DEFS =
@jirutka
jirutka / prague-voting-places.json
Created October 20, 2017 23:41
Voting places in Prague for year 2017 in JSON. Source: https://app.iprpraha.cz/apl/app/volby/PS_2017
[
{
"voting_districts": [
1001
],
"districts_ruian": [
30531
],
"address": "Pohořelec 111/25, Hradčany, 11800 Praha 1",
"name": "Pobočka Městské knihovny Praha - Pohořelec",
@jirutka
jirutka / apk-chroot-installation-demo.sh
Created October 8, 2017 20:34
This is a demo script used at Alpine Linux booth at LinuxDays 2017 to demonstrate how is apk-tools and Alpine Linux awesome. Recorded output: https://asciinema.org/a/141360
#!/bin/sh
# vim: set ts=4:
#
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
set -eu
APK_KEY_URI='https://alpinelinux.org/keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub'
APK_KEY_SHA1='3af08548ef78cfdedcf349880c2c6a1a48763a0e'
@jirutka
jirutka / LICENSE
Last active August 9, 2022 09:39
Generate a new GPG key pair in a temporary GPG Home and export it to a file. It can run completely unattended, without prompting for a passphrase.
The MIT License
Copyright 2018-2019 Jakub Jirutka <jakub@jirutka.cz>.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: