Formula validator

Define formula using variables and check if it’s a valid math expression using Math.js

How to disable and/or remap buttons on your mouse

Use the program xev through grep to show only ButtonPress events.

xev | grep -A2 ButtonPress

Create a file called .Xmodmap

micro ~/.Xmodmap

Inside the file disable and/or remap buttons you detected with xev

! Remap button 1 to 8 and disable button 8 and 9.
pointer = 8 2 3 4 5 6 7 0 0

Check it.

xmodmap ~/.Xmodmap

Allow markers only within an area

Map area for your makers using a polygon.

This was used as a challenge during one of our selection processes.

Read IO-Link sensor info

First of all, you need to check your IO-Link master and sensor to know how to proceed, but in most cases between different manufacturers is quite similar thanks to IO-Link standard.

Let’s check an IM5184 sensor connected to port 2 in a AL1350 master at 192.168.0.20

curl

curl -d '{"code":"request","cid":1,"adr":"/iolinkmaster/port[2]/iolinkdevice/iolreadacyclic","data":{"index":1002,"subindex":1}}' http://192.168.0.20

httpie

http POST 192.168.0.20 code=request cid:=1 adr=iolinkmaster/port[2]/iolinkdevice/iolreadacyclic data:='{"index":1002, "subindex":1}'

This would give us an hexadecimal value ready to use.

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: application/json
Transfer-Encoding: chunked

{
    "cid": 1,
    "code": 200,
    "data": {
        "value": "00022FE5"
    }
}

Detect your IO-Link masters

If your IO-Link masters are connected to your network, you can use arp-scan command-line tool to discover and fingerprint ARP (Address Resolution Protocol) hosts.

sudo arp-scan -l