Skip to content

Instantly share code, notes, and snippets.

View solsticedhiver's full-sized avatar

solsTiCe d'Hiver solsticedhiver

View GitHub Profile
@solsticedhiver
solsticedhiver / main.dart
Last active September 1, 2023 11:36
decadent-spray-0251
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@solsticedhiver
solsticedhiver / main.dart
Created April 21, 2023 17:33
windy-tundra-9535
import 'dart:math';
void main() {
var rng = Random();
List<List<int>> integers = List.generate(
15, (int i) => List.generate(5, (int j) => rng.nextInt(89)+10));
print(integers);
for (var L in integers) {
print(L.map((i) => [i, L.indexOf(i)]).toList());
}
@solsticedhiver
solsticedhiver / main.dart
Created April 1, 2023 12:46
fascinating-cliff-5126
import 'package:flutter/material.dart';
/*
* Tap/click the floating action button to scroll the horizontal ListView, and hover the first ListTile.
* It is hilghlighted, but the highlighted portion is shown hover/under the left vertical ListView.
*/
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@solsticedhiver
solsticedhiver / search-for-luks-header.py
Last active March 7, 2022 21:21
Script to search offset of the LUKS header on a device file
#!/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 January 31, 2019 14:30 — forked from Lahorde/0_README.md
Initialize an external I2C RTC module on raspberry using udev and systemd

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
#!/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 April 5, 2018 13:48
Python script to query Wigle.net via its API and launch a html page with result using leaflet
<!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">
#!/usr/bin/python3
import sys
import re
import os
import mailbox
def convert(maildir, mbox_name):
mbox = mailbox.mbox(mbox_name)