Skip to content

Instantly share code, notes, and snippets.

View speters's full-sized avatar

Sönke J. Peters speters

View GitHub Profile
@mqu
mqu / rvitalk.rb
Last active December 30, 2018 10:14
rvitalk : ruby P300 protocol implementation to handle IO to Viessmann heating systems - outdated : please have a look at : https://github.com/mqu/viessmann-mqtt/
#!/usr/bin/ruby
# encoding: utf-8
# author : Marc Quinton, april 2015
# name : rvitalk : ruby P300 protocol implementation to handle IO to Viessmann heating systems
# object : connect to a Viessmann heating system via Optolink adaptator to query internal values.
# version : 0.5 - added write mode for commands, P300 constants,
# requirements : ruby >= 2.1, ruby-serialport, a serial USB optolink adapter, a Viessman heating system.
# licence : MIT
# links : http://openv.wikispaces.com/vcontrold ; https://gist.github.com/mqu
@petedoyle
petedoyle / gist:4129668
Last active January 29, 2021 08:19
Notes: OpenWRT / Codel on TL-WDR4300

Overview

I'm tired of massive delay (500-1000 ms pings) while uploading large files. QoS helps some, but a significant portion remains due to bufferbloat (100-150ms). This leads to delay in VoIP calls and generally sluggish web browsing while uploading.

The new Codel algorithm in OpenWRT / Attitude Adjustment should help a lot. The results below show only ~5-6ms of added latency during uploads (i.e. 14ms vs 500+ms before!). Insane.

These instructions are for the TP-Link TL-WDR4300, because I got a good deal. If you have the money, buy a Netgear WNDR3800 and install CeroWRT, you'll probably see even better results.

Why the TP-Link TL-WDR4300

In short, its fully supported in OpenWRT Attitude Adjustment and works well for my needs:

  • Cheap
/*
step.c
Program to verify new algorithm for linear acceleration.
Author: Pramod Ranade <pramod.ranade@spjsystems.com>
*/
#include <stdio.h>
#include <io.h>
#include <stdlib.h>
@sasa1977
sasa1977 / xmerl_demo.ex
Last active July 26, 2023 10:07
Simple xmerl usage demo in Elixir
defmodule XmlNode do
require Record
Record.defrecord :xmlAttribute, Record.extract(:xmlAttribute, from_lib: "xmerl/include/xmerl.hrl")
Record.defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl")
def from_string(xml_string, options \\ [quiet: true]) do
{doc, []} =
xml_string
|> :binary.bin_to_list
|> :xmerl_scan.string(options)
@four0four
four0four / 01-zynq-uart.md
Last active September 16, 2023 03:02
Zynq BootROM Secrets - UART loader

Zynq BootROM Secrets: UART loader

Recently I acquired (md5: ADF639AFE9855EE86C8FAAD216C970D9) the Zynq bootrom, and during the reversing process uncovered some interesting secrets, one of which is an as-of-yet undocumented UART loader. As documented the Zynq bootrom will load from NOR/NAND/SPI flashes, eMMC/SDIO-based storage (unfortunately) not USB, or anything else more complex.

Not sure why Xilinx didn't document this. In my brief testing it is super unreliable if you just spit everything at once - they reset the RX/TX paths during the process, so timing is critical, but that might be the janky meter-long ftdi cable. You can change the baudrate during the process, but I was too lazy to do the math.

Here's the disassembly that made me look twice (that, and checks for the MIO boot_mode[2:0] that weren't specified in the docs :)):

ROM:0000A220 BL              uart_init
@wd5gnr
wd5gnr / customprintf.c
Created October 3, 2023 16:32
Example of custom printf specifier
#include <stdio.h>
#include <stdlib.h>
#include <printf.h>
static int print_coin (FILE *stream,
const struct printf_info *info,
const void *const *args)
{
@mario52a
mario52a / FCInfo_en_Ver_1-28c-rmu_Docked.FCMacro
Last active April 17, 2024 12:47
Gives a series of informations about the selected shape and can display a conversion of length, inclination (degrees, radians, grades, pourcent) shape, surface, volume and the weight of the form in the density selected in different units of quantities international and Anglo-Saxon. (English version)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
***************************************************************************
* Copyright (c) <mario52> 2014 2015 2016 2017 2018 2019 2020 2021 2022 *
* 2023 *
* This file is a supplement to the FreeCAD CAx development system. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License (LGPL) *
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@shamil
shamil / mount_qcow2.md
Last active April 25, 2024 09:25
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8