Use oathtool command line for 2 step verification (2FA)

You don’t need to use GAMMA Authenticators or closed private apps that generates 2 step verification (2FA) codes on your phone. Keep it simple and under your control, use oathtool command:

oathtool -b --totp 'private_key'

This will give you an output with the code you need whenever you want, ex:

521319

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"
    }
}