Skip to content

Instantly share code, notes, and snippets.

Avatar

Arti Zirk artizirk

View GitHub Profile
@artizirk
artizirk / imx8mn.md
Created Jun 3, 2022
imx8mn boot cortex-m7 core without bootaux
View imx8mn.md

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 / dash_to_bash.sh
Last active Oct 30, 2021
Make /bin/sh point to bash under Debian/Ubuntu
View dash_to_bash.sh
#!/bin/sh
# Make /bin/sh point to bash
echo dash dash/sh boolean false | debconf-set-selections -v
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
@artizirk
artizirk / standalone_canopen.py
Created Aug 2, 2021
Minimal CANOpen in plain standalone Python3 using only standard lib
View standalone_canopen.py
#!/usr/bin/python3
"""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
artizirk / nginx.conf
Created Jun 22, 2021
Nginx config for scaling matrix synapse server via workers
View nginx.conf
# Matrix Synapse workers example config
# backends
upstream synapse_master {
server 192.19.18.12:38008;
}
upstream synapse_federation {
server 192.19.18.12:8083;
}
@artizirk
artizirk / 0README.md
Last active Sep 9, 2021
List SerialPort names in Windows
View 0README.md

List COM ports in windows with names

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
    \Device\Serial0    REG_SZ    COM1
    \Device\Silabser0    REG_SZ    COM6
    \Device\VCP0    REG_SZ    COM3

Press any key to continue . . .
@artizirk
artizirk / annnotate.sh
Created Mar 18, 2021
Annotate WireGuard wg command output with comments from the config file
View annnotate.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
function annotate {
declare -A PEER_COMMENTS
@artizirk
artizirk / watchdog.py
Created Feb 25, 2021
a stupid watch dog
View watchdog.py
#!/usr/bin/env python3
"""
run this to keep the watchdog happy
curl localhost:8080
or from js
setInterval(function(){ fetch("localhost:8080"); }, 3000);
@artizirk
artizirk / crack_gpg_password.py
Created Feb 18, 2021
Try to import password protected gnupg openpgp by using passwords from csv file
View crack_gpg_password.py
#!/usr/bin/env python3
## Try all of the passwords for gpg openpgp key
from subprocess import run
p = open("/tmp/passwords.csv")
passwords = set()
for line in p.readlines():
passwords.add(line.split(",")[2].strip().replace('"',''))
for password in passwords:
print(password)
@artizirk
artizirk / crack_ssh_password.py
Created Feb 18, 2021
Try bunch of passwords from csv list on a password protected ssh key
View crack_ssh_password.py
#!/usr/bin/env python3
from pprint import pprint
from subprocess import run
passwords = set()
with open("/tmp/passwords.csv") as f:
for line in f.readlines():
passwords.add(line.split(',')[2].strip().strip('"'))
for password in passwords: