Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Manna kylemanna

View GitHub Profile
@kylemanna
kylemanna / android-ca-cert-hash.sh
Last active Jan 22, 2022
Generate hash file name for Root CAs on Android. Handy for things like mitmproxy.
View android-ca-cert-hash.sh
CERT=$1
NAME=$(openssl x509 -in $HOME/.mitmproxy/mitmproxy-ca-cert.cer -subject_hash_old -noout)
cp ${CERT} ${OUT}/system/etc/security/cacerts/${NAME}.0
@kylemanna
kylemanna / arch-linux-install.md
Last active Jan 17, 2022 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
View arch-linux-install.md
@kylemanna
kylemanna / list-non-dependent-pkgs-by-size.sh
Last active Jan 15, 2022
Arch Linux: List packages installed without a dependency sorted by size
View list-non-dependent-pkgs-by-size.sh
#!/bin/bash
pacman -Qi | awk '/^Name/{name=$3} /^Required By/{req=$4} /^Installed Size/{print $4$5, name, req}' | grep None | sort -h
@kylemanna
kylemanna / 7z+tar.md
Last active Jan 10, 2022
Archive with tar + 7z + max compression
View 7z+tar.md

Overview

7-zip doesn't preserve the Linux/Unix owner/group of files and possibly other details. Use tar instead because it's designed to preserve these things, then just 7zip the tar archive.

Create the archive

tar cf - --exclude=\*.o -v directory | 7z a -si -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on directory.tar.7z
@kylemanna
kylemanna / README-python-service-on-systemd-activated-socket.md
Last active Jan 6, 2022 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation
View README-python-service-on-systemd-activated-socket.md

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at ~/tmp/foo/serve.py.

View AuthyToOtherAuthenticator.md

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@kylemanna
kylemanna / connmanctl.md
Last active Nov 14, 2021
Connmanctl Cheat Sheet
View connmanctl.md
@kylemanna
kylemanna / 0001-release-python-logfury-v1.0.1.patch
Last active Nov 13, 2021
Arch User Repository AUR Update for python-logfury
View 0001-release-python-logfury-v1.0.1.patch
From 94f64148ce295a4ba7b96e539f8f82798697fa71 Mon Sep 17 00:00:00 2001
From: Kyle Manna <kyle@kylemanna.com>
Date: Fri, 12 Nov 2021 20:03:13 -0600
Subject: [PATCH] release: python-logfury: v1.0.1
* Follow upstream.
* Use new git repo, old URL redirects.
* Use PyPI so pkg metadata is included.
* Update license file.
* Add test checks.
@kylemanna
kylemanna / failure-monitor.py
Last active Nov 10, 2021
@see kylemanna/systemd-utils
View failure-monitor.py
#!/usr/bin/env python
import os
import re
import sys
import json
import stat
import smtplib
import socket
import subprocess
@kylemanna
kylemanna / 0001-ufw-Initial-firewall-config-on-OpenVZ-VPS.patch
Created Jun 29, 2013
Approximate patch to make ufw work under OpenVZ with kernel 2.6.32-042stab078.26
View 0001-ufw-Initial-firewall-config-on-OpenVZ-VPS.patch
From eccc80a754273641c2e0532be98987c8e89e960e Mon Sep 17 00:00:00 2001
From: root <root@nexus.frozenliquid.net>
Date: Fri, 28 Jun 2013 20:38:12 +0400
Subject: [PATCH] ufw: Initial firewall config on OpenVZ VPS
* OpenVZ vps doesn't have all the kernel features needed by
Ubuntu 12.04 LTS, disable unsupported features so firewall
starts cleanly.
---
default/ufw | 4 ++--