Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@artizirk
artizirk / 0README.md
Last active September 26, 2022 01:46
Apple macOS Catalina under Linux KVM with GVT-g Intel GPU passthrough notes
@artizirk
artizirk / index.html
Last active September 1, 2022 17:12
Python asyncio websockets http static file server, aka http and websocket server on the same port: python-websockets/websockets#116
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebSocket demo</title>
</head>
<body>
<script>
var ws = new WebSocket("ws://127.0.0.1:8765/"),
messages = document.createElement('ul');
@artizirk
artizirk / test.sh
Created August 25, 2013 18:42
bash cgi script with bootstrap template
#!/bin/sh
echo "Content-type: text/html"
echo ""
cat << 'EOF'
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->

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 / pyroute_netlink_wireguard.py
Last active July 5, 2022 14:09
Test program to print out WireGuard interface config using Python pyroute2 netlink library
@artizirk
artizirk / .ls_footer
Created October 3, 2016 00:32
fancy nginx index without fancy index
@artizirk
artizirk / imx8mn.md
Created June 3, 2022 09:28
imx8mn boot cortex-m7 core without bootaux

imx8mn has an extra cortex-m7 core. you have few options for starting it

  1. use downstream imx-atf and mainline u-boot bootaux command
  2. use upstream atf and poke at the registers manually

For option 1 you can follow the AN5317 app note and things should work out fine

fatload mmc 1:1 0x48000000 hello.bin
cp.b 0x48000000 0x7e0000 $filesize
bootaux 0x7e0000
@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

@artizirk
artizirk / btrfs.md
Last active March 23, 2022 10:50
btrfs send receive with netcat nc

send

sudo btrfs send -v ro-subvol | pv | nc remote 666

pv (pipeview) will show you trasnfer speed of sending

receive

sudo nc -l 666 | sudo btrfs receive -ve ./

-e is importatnt !

@artizirk
artizirk / evdev_input_absinfo_ioctl.py
Last active February 14, 2022 11:27
Pure python way of getting and setting input_absinfo in linux kernel evdev devices https://python-evdev.readthedocs.io/en/latest/apidoc.html#evdev.device.InputDevice.absinfo
from ctypes import *
from fcntl import ioctl
# See ioctl.h of your architecture for appropriate constants here.
# This has been tested only on x86
_IOC_NRBITS = 8
_IOC_TYPEBITS = 8
_IOC_NRSHIFT = 0
_IOC_TYPESHIFT = _IOC_NRSHIFT + _IOC_NRBITS