Skip to content

Instantly share code, notes, and snippets.

@jr-k
jr-k / readme.md
Created January 27, 2019 16:47 — forked from mowings/readme.md
ffmpeg stream and save video from Dahua 4300s IP Camera

Use ffmpeg to stream video from a dahua 4300s to a file or files

You can use ffmpeg to directly pull frames off of a dahua 4300s at full resolution. May be a good alternative to pricey dvrs which likely cannot record at full resolution, may not work with the camera, or are prohibitevly expensive

Simple Stream to file

Simple stream to file. Full resolution

ffmpeg -loglevel debug -rtsp_transport tcp -i "rtsp://admin:[email protected]:554/live" \

-c copy -map 0 foo.mp4

@jr-k
jr-k / offlineFallback.py
Created January 27, 2019 18:12 — forked from Psychokiller1888/offlineFallback.py
A way to fallback to local services for Snips when your internet goes down
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import subprocess
import time
RUNNING = False
ONLINE = True
@jr-k
jr-k / README.md
Created January 5, 2020 16:17 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@jr-k
jr-k / .python-gsmmodem-advanced.md
Created February 28, 2020 01:59 — forked from stevecohenfr/.python-gsmmodem-advanced.md
Read long SMS with python-gsmmodem (and send SMS with same running script)

Read long SMS with python-gsmmodem (and send SMS with same running script)

I spend a lot of time to replace gammu with python-gsmmodem for my Huawei E3531.

The python exemple is just an exemple, it's incomplete. It does not read sms in the memory (if you receive a sms before starting the script). And it does not concat multiple parts sms (it will print unordered parts).
Also, as your live read sms script is running, you cannot send sms with another script because the dongle is busy.

Here is my own script to read all kind of SMS and send in same time.

@jr-k
jr-k / esphome-print-async.py
Created April 17, 2020 14:54 — forked from fpletz/esphome-print-async.py
aioesphomeapi minimal examples
#!/usr/bin/env python3
import aioesphomeapi
import asyncio
async def main():
loop = asyncio.get_running_loop()
cli = aioesphomeapi.APIClient(loop, "foobarhostname", 6053, "foobarpassword")
await cli.connect(login=True)
@jr-k
jr-k / sms-to-telegram.md
Created October 20, 2021 14:33 — forked from ethaniel/sms-to-telegram.md
HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

HOWTO: Receive SMS via 4G/LTE Huawei stick on Raspberry Pi 4 and forward them via Telegram

I live abroad and have only 1 sim card slot in my phone. It holds the SIM card of the country that I am in right now. But I also have another SIM card from my home country which receives my banking SMS codes. I can't afford to lose the "home" SIM card, so I decided to keep it in my house and forward the SMS messages to my main phone and computer via Telegram (just like Whatsapp, but so much better).

I also made a choice to use a 4G/LTE stick instead of 3G, because the 3G signal in my area is getting worse in worse due to operators upgrading their equipment.

Prerequisites

  1. Raspberry Pi 4
  2. Huawei E8372 (but can be any similar)

Step 1 - Get the Huawei card to work properly with Raspberry