adridoesthings / Opnsense config backup script

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1747499118
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 файл(-ів)
Остання активність 1747327013
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 файл(-ів)
Остання активність 1742733642
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 файл(-ів)
Остання активність 1719877040
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 / Unlimited download

0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 1719876461
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",
Новіше Пізніше