Skip to content

Instantly share code, notes, and snippets.

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
@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
@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 / 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 / nat.sh
Created August 23, 2016 08:40
Routing on proxmox
#!/bin/bash
/sbin/iptables -t nat --flush
iptables --flush
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j SNAT --to PUBLIC_IP
@Sid3y1
Sid3y1 / linkedin_endorse_all.js
Created August 9, 2016 13:40
Linkedin growth hack endorse all
//https://www.linkedin.com/profile/edit
a= setInterval("document.querySelector('button.endorse-action').click()",200)
@Sid3y1
Sid3y1 / linkedin_connect_suggested.js
Created August 9, 2016 13:39
Linkedin growth hacking connect to suggested contacts
a= function (){var connectBtns = document.getElementsByClassName('bt-request-buffed'); for(var i =0; i < connectBtns.length; i++) { console.log(connectBtns[i].title);connectBtns[i].click()}document.getElementById('container').style.height = "1000px"; window.scrollTo(0,0);window.scrollTo(0,document.body.scrollHeight); }
b=setInterval(a,5000)
@Sid3y1
Sid3y1 / linkedin_connect_suggested_filtered_keyword.js
Last active August 9, 2016 13:50
linkedin growth hack connect to suggested contact filtered by keywords
// linkedin ciblé
var win=0;
var los=0;
a= function (){
var connectBtns = document.getElementsByClassName('bt-request-buffed');
for(var i =0; i < connectBtns.length; i++) {
d=connectBtns[i].parentNode.firstChild.firstChild.childNodes[1].firstChild.innerHTML.toLowerCase();
console.log(d);
if( d.indexOf("journaliste") >= 0 || d.indexOf("redacteur") >= 0 || d.indexOf("pigiste") >= 0 ){
win++;
@Sid3y1
Sid3y1 / linkeding_cancel_invit_limit.js
Last active August 9, 2016 13:38
linkedin growth hack cancel invitation limit
//linkedin cancel invitation limit
a = function (){
var n = 0;
var e = document.getElementsByClassName('entity-checkbox');
for(var i =0; i < e.length; i++) {
if (e[i].parentNode.children[1].firstChild.innerHTML.indexOf('@') != -1) {
e[i].click();
n++;
if (n == 40) break;
}
@Sid3y1
Sid3y1 / viadeo_connect_suggested.js
Created August 9, 2016 13:35
viadeo connect to suggested
//viadeo:
a= function (){var connectBtns = document.getElementsByClassName('js-welcome-back-send-dcr'); for(var i =0; i < connectBtns.length; i++) { console.log(connectBtns[i]);connectBtns[i].click()} window.scrollTo(0,0);window.scrollTo(0,document.body.scrollHeight); }
b=setInterval(a,2000)