This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ultra fast dump function (output like hexdump -C) | |
void hexdump(const void *data, size_t size) | |
{ | |
static const char digits[] = "0123456789abcdef"; | |
char line[80]; // we use 79 chars at most | |
size_t i; | |
int j; | |
for (i = 0; i < size; i += 16) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:edge AS toilet-builder | |
RUN apk update && apk add gcc musl-dev make curl unzip findutils fdupes | |
WORKDIR /build | |
# figlet | |
RUN curl -skL -o figlet-master.zip https://github.com/cmatsuoka/figlet/archive/refs/heads/master.zip && \ | |
unzip -q -o figlet-master.zip && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "hello" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
[[bin]] | |
name = "hello" | |
path = "hello.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/echo must be source: | |
# bash debugger | |
# Rene Devichi. https://unlicense.org | |
# Usage: `source bashdb.db` at the beginning of your script | |
# Inline version: | |
# curl -sL -o /tmp/bashdb.sh https://gist.github.com/rene-d/fd2d2c37dfc1371255818d73f7b5f1db/raw/bashdb.sh | |
# trap "rm -f /tmp/bashdb.sh" EXIT | |
# . /tmp/bashdb.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias eject="diskutil list | sed -nr '/external, physical/s,^/dev/disk([0-9]+) .*,\1,p' | xargs -I+ diskutil eject /dev/rdisk+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://en.wikipedia.org/wiki/ANSI_escape_code | |
print_colors() | |
{ | |
# Print column headers. | |
printf "%-4s " '' ${bgs[@]} | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def chiffres(i): | |
return i // 100, (i // 10) % 10, i % 10 | |
def bad(a, b, place, desordre, absent): | |
aa = a | |
a = chiffres(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:7 AS builder | |
RUN yum -y install gcc clang cmake automake python3-pip make git gcc-c++ vim glibc-static | |
RUN pip3 install meson ninja | |
WORKDIR /src | |
RUN git clone -b fuse-3.6.1 https://github.com/libfuse/libfuse && \ | |
cd libfuse && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# rene-d 2020/07/23 | |
from sys import argv | |
import operator | |
from PIL import Image, ImageDraw, ImageFont | |
import numpy as np | |
# import csv | |
import argparse |