Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
@artizirk
artizirk / clickup_api.service.ts
Created July 26, 2023 08:34
Clickup ApiService from chrome extention, includes some nondocumented API's
let ApiService = class ApiService extends ngx_oauth_client__WEBPACK_IMPORTED_MODULE_2__["NgxOAuthClient"] {
constructor(http, data, router, slimLoadingBarService) {
super(http);
this.http = http;
this.data = data;
this.router = router;
this.slimLoadingBarService = slimLoadingBarService;
this.isLoading = false;
this.showStorageErrorMsg = false;
}
@artizirk
artizirk / parse_pyvenv.zsh
Last active July 12, 2023 15:53
Parse python venv and virtualenv pyvenv.cfg with pure ZSH
#!/usr/bin/env zsh
# Parse python venv and virtualenv pyvenv.cfg with pure ZSH
#
# My usecase was to get the custom virtualenv prompt name from
# python virtualenvs created by poetry and virtualenv package.
# Builtin venv puts the prompt value also into environment variable
# called VIRTUAL_ENV_PROMPT that makes my life much easier.
# Virtualenv guys recommend to use pyvenv.cfg
# https://github.com/pypa/virtualenv/issues/2194
# https://github.com/pypa/virtualenv/issues/1968
@artizirk
artizirk / vga.dts
Created June 11, 2020 10:46
Cubietruck Allwinner A20 VGA output on mainline Armbian
/dts-v1/;
/plugin/;
/* Based on https://github.com/wens/linux/commits/sun4i-drm-tve-vga-wip */
/* Tested with Cubetruck */
/* save it somewhere and run sudo armbian-add-overlay vga.dts */
/ {
compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

systemd-nspawn container architecture

This short document will show how to turn systemd-nspawn into a usable containeration system.

Those instructions here should work under Arch Linux and Debian 10 (Buster)

Host requirements

  • systemd-nspawn and machinectl (systemd-container package under Debian)
  • dnsmasq
  • debootstrap
@artizirk
artizirk / git-instaweb.sh
Created January 22, 2019 18:57
git-instaweb with python simplehttpserver support
#!/bin/sh
#
# Copyright (c) 2006 Eric Wong
#
PERL='/usr/bin/perl'
OPTIONS_KEEPDASHDASH=
OPTIONS_STUCKLONG=
OPTIONS_SPEC="\
git instaweb [options] (--start | --stop | --restart)
@artizirk
artizirk / create_container.sh
Last active March 29, 2023 11:24
Create a debian container on a zfs pool for usage with systemd-nspawn and machinectl https://wiki.wut.ee/en/sysadmin/systemd-nspawn_containers
#!/bin/bash
set -euo pipefail
BASE="/var/lib/machines"
ZDATA="rpool/machines"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@artizirk
artizirk / dhclient_ipv6_prefix_delegation.md
Last active February 28, 2023 04:03
ISC dhclient IPv6 prefix delegation hook script https://wiki.wut.ee/en/sysadmin
@artizirk
artizirk / sendsms.sh
Last active December 3, 2022 20:41
send sms with ppp chat program
#!/bin/ash
#using: sendsms +375555555 "some text i want to send"
TELFNUMB=$1
SMSTEXT=$2
MODEM="/dev/ttyUSB1"
#reg to the network (maybe not needed)
gcom reg -d $MODEM
@artizirk
artizirk / 01-video.py
Last active November 22, 2022 11:48
Python v4l2 webcam capture test using PlayStation 3 camera. More advanced script can be found here: https://github.com/eik-robo/zoidberg/blob/master/examples/purepy_video_capture.py
#!/usr/bin/env python3
from v4l2 import *
import fcntl
import mmap
import select
import time
vd = open('/dev/video0', 'rb+', buffering=0)