Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am artizirk on github.
  • I am artizirk (https://keybase.io/artizirk) on keybase.
  • I have a public key whose fingerprint is E1C8 9E77 5E19 5E71 DDF4 A826 236F 84F2 5E95 3F6A

To claim this, I am signing this object:

@artizirk
artizirk / .bashrc
Last active November 13, 2018 13:03
git prompt in debian
if [[ -e /usr/lib/git-core/git-sh-prompt ]]; then
. /usr/lib/git-core/git-sh-prompt
fi
export GIT_PS1_SHOWDIRTYSTATE=1
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)") \$ '
@artizirk
artizirk / .srandrdrc
Created November 12, 2018 13:17
srandrd config file
#!/bin/bash
#srandrd -e -n ~/.srandrdrc &
if [[ "$SRANDRD_OUTPUT" =~ ^VGA ]]; then
echo "VGA $SRANDRD_EVENT"
case "$SRANDRD_EVENT" in
"connected" )
xrandr --output "eDP-1" --off
xrandr --output "$SRANDRD_OUTPUT" --auto
;;
@artizirk
artizirk / export existing ssh private key to opengpg card.md
Last active July 31, 2024 13:24
Export existing private ssh key to OpenPGP card or Yubikey

Export existing private ssh key to OpenPGP card or Yubikey

Before you begin

This will only work with OpenPGP v2.0 or newer or with PIV cards. Your existing ssh key has to be in a format that is supported by your opengpg card. For example my the OpenPGP V2.1 Card from FLOSS Shop supports only 2048 bit RSA keys. RSA exponent should be 65537, Putty and old OpenSSH releases use different expnent that for example Yubikey does not support.

Required software

@artizirk
artizirk / id_rsa to pem converting.md
Last active January 20, 2024 10:37
Converting openssh private key format to pem

Converting openssh private key format to pem

man page says that you can use -e option to convert private and public keys to other formats, that seems to be wrong. Instead you can use -p option to request changing the password but not actually setting the password.

ssh-keygen -p -f id_rsa -m pem

Converting pem to OpenPGP

Monkeysphere project includes a pem2openpgp command that can be used to import ssh private keys to gnupg keyring.

@artizirk
artizirk / statsd_send.py
Last active September 18, 2018 11:49
minimal statsd client
# Generates netdata graphs like this https://i.imgur.com/frT6LPW.png
import socket
from time import sleep
from random import randint
UDP_IP = "127.0.0.1" # statsd server ip
UDP_PORT = 8125 # default statsd port
print("UDP target IP:", UDP_IP)
print("UDP target port:", UDP_PORT)
@artizirk
artizirk / gstreamer_experiments.md
Last active March 24, 2022 12:13
gstreamer experiments

Links

https://gist.github.com/strezh/9114204

cmds

Convert motec camera mjpg to h264 and stream it to localhost

gst-launch-1.0 -v rtspsrc location=rtsp://10.0.0.11:8554/MCDE3000 latency=0 ! decodebin ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! h264parse ! rtph264pay pt=96 ! udpsink host=127.0.0.1 port=5000

Playback h264 from locahost

Wireguard autmatic configuration ideas

Collection of ideas for automatic wireguard interface configuration

Generating ipv6 aadresses

  • Interface gets a link local ip like so fe80::hash(interfacepubkey)/64
  • Each peer allowed ips get fe80::hash(peerpubkey)/128

Pushing ipv6 configuration

@artizirk
artizirk / README.md
Last active March 4, 2021 10:02
kiosk

debian 9 software

apt install xserver-xorg xserver-xorg-input-evdev xinit x11-xserver-utils x11-utils xterm matchbox xinput lightdm chromium unclutter

lightdm auto login

sed -i -e 's/#autologin-user=/autologin-user=user/g' /etc/lightdm/lightdm.conf

/home/user/.xsession

#!/usr/bin/systemd-cat /bin/bash

@artizirk
artizirk / pyroute_netlink_wireguard.py
Last active July 5, 2022 14:09
Test program to print out WireGuard interface config using Python pyroute2 netlink library