Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Unofficial CLI tool to control FNIRSI Power Source (DC580, DC6006L, ...)
See Also:
- https://github.com/jcheger/fnirsi-dc580-protocol
"""
import sys
import os
#!/usr/bin/env python3
"""
Unofficial CLI tool to control FNIRSI Power Source (DC580, DC6006L, ...)
See Also:
- https://github.com/jcheger/fnirsi-dc580-protocol
"""
import sys
import os
#!/usr/bin/env python3
import sys
import os
from serial import Serial
def read_frame(io):
sbuf = io.read(1)
if not sbuf[0] == 0x7E: return None
#!/bin/sh
: ${KERNEL:=5.4.51-piCore}
: ${VER:=12.x}
: ${REPO:="http://repo.tinycorelinux.net"}
: ${ARCH:=armv6}
usage() {
local p=${0##*/}
cat <<EOF 1>&2
@tai
tai / epd.py
Created September 3, 2021 16:01
#
# MicroPython driver for WaveShare 4.2inch e-Paper Display (EPD)
#
# Current target of this code is ESP8266.
#
# ESP8266 requires following GPIO state on boot, and this
# conflicts with SPI pinout.
#
# - GPIO15=0 # SPI CS
# - GPIO2=1 # LED-2
@tai
tai / nrf24
Created August 27, 2021 09:29
#!/usr/bin/env python3
import sys
import os
import re
import time
import pigpio
import logging
from collections import OrderedDict
@tai
tai / nrf24
Created August 25, 2021 16:29
#!/usr/bin/env python3
import sys
import os
import re
import pigpio
from collections import OrderedDict
from contextlib import contextmanager
def help():
#!/usr/bin/perl
sub usage {
my $p = ($0 =~ m|[^/]+$|, $&);
print STDERR <<EOF;
$p - Add linecolor to input
Usage: $p <perlexpr> [color] [<perlexpr> <color> ...]
Example:
\$ lsusb -tv | $p '!/hub/io'
\$ lsusb -tv | $p '!/hub/io' green
#!/usr/bin/perl
use English;
use Getopt::Long;
use YAML;
use JSON;
use strict;
sub help {
my $p = $0; $p =~ s|^.*/||;
#!/usr/bin/perl
use English;
use Getopt::Long;
use YAML;
use JSON;
use strict;
sub help {
my $p = $0; $p =~ s|^.*?/||;