Skip to content

Instantly share code, notes, and snippets.

View mathis-m's full-sized avatar
💻
coding

Mahtis Michel mathis-m

💻
coding
  • Avanade
  • Stuttgart, Germany
View GitHub Profile
@mathis-m
mathis-m / App.tsx
Created October 16, 2023 21:36
Tree Renderer - with conncetions
import "./styles.css";
import React, { FC } from "react";
interface INode {
text: string;
children: INode[];
}
const Row: FC<{
node: INode;
@mathis-m
mathis-m / test.sh
Created December 4, 2022 19:10
rm fails in userns overlay fs
lower=$PWD/test/lower
upper=$PWD/test/upper
merged=$PWD/test/merged
work=$PWD/test/work
mkdir -p $lower/a $lower/b $upper $merged $work
uname -a | tee $lower/a/a
mount -t overlay -o rw,relatime,lowerdir=$lower,upperdir=$upper,workdir=$work,userxattr overlay $merged
#!/bin/bash
# Taken from github.com/rootless-containers/usernetes and modified
# License: https://github.com/rootless-containers/usernetes/blob/master/LICENSE
set -euo pipefail
function log::debug() {
echo -e "\e[102m\e[97m[DEBUG]\e[49m\e[39m $@"
}
@mathis-m
mathis-m / blink-simple.s
Last active April 10, 2023 11:43
Blinking LED - Assembly ARM 32bit - Raspberry Pi4
#define _CRT_SECURE_NO_WARNINGS
#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <stdbool.h>
#include <fcntl.h>
#include <time.h>
https://tio.run/##3Vhtb9s2EP48/wrWRQY5URxZ61qgqQMsaTYUaNOiSdEPbRHIFGUT0YsrUXaawP9s3/bDsjuSsimJMpKtKIa5RSQdqXt5@NwdRbo/pfTu7nHIIp4ycnny/uLy/PTkw/vTy7O3lx9/e3/26uyP895jntK4DBl5Uaa8EOFwdmTIQMCzlijmk4bsW3EgeMJaMydZFqOwF2blJGZkysRLHkUsZyllF/DG2@hl8M0pRF5SQVDFIojJ7oRNeeqSppil4YDc9gj8cibKPCWOA7L9I7G4LBgl@0S@WD0PyJ4xoWzOQMHgwBl5njf0dtVlMBgc9la9Hk8FSQKeOngT5FPqEjoLcrIL94tPXyovDg4wIpxQJiwVBZkHRcFCOYahE16cFAsyJoHIuCPfHX0BC@vxOJteZCdZWmQAjjnNr6ahAzQr4a85/AsOy/HfX70@JbsRjJ59eP360JT5NSGPnLq1MYmCuGBVLDqeAoCdk4jDjBkLQpYXxEkyWM4lGR8p@ZLnIfnrzwmM0VnO2YSlg7UK9CTK5ix1@jkrylgMabHou6S/7OuIlDPEidAF9G/z8sYT/M1zCD5y@qd5nuUEdfJ0Kl149Dk1teGPXXPhjAzhauOSVhSBFzuFK/@DAng65zcMry/LnM6KQNzgw0UmgGxITtNGROOsYE5U4S5lfjNYvzta/4eH61fx1oPtiszXshVhQIs6K6RKIoKJQQueAjEll4xAHc34MYHcZQN7hA9dhE1s6Nlt9dCh@7P4LMjm8iAbq16V1xGsweipS54@cYn/K9wMh0MQvDmWE3DUKdOCT1MWQhbDQhVgAugwenqobl/g/bNnz/y1ZHdMnpjZhpDO@ZxFIaQ7vHrrrQ4tg8cBveqYwF0CZTLZCFWRmpSRReRvZPAE6pIgjjPqoG@D2pjfOajLeDJ5x/JzlwhEEAG8CK5YamQGMl4a0ZRvUp0hx52@MtLktq7tI5PcJhlPchYIRt4F0EWEfzLjcUjeAVQ164idowAcoB
#define _CRT_SECURE_NO_WARNINGS
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <stdbool.h>
double getDifferenceTimeOfDay(struct timeval *begin, struct timeval *end) {
return ((end->tv_sec - begin->tv_sec) + ((end->tv_usec - begin->tv_usec)/(1000.0*1000.0)));
}
#define _CRT_SECURE_NO_WARNINGS
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <stdbool.h>
double getDifferenceTimeOfDay(struct timeval *begin, struct timeval *end) {
return ((end->tv_sec - begin->tv_sec) + ((end->tv_usec - begin->tv_usec)/(1000.0*1000.0)));
}
https://cdn.discordapp.com/attachments/824936816100114514/933137448756715590/8d7b420a-5bf1-4800-8265-fe08999ce356.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.