enricorossi.org

Enrico Rossi


Systemd network easy configuration

Examples of systemd network configurations. These are some collection of systemd network configuration. It does not require anything installed but systemd, not even ifupdown. note: Debian 9 aka Stretch Simple DHCP ethernet setup Interface: eth0, file name is not important, but it must have the .network suffix. /etc/systemd/network/wired.network [Match] Name=eth0 [Network] DHCP=ipv4 fixed address [Match] Name=eth0 [Network] Description="My fancy network configuration" Address=10.10.10.20/24 Gateway=10.10.10.1 DNS=10.10.10.2 DNS=10.10.10.3 Domains=fancynetwork.internal NTP=ntp.fancynetwork.internal wireless interface Authentication are managed by wpasupplicant and wpagui.

Read more...

Rfid thingmagic m5e compact

Example session with the Thing Magic M5E-C Rfid device I’m developing an AVR firmware which has to interact with the Thing Magic M5E-C rfid reader. Reading the datasheet may not be enough to get all the info someone need to get right to the point. At least it took me a couple of days to sort all these things out, mostly to access a protected tag. I wrote is a python3 code to interact easily with the device.

Read more...

Union struct bitfield and endianess in C

Bitfield with struct and union in C (gcc) with endianess I have updated the union struct and bitfield in C fixing both the endianess of the bit-field and the warning message if the -Wpedantic is used with gcc (bit-field is a GCC extension). /* * Copyright © 2016 Enrico Rossi <e.rossi@tecnobrain.com> * * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar.

Read more...

Union struct and bitfield in C

please see updated version: union struct bitfield and endianess in C Typical usage of a bitfield with struct and union in C /* * Copyright © 2016 Enrico Rossi <e.rossi@tecnobrain.com> * * This work is free. You can redistribute it and/or modify it under the * terms of the Do What The Fuck You Want To Public License, Version 2, * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.

Read more...

Mail notify with procmail

Notify-send and procmail to get new email notification. I don’t want to use/install mail-notification software for the simple task to notify when a new mail arrives. Consider also that my Incoming mail chain is: fetchmail -> procmail -> mh_folders so I added this config to my procmail config file. :0hc |grep "^From:\|^Subject:" > /run/user/1000/mail.notify-send; DISPLAY=:0.0 notify-send --icon=/usr/share/icons/gnome/32x32/actions/mail-message-new.png "`cat /run/user/1000/mail.notify-send`"; aplay --quiet --nonblock ~/wavs/incoming_message.wav [Update 05/2018: Using DBUS SESSION instead of DISPLAY]

Read more...
Previous Page 4 of 16 Next Page