oriolrius.cat

Des del 2000 compartiendo sobre…

Category: Technology

rp_filter Linux kernel feature

Reading time: 1 – 2 minutes

It’s just an IP spoofing protection which is by default enabled on Linux kernels. When it’s value is ‘1’ means that all IP address which are not directly routable and received form a network interface they are directly discarded.

So, if you want to scan a range of IP address in your LAN which not belong to that interface address space when packets from IP addresses are received they are going to be discarded by the kernel. So, take that into account when you have those “unusual” requirements.

It can be enable/disabled by all interfaces or just one:

root@mini9:/proc/sys/net/ipv4# cat ./conf/all/rp_filter
1
root@mini9:/proc/sys/net/ipv4# cat ./conf/ztly5q4n37/rp_filter
1

Zerotier peers monitored on Windows PowerShell

Reading time: < 1 minute

No words just a simple an powerful .ps1 script:

while (1) { Start-Process -NoNewWindow -FilePath 'C:\ProgramData\ZeroTier\One\zerotier-one_x64.exe' -ArgumentList "-q","peers"; sleep 5; cls }

Or just a command, even equally useful.

DRY DHCP Client: request and IP address to the DHCP server without a DHCP Client

Reading time: < 1 minute

When you want to discover LAN metadata without being part of that network. So, when you want to discover network address range, gateway, DNS IPs, DHCP server IPs, etc. this simple nmap parameter will help you so much.

# nmap --script broadcast-dhcp-discover

