Skip to content

Instantly share code, notes, and snippets.

@bbinet
bbinet / 1_pdf.py
Created January 30, 2024 16:20 — forked from philfreo/1_pdf.py
Three ways to make a PDF from HTML in Python (preferred is weasyprint or phantomjs)
def render_pdf_weasyprint(html):
from weasyprint import HTML
pdf = HTML(string=html.encode('utf-8'))
return pdf.write_pdf()
def render_pdf_xhtml2pdf(html):
"""mimerender helper to render a PDF from HTML using xhtml2pdf.
Usage: http://philfreo.com/blog/render-a-pdf-from-html-using-xhtml2pdf-and-mimerender-in-flask/
"""
@bbinet
bbinet / scrape_bible_plan.sh
Created December 11, 2023 15:54 — forked from dtxe/scrape_bible_plan.sh
Scrape BibleProject discussion posts from YouVersion bible plans
#!/bin/bash
PLANID=12345678
JWTTOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
for DAY in {1..365}
do
curl 'https://plans.youversionapi.com/4.0/together/$PLANID/activities?day=$DAY&page=1&order=desc&talk_it_over=0' \
-H 'authority: plans.youversionapi.com' \
-H 'x-youversion-app-version: 4' \
@bbinet
bbinet / debug.log
Last active July 6, 2023 14:26
esp_modem: silent disconnection leads to endless OTA
I (30) boot: ESP-IDF v5.1-dev-2926-g3df87a91a3 2nd stage bootloader
I (30) boot: compile time Jul 5 2023 10:23:12
I (31) boot: chip revision: v0.3
I (35) boot.esp32c3: SPI Speed : 80MHz
I (40) boot.esp32c3: SPI Mode : DIO
I (44) boot.esp32c3: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (54) esp_image: segment 0: paddr=00020020 vaddr=3c100020 size=50320h (328480) map
I (63) esp_image: segment 1: paddr=00070348 vaddr=3fc98400 size=02f38h ( 12088) load
I (72) esp_image: segment 2: paddr=00073288 vaddr=40380000 size=0cd90h ( 52624) load
FROM resin/amd64-debian:stretch
MAINTAINER Bruno Binet <[email protected]>
ENV IMAGE_VERSION 1.0
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
-- Logs begin at Thu 2019-02-07 05:02:42 UTC, end at Thu 2019-02-07 15:51:19 UTC. --
Feb 07 05:02:48 hltest-mc-1 systemd[1]: Started Hindsight monitoring server.
Feb 07 05:02:50 hltest-mc-1 hindsight[129]: 1549515770199951605 [info] hindsight starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772310011313 [info] input.proc_net_wireless starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772669716047 [info] input.checkpoint_manager starting
Feb 07 05:02:52 hltest-mc-1 hindsight[129]: 1549515772962899201 [info] input.statsdp_udp starting
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773284811173 [info] analysis.aggregate_metric-3s-parking adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773413648361 [info] analysis.forward_checkpoint_manager adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773632524983 [info] analysis.aggregate_metric-60m-park adding to thread: 0
Feb 07 05:02:53 hltest-mc-1 hindsight[129]: 1549515773876170448 [info] analysis.aggr
Access point 'helioslite-tracker' created
Starting HTTP server on 192.168.42.1:80
Timeout reached. Exiting...
Stopping access point 'helioslite-tracker'...
Access point 'helioslite-tracker' stopped
Starting WiFi Connect
WiFi device: wlan0
[wifi_connect::network:WARN] No access points found - giving up...
Starting access point...
Access point 'helioslite-tracker' created
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
TP-LINK_302C
-- Logs begin at Sun 2018-04-08 05:09:44 UTC, end at Mon 2018-04-09 12:36:55 UTC. --
Apr 08 05:09:52 raspberrypi systemd[1]: Starting Network Manager...
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.6113] NetworkManager (version 1.10.0) is starting... (for the first time)
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.6208] Read config: /etc/NetworkManager/NetworkManager.conf
Apr 08 05:09:53 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164193.8423] manager[0x13fd0b8]: monitoring kernel firmware directory '/lib/firmware'.
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4005] hostname: hostname: using hostnamed
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4028] hostname: hostname changed from (none) to "hlnew-mc-armv6hf"
Apr 08 05:09:54 hlnew-mc-armv6hf NetworkManager[621]: <info> [1523164194.4101] dns-mgr[0x13ecc18]: init: dns=default, rc-manager=resolvconf
Apr 08 05:09:54 hlnew-mc-armv6hf Netwo
-- Logs begin at Wed 2018-03-28 17:12:02 CEST, end at Wed 2018-03-28 17:12:56 CEST. --
Mar 28 17:12:02 hltest-mc-2 systemd[1]: Started Resin persistent logs.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Found user 'avahi' (UID 995) and group 'avahi' (GID 994).
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully dropped root privileges.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: avahi-daemon 0.6.32 starting up.
Mar 28 17:12:02 hltest-mc-2 systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully called chroot().
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Successfully dropped remaining capabilities.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Loading service file /services/ssh.service.
Mar 28 17:12:02 hltest-mc-2 avahi-daemon[707]: Joining mDNS multicast group on interface resin-dns.IPv6 with address fe80::dce3:b7ff:fe59:9ade.
[Tue Mar 13 09:42:37 2018] overlayfs: failed to resolve '/var/lib/docker/overlay2/l/7I3ZTA3E3WL6NE37L7ZWXYVMHJ': -2
[Tue Mar 13 09:57:20 2018] mmc0: timeout waiting for hardware interrupt.
[Tue Mar 13 09:57:20 2018] [109eef30] PRD1 dd827e10 0
[Tue Mar 13 09:57:20 2018] [109eef3a] PRD2 4 0
[Tue Mar 13 09:57:20 2018] [109eef46] PRD3 dceb2784 0
[Tue Mar 13 09:57:20 2018] [109eef46] PDM> dca12628 0
[Tue Mar 13 09:57:20 2018] [109eef47] REQ< dca12558 10801
[Tue Mar 13 09:57:20 2018] [109eef49] CMD< 19 5b30a8
[Tue Mar 13 09:57:20 2018] [109eef4f] CMDD 20 200
[Tue Mar 13 09:57:20 2018] [109eef51] SDMA dca12628 dd827e10