Skip to content

Instantly share code, notes, and snippets.

@D4koon
D4koon / xmlTreeview.py
Created April 14, 2020 08:38
Python XML-Treeview
#-*- encoding: utf8 -*-
# Call with "python parseXML.py test.xml"
# Tested with Python 3.5
from tkinter import *
from tkinter.ttk import Treeview
import xml.etree.ElementTree as ET
class App:
@bradfa
bradfa / pgp-bootable-usb-flash-drive.md
Last active April 18, 2025 14:45
PGP Bootable USB Flash Drive

PGP Bootable USB Flash Drive Creation and Operation

Create a bootable USB flash drive for generating and managing PGP keys. The keys will be generated and stored, encrypted, on the drive but then also transferred to Yubikeys for general use. Unless a Yubikey is lost or damaged, use of the flash drive should be extremely limited, if it is used at all.

A master certifying and signing (CS) key will be created, then sub-key signing (S), encrypting (E), and authenticating (A) keys will be created and signed by the C key. The C key will be archived with a password to the flash drive as well as transferred to a Yubikey 4. The SE&A sub keys will also be archived to the flash drive as part of the C key

@David-Lor
David-Lor / MQTTSubscribe.sh
Created July 11, 2019 12:29
Shell Script to subscribe to MQTT and execute a callback
#!/bin/bash
# This script subscribes to a MQTT topic using mosquitto_sub.
# On each message received, you can execute whatever you want.
while true # Keep an infinite loop to reconnect when connection lost/broker unavailable
do
mosquitto_sub -h "127.0.0.1" -t "test" | while read -r payload
do
# Here is the callback to execute whenever you receive a message:
@extremecoders-re
extremecoders-re / openwrt-qemu.md
Last active April 25, 2025 20:47
Running OpenWRT ARM under QEMU

Environment

The steps shown below are done on a Ubuntu VM using Qemu 3.0

$ qemu-system-arm -version
QEMU emulator version 3.0.0
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

To quit Qemu at any time press Ctrl+a x, i.e. Ctrl+a and then x

@xujiaao
xujiaao / android-set-ntp-server.md
Last active May 4, 2025 12:55
Set the NTP server of your android device
tags
Android
Android Things

Set the NTP server of your android device

@alexniver
alexniver / golang, ubuntu go get in china.md
Last active April 26, 2023 11:15
ubuntu下, 使用shadowsock和Privoxy帮助你在命令行中, 无障碍进行go get

#前言 由于大家都懂的, 国内使用go get的时候, 经常会各种失败, 如果有vpn的话, 打开vpn, 问题就解决了, 但vpn其实挺不灵活的.

相对来说shadowsock则灵活得多.

#解决方案 shadowsock + Privoxy

思路就是, 使用shadowsock建立一个本地sock5代理, 但因为go get 需要http代理, 所以需要使用privoxy把sock5代理转为http代理.

@DraTeots
DraTeots / ComPort over Network.md
Last active May 18, 2025 05:12
ComPort over Network
@raelgc
raelgc / Email Server (Linux, Unix, Mac).md
Last active April 21, 2025 14:46
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@schoentoon
schoentoon / inotify.c
Last active February 27, 2024 22:13
Simple example of how to use inotify with libevent. Compile with gcc -o inotify inotify.c -levent
#include <stdio.h>
#include <event.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <sys/inotify.h>
static void displayInotifyEvent(struct inotify_event *i)
{
printf(" wd =%2d; ", i->wd);