Starting Nmap 7.60 ( https://nmap.org ) at 2021-05-19 15:07 CEST
Pre-scan script results:
| broadcast-dhcp-discover:
|   Response 1 of 1:
|     IP Offered: 192.168.1.127
|     DHCP Message Type: DHCPOFFER
|     Subnet Mask: 255.255.255.0
|     Renewal Time Value: 4d00h00m00s
|     Rebinding Time Value: 7d00h00m00s
|     IP Address Lease Time: 8d00h00m00s
|     Server Identifier: 192.168.1.1
|     Router: 192.168.1.1
|_    Domain Name Server: 8.8.8.8, 8.8.4.4
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 1.43 seconds

Alive: shell script for alive monitoring using PING

Reading time: < 1 minute

Simple shell script based on bash which monitor a host with command line ping. Just bash and ping are the unique dependencies. Only state change are going to be printed:

#!/bin/bash

IP="THE_IP_TO_MONITOR"
STATE="offline"

show_state()
{
  echo "$(date '+%Y-%m-%dT%H:%M:%S') - " + $STATE;
}

while true;
do
  ping -c 4 $IP > /dev/null 2>&1
  if [ "$?" = "0" ]; then
    if [ "$STATE" = "offline" ];
    then
      STATE="online"
      show_state
    fi
  else
    if [ "$STATE" = "online" ];
    then
      STATE="offline"
      show_state
    fi
  fi
  sleep 10
done

43 años pasan en un momento

Reading time: 4 – 6 minutes

Desde el resumen anual lo único que os he compartido en mi blog ha sido una simple reseña a mi primer cumpleaños. Creo que ya toca aprovechar un ratito para la introspección.

Ayer fue mi 43 cumpleaños, pero este año no os compartiré una de mis reflexiones sobre la vida como es costumbre. Lo que me gustaría hacer es reseñar un poco donde estoy publicando contenidos y cuál es mi linea estratégica para los próximos años. La verdad es que me he dado cuenta que soy más prolífico de lo que imaginaba. Lástima que al entrar al blog esto no se refleje.

Estoy seguro de que los que me vais siguiendo desde hace años os habéis dado cuenta de que a nivel tecnológico voy saltando de un tema a otro. Es más, es muy probable que os plantéis que temas estoy tocando recientemente en este aspecto. Pues la verdad es que no son pocos los temas, pero debido a que mi actividad profesional está en gestación desde hace un año y algo no estoy dedicando mucho tiempo a compartir estas cositas. Para los que no podáis resistiros os diré que este pasado viernes dedique algo de tiempo a investigar temas relativos a NDI: Network Device Interface live video over IP production technology.

Lo primero que tengo que mencionar es que desde que dejé el mundo tecnológico como mi foco central de actividad el sentido del blog ha quedado desdibujado. No me planteo en ningún caso cerrarlo, pero evidentemente tengo que invertir cierto tiempo en decidir cuál es la funcionalidad que debe tomar. Hasta el momento lo que tengo claro es lo siguiente.

Debido a mi nueva actividad tengo mucha más visibilidad y comparto varios eventos por semana a través de otros canales. Por ejemplo, en mi página personal he incluido un espacio de noticias donde voy publicando los diferentes materiales en los que estoy vinculado. Así pues, si queréis seguir mi agenda lo mejor es usar ese enlace: https://oriolrius.me/noticias

Hablando de agenda no tengo programado cuando voy a armonizar mis contenidos del blog con los de mi página personal. Pero ahora mismo lo más probable es que oriolrius.cat acabe siendo la página donde comparta diferentes temas técnicos pero sin orden ni estrategia concretas. Un simple aparador de las cositas en las que voy invirtiendo tiempo y que considero valiosas compartir.

También aprovecho esta reflexión para mencionaros que en mi dominio equiposinoficina.com se os redirige a un canal de Youtube sobre productividad con Notion, donde Dani Aguayo y yo mismo vamos publicando nuestros vídeos al respecto de la productividad de equipos remotos. Por cierto, esto que empezó como una excusa para avanzar en el conocimiento de Notion está teniendo una acogida y evolución que nos está sorprendiendo y para dar mejor respuesta a las personas que nos siguen hemos creado un grupo de Telegram en https://url.joor.net/ESO

Cambiando de tema, en breve además empezaré a publicar material en industry40.systems donde Rai y yo llevamos ya varias semanas invirtiendo tiempo preparando materiales y el siguiente paso será publicar vídeos. La idea es explicaros con todo detalle como montar un Gateway de IoT usando Open Source. Eso si, con un PC industrial. Nada de Raspberry PI ni productos experimentales, estoy seguro que tenéis mil tutoriales al respecto. Además el enfoque del trabajo es totalmente profesional prueba de ello es que varios Gateways en producción en varias líneas de empresas punteras.

Siguiendo con esta línea, compartiros que mi masterclass sobre Cloud Computing para directivos ya tiene casi 100 usuarios. Este producto nació como la versión online de la masterclass que hago presencialmente para ACCIÓ dos veces al año. Pues bien, próximamente registraré una nueva masterclass aprovechando la evolución de material que he hecho para mi clase presencial.

Antes de cerrar esta reseña de donde podéis ver lo que voy publicando recordar que el punto neurálgico donde seguir mi agenda es https://oriolrius.me/noticias o simplemente unirse al grupo de Telegram YMBI donde además de las noticias irás recibiendo muchísima otra información interesante de Industria 4.0, o de temas relativos a la cuarta revolución industrial.

Para los amantes de las efemérides añadir un último data, este próximo 31 de julio el blog cumplirá 20 años. Creo que a pesar de no haber sido nunca un blog de referencia en ningún aspecto tiene cierto mérito cumplir 20 años escribiendo.

¡GRACIAS POR ESTAR AHÍ! y por compartirme vuestros pensamientos, es un placer producir para ayudar.

Cut video clip using ffmpeg

Reading time: < 1 minute

Very simple and useful parameters of ffmpeg:

ffmpeg -ss HH:MM:SS -i INPUT_FILE -to HH:MM:SS -c copy OUTPUT_FILE

Get Linux system process list without ‘ps’ command

Reading time: < 1 minute

When you work with embedded systems sometimes you would feel happy to have a Linux box until you discover there are plenty of basic things that you don’t have available, the extreme of that could be the ‘ps’ command which is used most of the time for checking if any process is running . Maybe you know that thanks the /proc filesystem there is access to the source of the information.

Keep next command close for solving this inconvenience he next time:

find /proc -mindepth 2 -maxdepth 2 -name exe -exec ls -lh {} \; 2>/dev/null

RDP vs Team Viewer vs Anydesk

Reading time: 4 – 6 minutes

Lately I bought a Surface Go for working specially as an agenda and for working outside home when I don’t have to work on technical stuff. At some point I considered the idea of working on that device remotely when I’m working with my desktop environment because it could be more comfortable specially because I have a bigger screen and keyboard for interacting with the content that I have on the tablet.

The first thing that I tried to do was enabling Remote Desktop Protocol on my Surface Go. But it was officially impossible because it has Windows 10 Home and the “Home” version doesn’t have this feature. BTW when you are not comfortable with this the best is googling little for finding any hack which allow me to enable the service. And yes, it exists and works really well.

You can find the project which hacks that in Windows 10 Home GitHub it’s called “rdpwrap” and if you want to know more about that go to next links:

After so much effort for getting RDP working on Windows 10 I discovered that RDP doesn’t work like Team Viewer, so you’re not going to control remote desktop while you can view what is happening in that remote session. This is not mandatory for me but in some cases it’s really useful. After some weeks I had to install Team Viewer for getting that feature working and I rediscovered that tool after some years without using it, and I was pleased to discover how good it works and how it improved after some years.

Then something inside me triggered the idea to look it up for an alternative to Team Viewer without so many restrictions and with a better free version. After trying some alternatives to Team Viewer I have to recommend Anydesk as an excellent and simple to use tool. And the most important thing, you don’t have to install anything in your Linux, Mac or Windows computer for using it. The only thing that you have to do is run the executable and use the auto-generated code for connecting to the remote system. I felt very good for those features and currently this is the option which I use for giving some support to friends remotely and for connecting to my Surface Go desktop remotely from my desktop computer.

As you can see this is not an exahustive revision, or comparsion of feautrues of all those three tools. But at the end of the day most of them allow you to do the same things but with slightly different procedures. BTW, the killer feature for me is something that I’ve got from “join.me” in the past, I mean use a tool for remote desktop control without having to install anything in the server and neither in the client part. I didn’t talk about “join.me” because it eats all my resources when I run it, and they focused the tool as a meeting tool and this is not anything that I want. Those extra features killed IMHO the best things that tool had in the past.

TL;DR

The best option IMHO and for my use is Anydesk.

Enjoy it.

OBS Studio – cómo usar los perfiles, escenas y fuentes

Reading time: < 1 minute

Cada vez uso más OBS Studio y hace unos meses me decidí a sacarle todo el jugo a la herramienta. Pues bien, para ello me tuve que ir al manual para entender cual era la finalidad de los perfiles, las escenas y las fuentes. Para que no se me olvide registré este vídeo: