Skip to content

Instantly share code, notes, and snippets.

@Sid3y1
Sid3y1 / rproxy.sh
Created August 23, 2016 08:41
nginx reverse proxy script
#!/bin/bash
if [[ ! $3 ]]
then
echo "Usage ./rproxy.sh name ip port"
exit 1
fi
if [[ -f /etc/nginx/sites-enabled/$1 ]]
then
@Sid3y1
Sid3y1 / interfaces
Created August 23, 2016 08:45
proxmox interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
@Sid3y1
Sid3y1 / get_picture_from_mov.sh
Created August 29, 2017 10:45
get pictures from movie with ffmpeg
find . -name "*.MOV" | while read movie;do
# ffmpeg -i "$movie" -f flv "${movie%.mov}.flv"
echo $movie
dir=`dirname "$movie"`
fn=`basename "$movie"`
mkdir -p "_images/$dir"
#ffmpeg -i "$movie" -vf fps=1 "_images/$dir/${fn}_%3d.jpg"
#ffmpeg -i "./Cinéma/H44A4224.MOV" -vf "select='eq(not(mod(n\,100))*pict_type,PICT_TYPE_I)'" -vsync vfr "_images/./Cinéma/H44A4224.MOV_%3d.png"
echo "ffmpeg -i \"$movie\" -vf \"select='eq(not(mod(n\,100))*pict_type,PICT_TYPE_I)'\" -vsync vfr \"_images/$dir/${fn}_%3d.jpg\""
done
blueprint:
name: Motion-activated Switch
description: Turn on a switch when motion is detected.
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor