Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View korc's full-sized avatar

Lauri Korts-Pärn korc

View GitHub Profile
@korc
korc / ssh-askpass-pinentry.py
Created August 9, 2023 10:28
ssh-agent wrapper for pinentry
#!/usr/bin/env python3
import subprocess, sys, re
from urllib.parse import quote, unquote
proc = subprocess.Popen(
["pinentry"], stdout=subprocess.PIPE, stdin=subprocess.PIPE, text=True, bufsize=1
)
@korc
korc / pre-install-extension.py
Last active October 22, 2022 08:05
Set up Chrome master_preferences file for Pre-installed Extensions. Cf. https://www.chromium.org/administrators/pre-installed-extensions/
#!/usr/bin/env python3
import sys
import os
import json
args = sys.argv[1:]
if not args:
print(
#!/bin/sh
remote="$1"
test -d "$2" || {
echo "Usage: ${0##*/} <host:port> <cert_dirs..>" >&2
exit 1
}
shift
@korc
korc / i3status-more.sh
Created December 19, 2020 12:16
i3 status bar (cpu) temperature display enhancement
#!/bin/sh
# colorize hardware temperatures for i3status (more red as temp gets closer to crit)
# (shell internal commands only)
## this script expects i3status to give output in the format of "i3bar",
## and having a placeholder with string "TEMPERATURE"
## .config/i3status/config should contain something like this:
# general {
# output_format = "i3bar"
@korc
korc / pkcs11-tls-proxy.go
Last active December 21, 2023 02:46
PKCS11-authenticated TLS socket proxy
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"net/textproto"
@korc
korc / smtpd-front.go
Created July 4, 2020 03:21
SMTP front-end daemon (w/ SPF check with -spf option)
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"os"
@korc
korc / qr.html
Last active May 20, 2020 14:39
QR-Code tool
<html>
<head>
<title>QR code tool</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jsqr@1.3.1/dist/jsQR.js"></script>
<script src="https://cdn.jsdelivr.net/npm/qrcode-generator@1.4.4/qrcode.js"></script>
@korc
korc / s3proxy.go
Last active April 21, 2020 02:00
S3 proxy test
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io"
"io/ioutil"
@korc
korc / README.md
Last active April 17, 2020 20:16
Video chat/screenshare web app over IRC

Video chat/screenshare web app over IRC

  • alpha release, expect bugs, like
    • can't join to on-going session
    • if video receive fails (for example due to frame drop), need to restart video at source
    • no audio
    • others

suggested setup

@korc
korc / led-badge-write.go
Created August 31, 2019 22:36
Programmable 44x11 LED badge (USB HID 0416:5020) programmer/driver
package main
import (
"bytes"
"encoding/binary"
"encoding/hex"
"errors"
"flag"
"fmt"
"image"