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 / keybase.md
Created July 17, 2017 16:14
Keybase github verification

Keybase proof

I hereby claim:

  • I am ceres-c on github.
  • I am ceresc (https://keybase.io/ceresc) on keybase.
  • I have a public key ASD8_o1ADB4ACh4_E3D0vNOwVzk-yAetJPR7mnJBXyNyPwo

To claim this, I am signing this object:

@ceres-c
ceres-c / filledShapes.c
Last active October 8, 2017 14:23
(Uni homework) Draw filled shapes on a canvas in C
#include <stdio.h>
#include <stdlib.h>
#define NUMROW 40
#define NUMCOL 40
void drawCircle (char *canvas, int r, int xCenter, int yCenter);
void drawEllipse (char *canvas, int width, int height, int xCenter, int yCenter);
void drawRhombus (char *canvas, int a, int b, int xCenter, int yCenter);
void fillEmpty (char *canvas, int nRow, int nCol);
@ceres-c
ceres-c / wpa_debug.sh
Created January 8, 2018 10:54 — forked from wch/wpa_debug.sh
Script for restarting wpa_supplicant in debug mode under Arch linux (systemd)
#!/bin/bash
# set wpa_supplicant debug level to 1, disable timestamps, disable show_keys
[ "$UID" == 0 ] || { echo "Only root can run this"; exit 0;}
LOG="/var/log/wpa_supplicant.log"
echo "Stopping NetworkManager"
systemctl stop NetworkManager
@ceres-c
ceres-c / SummerDays-2018
Last active September 26, 2018 14:02
Upcoming McDonald Italy offers
2018-07-11 - Big Mac [2€]
2018-07-12 - Confezione patatine grandi [1€]
2018-07-13 - McFlurry [1,50€]
2018-07-14 - 9 McNuggets [1,50€]
2018-07-15 - Tasty Basket [7€]
2018-07-16 - McWrap Caesar Cheese [3€]
2018-07-17 - Bibita media + Borsa Coca Cola [2€]
2018-07-18 - Le Ricche [1€]
2018-07-19 - McFlurry [1,50€]
2018-07-20 - McMenu Classic Double Cheeseburger/Double Cheeseburger BBQ [4€]
@ceres-c
ceres-c / CUEupdater.py
Created January 6, 2019 21:15
I needed a script to traverse my music collection and quickly update cuesheets with correct titles. Given all files in my collection are tagged with MusicBrainz archive, the best way to do so is reading flac files tags.
#!/usr/bin/python3
# Author: ceres-c 2019-01-06
# Updates recursively cue files to reflect track's title present in flac files.
import os
from mutagen.flac import FLAC
def cueupdater (path, cuefile):
title = None
@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 \
@ceres-c
ceres-c / MifareUltralight.bt
Last active February 4, 2020 04:15
010Editor Template for Mifare Ultralight cards
//------------------------------------------------
//--- 010 Editor v8.0 Binary Template
//
// File: MifareUltralight.bt
// Authors: ceres-c
// Version: 1.0
// Purpose: Mifare Ultralight structure parsing.
// Commonly used in tickets.
// Category: Electronics
// File Mask:
@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 / 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 / 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