Skip to content

Instantly share code, notes, and snippets.

@cmlewis89
cmlewis89 / arp-monitor.sh
Last active September 25, 2023 20:11
Bash script to monitor any new device connects to a network using arp
#!/bin/bash
#
# arp-monitor, an ARP tables monitor
# inspired by https://gist.github.com/maugern/30ace2764aafc683a802de2ed82f91af
#
# This script is intended to start on launch and run on an always connected device on a network (eg: server).
# It scans the network with 'arp -a' and sends a notification webhook whenever recognizes a new mac address on the network.
#
# For auto-run on login you can rename the script to a .command and add it to your Login items on Mac OS or
# modify the script to remove the loop and take a look at crontab
@mrizvic
mrizvic / nodered-timestamp-properties.js
Last active October 23, 2022 18:00
Function for node-red which determines properties like holiday, business day, weekend, etc at the moment when incoming message is received. It contains Slovenian conditions to determine those properties.
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* github.com/mrizvic wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. M.Rizvic
* ----------------------------------------------------------------------------
## This function will pass incoming message to multiple outputs based on following conditions:
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active June 18, 2024 13:03
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example