git clone https://gist.github.com/6322759.git autosshd
cd autosshd
sudo ./install
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 | |
"""Implementation of exponential rate limiter from <https://dotat.at/@/2024-09-02-ewma.html>, | |
but using a single variable `next-time` to store the state.""" | |
import time | |
import math | |
class RateLimiter: | |
def __init__(self, window, limit): | |
self.next_time = 0.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 function reduces harsh blue tones in RGB LED lights, bringing | |
// them closer to the look of retro tinted incandescent bulbs. | |
// | |
// All input colors to the christmas_light_fixer() function are multiplied | |
// by a LUT of a warm white, reducing the power of the blue spectrum while | |
// preserving the brightness of the yellow spectrum. | |
CRGB christmas_light_fixer( CRGB input_color ){ | |
CRGB incandescent_lookup = CRGB( 255, 113, 40 ); | |
CRGB out_color = input_color; |
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
// cc $(pkg-config --cflags --libs libudev) udev_find_serial_by_vid_pid.c -o udev_find_serial_by_vid_pid | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <libudev.h> | |
int main(int argc, char **argv) | |
{ | |
if (argc != 3) { |
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
import logging | |
import asyncio | |
from aramanth import * | |
from ....support.endpoint import * | |
from ....gateware.pads import * | |
from ....gateware.pll import * | |
from ... import * | |
class VideoIkea2WireSubtarget(Elaboratable): |
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
... | |
# Fake a fuse install | |
RUN apt-get install libfuse2 | |
RUN cd /tmp ; apt-get download fuse | |
RUN cd /tmp ; dpkg-deb -x fuse_* . | |
RUN cd /tmp ; dpkg-deb -e fuse_* | |
RUN cd /tmp ; rm fuse_*.deb | |
RUN cd /tmp ; echo -en '#!/bin/bash\nexit 0\n' > DEBIAN/postinst | |
RUN cd /tmp ; dpkg-deb -b . /fuse.deb |
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
class bbb($bbb_hostname = $fqdn, $salt = "d34db33fba5eba11f01dab1e5ca1ab1e") { | |
exec { "dist upgrade": | |
refreshonly => true, | |
command => "/usr/bin/apt-get dist-upgrade", | |
} | |
exec { "update and dist upgrade": | |
refreshonly => true, | |
command => "/usr/bin/apt-get update", | |
notify => Exec["dist upgrade"], | |
} |
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
class nodejs { | |
Package { ensure => "installed" } | |
$pkglist = [ "python-software-properties" ] | |
package { $pkglist: } | |
$apt-base = "/etc/sources.list.d/chris-lea" | |
Exec { require => package["python-software-properties"] } |