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
mount sd cards boot partition | |
remove console=tty1 from boot/cmdline.txt | |
add modules_load=pwm_pca9685 to boot/cmdline.txt | |
add dtoverlay=ssd1306,address=0x3c,width=128,height=32,inverted,sequential to boot/firmware/config.txt | |
add dtoverlay=i2c-pwm-pca9685a,addr=0x40 to boot/firmware/config.txt | |
# or | |
$ echo "dtoverlay=ssd1306,address=0x3c,width=128,height=32,inverted,sequential" | sudo tee -a /boot/firmware/config.txt | |
$ echo "dtoverlay=i2c-pwm-pca9685a,addr=0x40" | sudo tee -a /boot/firmware/config.txt |
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
interface TrafficLightOperations { | |
onButtonPressed(): void; | |
onWaitedToTurnGreen(): void; | |
waitToTurnRed(): void; | |
onWaitedToTurnRed(): void; | |
} | |
interface TrafficLightContext { | |
activeLight?: "red" | "green"; | |
} |
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
module bcd_to_seven_segment_decoder( | |
input [3:0] in, | |
output reg a, b, c, d, e, f, g | |
); | |
always @(in) begin | |
case (in) | |
0: assign {a, b, c, d, e, f, g} = 7'b1111110; | |
1: assign {a, b, c, d, e, f, g} = 7'b0110000; | |
2: assign {a, b, c, d, e, f, g} = 7'b1101101; | |
3: assign {a, b, c, d, e, f, g} = 7'b1111001; |
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
--- | |
apiVersion: policy/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: psp.flannel.unprivileged | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: docker/default | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: docker/default | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default | |
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default |
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
# All resources definition must be declared | |
--- | |
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
annotations: | |
controller-gen.kubebuilder.io/version: v0.6.2 | |
creationTimestamp: null | |
name: ingressroutes.traefik.containo.us |
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 time | |
import logging | |
import logging.handlers | |
import multiprocessing | |
number_of_work_consumers = 4 | |
def log_handler_fn(log_queue: multiprocessing.Queue): | |
logging.basicConfig(level=logging.DEBUG) | |
while True: |
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
$from = 1 | |
$to = 540 | |
$url = "https://someurl/segment{}.ts" | |
$out = "segment{}.ts" | |
for ($i = $from; $i -le $to; $i++) | |
{ | |
Invoke-WebRequest $url.Replace("{}", $i) -OutFile $out.Replace("{}", $i) | |
} |
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
#include <stdint.h> | |
#include <Wire.h> | |
#define DEVICE_ADDRESS 0x48u | |
#define TEMPERATURE_REGISTER_ADDRESS 0x00u | |
#define STATUS_REGISTER_ADDRESS 0x02u | |
#define CONFIG_REGISTER_ADDRESS 0x03u | |
#define POLL_DELAY 240 /* ms */ |
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
for ($i=1; $i -le 540; $i++) {echo "segment$i.ts" >> list.txt} | |
& "..\ffmpeg.exe" -f concat -safe 0 -i list.txt -c copy output.ts |
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
#!/bin/bash | |
# usage: ocr.sh directory | |
find "${1}" -type f \ | |
-iname "*.png" -print0 \ | |
-o -iname "*.jpg" -print0 \ | |
-o -iname "*.jpeg" -print0 | | |
while IFS= read -r -d '' FILE; do | |
DEST="${FILE}.pdf" | |
if [ ! -f "${DEST}" ]; then |
OlderNewer