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
using Microsoft.Data.Entity; | |
namespace ConsoleApp1 | |
{ | |
public class MyContext : DbContext | |
{ | |
public DbSet<Address> Addresses { get; set; } | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ |
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
using Microsoft.Data.Entity; | |
namespace ConsoleApp1 | |
{ | |
public class MyContext : DbContext | |
{ | |
public DbSet<Address> Addresses { get; set; } | |
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | |
{ |
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 | |
# hcloud-failover.py | |
# Inspired by https://github.com/lehuizi/hcloud-failover-keepalived | |
# This script is to be called from keepalived on the notify action | |
# and causes the alias IPs to be updated for the configured network, | |
# possibly promoting a current backup to master. | |
# The arguments are | |
# = Type ("GROUP" or "INSTANCE") | |
# = Name of group or instance | |
# = Target state of transition ("MASTER", "BACKUP", "FAULT") |
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 | |
# hcloud-access.py | |
# Example: ./hcloud-access.py assign-key hcloud-ssh-key-name -u username server1 server2 | |
import os | |
import requests | |
import sys | |
import argparse | |
import toml | |
import pwd |
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
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCaH3UEgw8l3nwivmwfVbuv+COU/zNIAYEAu4XBSbcm rmj@DESKTOP-5VE6KMP |
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
internal readonly record struct Lz4BlockInfo(byte[] BlockBuffer, int BlockLength, bool Compressed, uint? BlockChecksum = null) | |
{ | |
public Span<byte> Span => BlockBuffer.AsSpan(0, BlockLength); | |
public bool IsCompleted => BlockLength != 0; | |
} |
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
// This program runs on the Arduino Uno Rev. 3 on the paddle and tennis court gates at Vesterø Boldklub. | |
// It controls the N10001ST electromagnetic lock (http://www.gianni.com.tw/Waterproof_Series.html) | |
// It supports two channels such that two doors (A and B) can be individually controlled from one arduino. | |
#define GATE_HOLD_MS 4000 // The time (in milliseconds) it takes from opening the gate until it is closed again | |
#define KEYPAD_GATE_ID GATE_A // The gate where the keypad is located | |
#define KEYPAD_STATE_PIN A0 // The input pin where the keypad state is sampled | |
#define KEYPAD_LOCK_PIN 12 // The output pin where the keypad lock signal is sent. | |
#define KEYPAD_HOLD_MS 3000 // The time (in milliseconds) it takes from opening the gate until the keypad is signalled to reverse the lock | |
#define KEYPAD_PULSE_MS 2000 // The lock pulse duration in mulliseconds | |
#define KEYPAD_ROTATION_MS 2000 // The lock pulse duration in mulliseconds |