This is a TL;DR for: https://linuxopsys.com/topics/update-firmware-on-ubuntu-using-fwupd
# Install
su -
apt update
apt install udisks2 fwupd
# Display supported devices
fwupdmgr get-devices| #!/usr/bin/env python3 | |
| # | |
| # Building a tar file chunk-by-chunk. | |
| # | |
| # This is a quick bit of sample code for streaming data to a tar file, | |
| # building it piece-by-piece. The tarfile is built on-the-fly and streamed | |
| # back out. This is useful for web applications that need to dynamically | |
| # build a tar file without swamping the server. | |
| import os | |
| import sys |
| import sys | |
| import dbus | |
| bus = dbus.SystemBus() | |
| systemd = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1') | |
| manager = dbus.Interface(systemd, 'org.freedesktop.systemd1.Manager') | |
| def disable_and_stop(service): | |
| """ | |
| disable_and_stop and stop method will check if the service is already running or not in system. |
This is a TL;DR for: https://linuxopsys.com/topics/update-firmware-on-ubuntu-using-fwupd
# Install
su -
apt update
apt install udisks2 fwupd
# Display supported devices
fwupdmgr get-devices| import os | |
| import pwd | |
| file_path = '/tmp/example' | |
| if not os.path.exists(file_path): | |
| os.makedirs(file_path) # creates with default perms 0777 | |
| uid, gid = pwd.getpwnam('root').pw_uid, pwd.getpwnam('www-data').pw_uid | |
| os.chown(file_path, uid, gid) # set user:group as root:www-data | |
| # go check with ls -lah /tmp/example |
I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:
gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:Key attributes ...: rsa2048 rsa2048 rsa2048
| from socket import socket, AF_PACKET, SOCK_RAW | |
| ETH_P_ALL = 0x0003 | |
| print("Starting") | |
| interface = "enx7cc2c65485c0" | |
| # interface_mac = 7c:c2:c6:54:85:c0 | |
| # Note: When sending ethernet frames, only the following data is actually supplied at this level: |