Skip to content

Instantly share code, notes, and snippets.

@LS80
LS80 / DVB.md
Last active October 19, 2021 00:20

DVBSky S960

curl --location https://github.com/LibreELEC/dvb-firmware/raw/master/firmware/dvb-demod-m88ds3103.fw --output /lib/firmware/dvb-demod-m88ds3103.fw

PCTV 292E

curl --location https://github.com/LibreELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-02.fw --output /lib/firmware/dvb-demod-si2168-02.fw

Loan Dashboard

We're a lending platform giving loans to businesses. We want to create a summary of loans by transforming input data.

Input Format

The input to this exercise is as follows:

Perky Blenders Coffee, 56101, 100000, B, 8%
@LS80
LS80 / primes.md
Created September 13, 2021 13:53

1000th Prime Number

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 1000th prime number?

@LS80
LS80 / plot.py
Last active January 29, 2020 14:31
import sys
import matplotlib.pyplot as plt
import matplotlib.animation as mani
import requests
import numpy as np
session = requests.Session()
fig, axarr = plt.subplots(3, sharex=True)
@LS80
LS80 / accel.py
Last active January 27, 2020 14:19
import time
import csv
import math
import board
import digitalio
import busio
import adafruit_lis3dh
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
@LS80
LS80 / spurs-tv.py
Created August 15, 2018 21:13
Spurs TV Videos
import re
import json
import pprint
from collections import namedtuple
import requests
pp = pprint.PrettyPrinter()
Video = namedtuple('Video', 'entry_id caption thumbnail')
ENV BUILD_DIR="/tmp/tvheadend"
git clone https://github.com/tvheadend/tvheadend.git --branch="${VERSION}" "${BUILD_DIR}" && \
"${BUILD_DIR}"/configure \
--disable-cardclient \
--disable-cwc \
--disable-cccam \
--disable-capmt \
--disable-constcw \
--disable-satip_server \
@LS80
LS80 / pitr.sh
Last active October 11, 2023 11:11
Demo PostgreSQL Point-in-time Recovery with Docker
#!/bin/bash
VERSION=9.6
function cleanup() {
docker rm -f master replica >&/dev/null
rm -Rf /tmp/data /tmp/wal_archive
}
function wait_until_ready() {
@LS80
LS80 / ovpn_files.py
Last active March 29, 2016 14:35
Create Network Manager OpenVPN certificates and keys from .ovpn file
import sys
import re
FILE_NAMES = {'ca': 'ca.crt',
'cert': 'usr.crt',
'key': 'usr.key',
'tls-auth': 'tls.key',
}
config = open(sys.argv[1]).read()
@LS80
LS80 / ovpn_files.rb
Created March 28, 2016 21:10
Create Network Manager OpenVPN certificates and keys from .ovpn file
FILE_NAMES = {'ca' => 'ca.crt',
'cert' => 'usr.crt',
'key' => 'usr.key',
'tls-auth' => 'tls.key',
}
config = File.read(ARGV[0])
FILE_NAMES.each do |tag, filename|
config.match(/<#{tag}>(.*?)<\/#{tag}>/m)