Skip to content

Instantly share code, notes, and snippets.

@averne
averne / kbd_idle.py
Last active October 20, 2019 18:47
Keyboard backlight timeout script
#!/usr/bin/python3
# Needs packages python-dbus & python-gobject
# ~/scripts/kbd_idle.sh:
# !/bin/sh
# cd ~/scripts
# exec python3 kbd_idle.py &
@averne
averne / async_logger.cpp
Last active July 21, 2019 14:22
Asynchronous logger for the Switch
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <switch.h>
#include "async_logger.hpp"
Result AsyncLogger::start() {
if (is_running()) return -1;
@averne
averne / Makefile
Created April 19, 2019 08:15
VSCode Linux project
TARGET = $(notdir $(CURDIR))
EXTENSION = elf
OUT = out
RELEASE = release
DEBUG = debug
SOURCES = src
INCLUDES =
LIBS =
ARCH = -march=native -fpie
@averne
averne / color.hpp
Created April 10, 2019 17:39
C++ templates for pixel data
#pragma once
#include <cstdint>
#include <utility>
#include <type_traits>
#define ASSERT_SIZE(x, sz) static_assert(sizeof(x) == sz, "Wrong size in " #x)
#define ASSERT_STANDARD_LAYOUT(x) static_assert(std::is_standard_layout_v<x>, #x "is not standard layout")
struct rgb565_t {
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os, sys
import threading, queue
import requests
from tqdm import tqdm
BUF_SIZE = 0x1000
TIMEOUT = 3
#!/usr/bin/python3
import os, sys
import pyudev
import subprocess
import time
import shutil
import argparse
from pathlib import Path