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.

Posted in Debian, raspberry pi | Tagged , , | Leave a comment

#orion belt + #rigel #astrophotograpy

stacked with Fotoxx

orion-post0proc

Posted in linux | Leave a comment

Ridiculously absurd bike infrastructure around the world

Chile:
stupid-bikelane1

stupid-bikelane2

stupid-bikelane4

stupid-bikelane5

stupide-bikelane3

Massy, France:
IMG_20151228_191302481-resized

IMG_20151228_191235702-resized

IMG_20151228_191107848-resized

Jouy-en-Josas, France:

IMG_20160131_165005102_HDR

If you have more of this, all donations are welcome.

Posted in bike | Tagged , | Leave a comment

check if a command is an alias with “type” #linux

~/$ type -f ls
ls is aliased to `ls --color=auto'

Posted in bash, Debian, linux | Tagged , , , | Leave a comment

Time lapse using a #FLIR #Lepton

Here are two thermographic timelapses I did using a RaspberriPy, a FLIR Lepton sensor and Flimeo

Mocha coffee machine

Wall radiator

Flimeo:
https://github.com/alej0varas/flimeo

Posted in raspberry pi, infrared | Leave a comment

#hubicfuse with #debian for busy people

Install the debian package:

apt-get install hubicfuse

Clone the project:

git clone git@github.com:TurboGit/hubicfuse.git

You will need to use one of the scripts from this project.
Or just the script hubic_token from
here.

Create an app on hubic.
Get the client_id and client_secret.

Create a file named .hubicfuse on your ~/
execute the script hubic_token
copy the token form the script

the .hubicfuse file should look like this:

client_id=api_hubic_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
refresh_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
verify_ssl=false

I used ssl = False to avoid issues with my auto-signed certificate.

Add your user to fuse group if you haven’t (look here).

create a mount point:

mkdir hubic

then mount:

sudo hubicfuse ~/hubic -o noauto_cache,sync_read

to umount,
fusermount -u hubic

Enjoy!

Posted in bash, Debian, linux | Tagged | Leave a comment

really simple image editor for linux

Want to add a square, a line and not an expert?

Use Pinta. Problem solved.

apt-get install pinta

More here:
http://pinta-project.com/

If anything more complicated than that (still assuming you’re not a pro), you can try rawtherapee.
http://www.rawtherapee.com/

Posted in photo, Debian, linux | Tagged , | Leave a comment

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à!

#!/usr/bin/python
# -*- coding: utf-8 -*-

import time
now = time.ctime()


# RATP API part
## c'est la partie magique, merci Pierre!
import requests
r = requests.get("http://api-ratp.pierre-grimaud.fr/data/trafic/rer")
data = r.text
print(data)

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

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

  recipients = "qqn@mail.com,joe@example.net"
  # Create the message
  msg = MIMEText(str(mailbody))
  msg['To'] = recipients
  msg['From'] = "noreply-rapt@whateversnmpworkshere.fr"
  msg['Subject'] = "RERB status -- " + now

  server = smtplib.SMTP('smtp.example.net')
  log = server.set_debuglevel(True) # show communication with the server
  try:
      server.sendmail(msg["From"], msg["To"].split(","), msg.as_string())
  finally:
      server.quit()
  #print(log)

Posted in python, linux, raspberry pi | Tagged , , , | Leave a comment

get IPs only from arp -a with #vim

arp -a

? (192.168.1.111) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.1) at c8:d7:19:xx:xx:xx [ether] on eth0
? (192.168.1.116) at  on eth0
? (192.168.1.106) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.28) at 9c:b6:54:xx:xx:xx [ether] on eth0
? (192.168.1.119) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.101) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.4) at b8:27:eb:xx:xx:xx [ether] on eth0
? (192.168.1.105) at 20:e5:2a:xx:xx:xx [ether] on eth0
? (192.168.1.31) at  on eth0
? (192.168.1.26) at 20:4e:7f:xx:xx:xx [ether] on eth0
? (192.168.1.104) at 34:36:3b:xx:xx:xx [ether] on eth0
? (192.168.1.103) at 00:90:f5:xx:xx:xx [ether] on eth0
? (192.168.1.108) at e4:e0:c5:xx:xx:xx [ether] on eth0
? (192.168.1.107) at 6c:ad:f8:xx:xx:xx [ether] on eth0
? (192.168.1.112) at b0:79:94:xx:xx:xx [ether] on eth0
? (192.168.1.102) at 6c:ad:f8:xx:xx:xx [ether] on eth0

with vim:
:%s/.*(\(.*\)).*/\1/g

192.168.1.111
192.168.1.1
192.168.1.116
192.168.1.106
192.168.1.28
192.168.1.119
192.168.1.101
192.168.1.4
192.168.1.105
192.168.1.31
192.168.1.26
192.168.1.104
192.168.1.103
192.168.1.108
192.168.1.107
192.168.1.112
192.168.1.102

Posted in bash, Debian, linux | Tagged , | Leave a comment

#bash functions as alias

add this to your .bashrc

udp(){
vlc udp://@$1:1234
}

no need to type
vlc udp://@225.1.1.1:1234
just type
udp 225.1.1.1

thanks to https://github.com/RoyTrenneman?tab=repositories

Posted in linux | Leave a comment