adridoesthings / Restic search through multiple Snapshots
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 2 weeks ago
A python script to search through multiple (or all) snapshots of restic for a specified path
| 1 | #!/usr/bin/env python3 |
| 2 | import sys |
| 3 | from argparse import ArgumentParser |
| 4 | from json import loads |
| 5 | from pathlib import Path |
| 6 | from subprocess import PIPE, Popen |
| 7 | from sys import stderr |
| 8 | from typing import TypedDict |
| 9 | |
| 10 | parser = ArgumentParser(prog="restic-search") |
adridoesthings / sieve of eratosthenes
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
| 1 | #include <stdint.h> |
| 2 | #include <stddef.h> |
| 3 | #include <stdlib.h> |
| 4 | #include <stdio.h> |
| 5 | #include <signal.h> |
| 6 | #include <math.h> |
| 7 | #include <string.h> |
| 8 | |
| 9 | #define ARRAY_DEFAULT_CAPACITY 8 |
adridoesthings / BC100 Fahrgastrechte
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
| 1 | import pandas as pd |
| 2 | import re |
| 3 | |
| 4 | from datetime import datetime, date, timedelta |
| 5 | |
| 6 | BC_START_DATE = date(2025, 3, 6) |
| 7 | FGR_AVERAGE_PROCESSING_TIME = timedelta(days=5) |
| 8 | PRICE = 2988.00 |
| 9 | FILENAME = "Transaktionen.csv" |
adridoesthings / Opnsense config backup script
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
An opnsense config backup script which gzip's the config file and encrypts it with gpg. Just change the first variables to your configuration specific. Then you can run this script with cronjob for example.
| 1 | #!/bin/bash |
| 2 | set -eeuo pipefail |
| 3 | |
| 4 | # your configuration constants |
| 5 | # generate key and secret on /ui/auth/user |
| 6 | OPNSENSE_URL="https://opnsense.yournetwork.lan" |
| 7 | OPNSENSE_KEY="" |
| 8 | OPNSENSE_SECRET="" |
| 9 | GPG_RECIPIENT="" |
| 10 | BACKUP_DESTINATION="./backups" |
adridoesthings / Traffic light written in Verilog
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
Disclaimer: I don't speak Verilog, actually I speak VHDL
| 1 | module top ( |
| 2 | input clk, |
| 3 | input rst, |
| 4 | output reg red, |
| 5 | output reg yellow, |
| 6 | output reg green |
| 7 | ); |
| 8 | |
| 9 | localparam CLK_CYCLES_PER_SECOND = 27000000; |
adridoesthings / Homeassistant Unifi AP Led Configuration
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
Toggle your unifi access point led with homeassistant. Create a homeassistant helper (toggle) named input_boolean.unifi_ap_led for example and create an automation that runs this shell script when the state of the helper toggle changes. Place your id_ed25519 key in config/.ssh/id_ed25519.
| 1 | shell_command: |
| 2 | unifi_ap_led_update: ssh -o StrictHostKeyChecking=no USERNAME@UNIFI_AP_IP -i ./.ssh/id_ed25519 "sed -i 's/^mgmt\.led_enabled=.*/mgmt\.led_enabled={% if is_state("input_boolean.unifi_ap_led", "on") %}true{% else %}false{% endif %}/' /var/etc/persistent/cfg/mgmt && echo {% if is_state("input_boolean.unifi_ap_led", "on") %}1{% else %}0{% endif %} > /proc/gpio/led_pattern" |
adridoesthings / Follow
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
This program will print the content of a file and then waits for a change of the file and prints the added content.
| 1 | /* |
| 2 | * This program will print the content of a file and then waits for a change of the file and prints the added content. |
| 3 | * Author: AdriDoesThings <adri@adridoesthings.com> |
| 4 | */ |
| 5 | |
| 6 | #include <stdint.h> |
| 7 | #include <stdio.h> |
| 8 | #include <stdlib.h> |
| 9 | #include <string.h> |
| 10 | #include <unistd.h> |
adridoesthings / ZFind
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
Find a pattern in a file, print the content of the file and mark the position of the pattern (if found)
| 1 | const std = @import("std"); |
| 2 | |
| 3 | const COLOR_RED = "\x1b[0;31m"; |
| 4 | const COLOR_RESET = "\x1b[0m"; |
| 5 | |
| 6 | fn print_usage(exec: [*:0]u8) void { |
| 7 | std.debug.print("Usage: {s} FILE PATTERN\n", .{exec}); |
| 8 | } |
| 9 | |
| 10 | fn string_contains_substring(allocator: std.mem.Allocator, string: []u8, substring: []u8) !std.ArrayList([2]usize) { |
adridoesthings / Unlimited download
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1 month ago
This is a http server that serves a infinitely big file filled with random content
| 1 | const std = @import("std"); |
| 2 | const eql = std.mem.eql; |
| 3 | |
| 4 | pub const std_options = .{ |
| 5 | .log_level = .info, |
| 6 | }; |
| 7 | |
| 8 | fn http_error(writer: std.net.Stream.Writer, status_code: u16) !void { |
| 9 | const status = switch (status_code) { |
| 10 | 200 => "OK", |
Новіше
Пізніше