Skip to content

Instantly share code, notes, and snippets.

View ceres-c's full-sized avatar

Federico Cerutti ceres-c

View GitHub Profile
@ceres-c
ceres-c / Dockerfile
Created March 16, 2024 01:09
Build environment for osresearch/spispy
from ubuntu:22.04
ADD yosys.patch /root/yosys.patch
ADD prjtrellis.patch /root/prjtrellis.patch
ADD nextpnr.patch /root/nextpnr.patch
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt upgrade -y && apt install -y build-essential=12.9ubuntu3 \
cmake=3.22.1-1ubuntu1.22.04.2 clang=1:14.0-55~exp2 bison=2:3.8.2+dfsg-1build1 \
flex=2.6.4-8build2 libreadline-dev=8.1.2-1 gawk=1:5.1.0-1build3 \
@ceres-c
ceres-c / README.md
Last active June 27, 2023 23:19
MHT-P29L thermal printer CUPS config

MHT-P29L

This is a rather hacky thing I used to get my cheap chinese thermal printer to work with CUPS on linux.

Dependency

Build and install this CUPS filter https://github.com/klirichek/zj-58

Install

Copy p29l.ppd to /usr/share/cups/model/zjiang/p29l.ppd

The driver can be found in CUPS list as: Milestone > Hiker MHT-P29L

@ceres-c
ceres-c / Dockerfile
Last active November 1, 2022 11:02
Simple dockerfile to run vscode in a container
FROM greyltc/archlinux-aur:latest
ARG VSCODE_USER="user"
ARG VSCODE_PASS="password"
RUN pacman -Sy --noconfirm openssh alsa-lib jdk11-openjdk tmux sshfs zsh nano noto-fonts noto-fonts-emoji ttf-linux-libertine
RUN aur-install visual-studio-code-bin burpsuite-pro
RUN useradd "$VSCODE_USER" --system --create-home
RUN echo "$VSCODE_USER:$VSCODE_PASS" | chpasswd
@ceres-c
ceres-c / BLE_dual_boot_info.md
Created January 8, 2022 00:36
Magic Trackpad 2 dual boot BLE key sharing
chntpw -e /media/windows/Windows/System32/config/SYSTEM

in chntpw:

cd ControlSet001\Services\BTHPORT\Parameters\Keys\{computer-bluetooth-mac}
hex {device-bluetooth-id}

Take the output of the hexdump, remove spaces and insert as-is in

@ceres-c
ceres-c / info.md
Last active November 24, 2021 17:50
A mkinitcpio hook to fix e1000e network driver issues with WoL packets on startup

The X230 I use for playing with Coreboot has a Intel Corporation 82579LM ethernet card with WoL support. Problem is, when the laptop is woken up via a WoL packet, the e1000e driver in linux is not able to bring up the network card correctly.

As highlighted on this Arch forums post, the problem can be solved resetting the PCI device before the driver is loaded. This mkinitcpio hook does exactly that if you add reset-e1000e as the first hook in your HOOKS list. Don't forget to rebuild your initrd.

@ceres-c
ceres-c / mlol_audiobook_downloader.py
Last active November 21, 2021 14:14
MediaLibraryOnline audiobook downloader - Download stream-only audiobooks
#! /bin/python3
import os
from urllib.parse import unquote
import httpx
import lxml.html
unit_id = 100009140 # Numeric unit id, can be found in URL as "id" parameter
cookies = {'ASP.NET_SessionId': ''} # Alphanumeric cookie
@ceres-c
ceres-c / WPAD_kill.md
Last active December 10, 2021 05:57
Personal reminder on how to kill WPAD service

Disabling WPAD

WPAD is the Windows Proxy Auto Discovery service, used since Windows 95, IIRC, to automatically discover network configurations. Since Windows 10 Microsoft decided for some reason that users shall NOT be allowed to disable this (mostly) useless and problematic service.

Can't disable WPAD service

Problem is: on my laptop this feature used up to 20% of the CPU while doing nothing at all due to some bug I don't want to dig into. The best part is that it often triggered after disconnection from a wireless network. Discovering proxies makes lot of sense once you are NOT connected to any network, huh? Also, there were multiple vulnerabilities related to this service and cute tools such as Responder leverage on it.

Killing WPAD

The service can still be disabled writing in the registry, but it will be randomly re-enabled by windows after upda

@ceres-c
ceres-c / twitter-register.py
Created November 1, 2020 19:26
Attempt at registering Twitter accounts with Python Requests. NOT working.
#! /bin/python
import json
import random
import re
import string
import time
import urllib.parse
from threading import Thread
from time import sleep, time_ns
@ceres-c
ceres-c / CR95HF_ICODE_psw_dump.py
Created December 31, 2019 12:54
CR95HF Python script to read NXP ICODE tags in privacy mode
#!/usr/bin/python3
# Author: ceres-c 2019-12-29
# Authenticate to ICODE SLI tags
import hid
# Global defines & commands
password = [0x00, 0x00, 0x00, 0x00] # You have to find it yourself, try to search online in german ;-)
@ceres-c
ceres-c / Dockerfile
Last active January 28, 2019 15:34
Dockerfile to create a welcoming environment on top of base/devel arch image
FROM base/devel:latest
MAINTAINER federico@ceres-c.it
# update system
RUN \
pacman -Syyu --noconfirm
# install basic dependencies
RUN \