Category Archives: raspberry pi

streaming from a raspberry-pi picamera to homeassistant


raspivid -rot 180 -t 0 -n --width 640 --height 480 -o - | cvlc stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8090}' :demux=h264

home assistant

 - platform: ffmpeg

You will need to install vlc-nox in the rpi, in single cpu version it really slow, do it before you go to sleep.

ssh allow all users from lan, restrict users from wan

Raspberry pi used as ssh server at home.
DMZ enabled to it’s IP.

file: /etc/ssh/sshd_config

AllowUsers *@192.168.0.* johndoe

This directive will allow only johndoe to connect via ssh unless the connection attempt comes from the same network, in which case alice will be able to connect, too. If alice tries to connect from the DMZ, it won’t work.

Un petit script python qui m’envoie des mails quand le RER est malade

Un petit script tout moche python qui m’envoie des mails quand le RER est malade, lancé avec une crontab aux horaires qui m’intéressent, et voilà!

# -*- coding: utf-8 -*-

import time
now = time.ctime()

# RATP API part
## c'est la partie magique, merci Pierre!
import requests
r = requests.get("")
data = r.text

import json
parsed_json = json.loads(data)
if parsed_json["trafic"] == "perturbation":
  mailbody = parsed_json["perturbations"]

  ## mail part
  import subprocess
  import smtplib
  import email.utils
  from email.mime.text import MIMEText

  recipients = ","
  # Create the message
  msg = MIMEText(str(mailbody))
  msg['To'] = recipients
  msg['From'] = ""
  msg['Subject'] = "RERB status -- " + now

  server = smtplib.SMTP('')
  log = server.set_debuglevel(True) # show communication with the server
      server.sendmail(msg["From"], msg["To"].split(","), msg.as_string())

automating #Twitter with #raspberrypi

I’ve been tweeting pictures and re-tweeting twits automatically for a few years now using two python tools.

  1. Twython
  2. on github
    Here’s an example script for Twython

  3. TwitterFollowBot
  4. on github
    Here’s an example script for TwitterFollowBot

Both require to have an already created Twitter app ( and a little bit of python.