Skip to content

Instantly share code, notes, and snippets.

Avatar

solsTiCe d'Hiver solsticedhiver

View GitHub Profile
@solsticedhiver
solsticedhiver / search-for-luks-header.py
Last active Mar 5, 2020
Script to search offset of the LUKS header on a device file
View search-for-luks-header.py
#!/usr/bin/env python3
import threading
import queue
import argparse
import os.path
import sys
NUM_WORKER_THREADS = 16
LUKS_HEADER = b'LUKS\xba\xbe'
@solsticedhiver
solsticedhiver / 0_README.md
Created Jan 31, 2019 — forked from Lahorde/0_README.md
Initialize an external I2C RTC module on raspberry using udev and systemd
View 0_README.md

Description

Enable i2c RTC using systemd. A udev rules triggers an I2C systemd service on I2C kernel module adding. Service then loads I2C driver adding a new I2C device to /sys Then kernel loads I2C RTC driver and adds an RTC device It triggers a udev rules that updates hardware clock

Application on raspberry pi

Enable I2C

  • enable I2C in config.txt, adding device_tree_param=i2c1=on
View killsnaps.sh
#!/bin/bash
set -e
export IFS='
'
# that's a dangerous script to run because it removes all your snaps. Don't do that
function echo_cmd() {
echo "$@"
#$@
}
@solsticedhiver
solsticedhiver / search.html
Created Apr 5, 2018
Python script to query Wigle.net via its API and launch a html page with result using leaflet
View search.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>padv</title>
<meta name='description' content="A page showing results from wigle.net API">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css">
View maildir2mbox.py
#!/usr/bin/python3
import sys
import re
import os
import mailbox
def convert(maildir, mbox_name):
mbox = mailbox.mbox(mbox_name)
You can’t perform that action at this time.