Skip to content

Instantly share code, notes, and snippets.

View The-EDev's full-sized avatar

Farook Al-Sammarraie The-EDev

View GitHub Profile
@The-EDev
The-EDev / aci_protocol_info.md
Last active July 21, 2021 22:12
The information I've uncovered so far about how the Accu-Chek Instant meter communicates with the smart pix app and windows driver.

Analyzing the official software

150 packets were captured Packets 1-62 are to establish a connection (were made as soon as the device connected).

Packets 63-142 are for data (were made after the "read device data" button was pressed).

Packet 63 seems to be a request for the meter's information, since 2 responses later the meter dumps its metadata in ASCII format. I also suspect that this request is being used as a heartbeat signal to keep the meter on, since on linux (which has no drivers for the meter) it turned off after a few seconds.

Here's its data:

@othyn
othyn / factorio_headless_guide.md
Last active February 3, 2026 22:23
How to setup a Factorio Headless Server

[LINUX] Factorio Headless Server Guide

So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.

The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS. Although, that shouldn't matter, as long as your distro supports systemd (just for this guide, not a Factorio headless requirement, although most distros use it as standard now). The version of Factorio I shall be using is 0.14.20, although should work for any version of Factorio 0.14.12 and higher.

Just a note to newcomers: If there are any issues with the installation steps, people in the comments are doing a good job

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.

Important

  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

@alanhamlett
alanhamlett / api.py
Last active October 21, 2024 14:30
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort