Skip to content

Instantly share code, notes, and snippets.

View artizirk's full-sized avatar

Arti Zirk artizirk

View GitHub Profile
artizirk /
Last active November 27, 2023 09:29 — forked from AmazingTurtle/
restore access to unifi controller

Restore access to a unifi controller

When you are unable to login to the unifi controller or forgot admin password, you can restore access using SSH and manipulating mongodb directly.


Do not uninstall unifi controller - most of the data is not stored in mongodb. In case you thought a mongodb backup would be sufficient, you may have fucked up already, just like me. However I managed to write this "tutorial" for anyone to not run into the same trap.

Apparently this guide no longer works with recent unifi controller versions (starting nov/dec 2022). Since I no longer use unifi hardware in my home system, I can not update the guide myself. In case you've gotten here to recover your data, you're likely doomed. But giving it a try won't hurt anyway, therefore: good luck.

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) {
this.http = http; = data;
this.router = router;
this.slimLoadingBarService = slimLoadingBarService;
this.isLoading = false;
this.showStorageErrorMsg = false;
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
artizirk /
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 /
Last active October 30, 2021 20:49
Make /bin/sh point to bash under Debian/Ubuntu
# Make /bin/sh point to bash
echo dash dash/sh boolean false | debconf-set-selections -v
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
artizirk /
Created August 2, 2021 15:49
Minimal CANOpen in plain standalone Python3 using only standard lib
"""Minimal CANOpen in plain standalone Python3 using only standard lib
This is incomplete but works well enough to read and write small Objects using SDO protocol
import ctypes
import enum
import socket
import struct
import time
artizirk / nginx.conf
Last active February 26, 2024 09:38
Nginx config for scaling matrix synapse server via workers
# Matrix Synapse workers example config
# backends
upstream synapse_master {
upstream synapse_federation {
artizirk /
Last active December 5, 2023 09:02
List SerialPort names in Windows

List COM ports in windows with names

    \Device\Serial0    REG_SZ    COM1
    \Device\Silabser0    REG_SZ    COM6
    \Device\VCP0    REG_SZ    COM3

Press any key to continue . . .
artizirk /
Created March 18, 2021 15:05
Annotate WireGuard wg command output with comments from the config file
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
function annotate {