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 |
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 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. |
#!/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 os.path | |
import aiohttp.web | |
async def get_tar(request): | |
''' | |
AIOHTTP server handler for GET request that wants to download files from a `directory` using TAR. | |
''' | |
directory = <specify the directory> | |
response = aiohttp.web.StreamResponse( |
List the secure boot trust stores:
apt-get install -y efitools
efi-readvar
To take ownership of the system by following the next steps.
Create our own Platform Key (PK), Key Exchange Key (KEK), and Code Signing CAs:
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
1 server, 2 clients
Install Wireguard on all machines.
#!/usr/bin/env python | |
""" | |
Roughly based on: http://code.activestate.com/recipes/576980-authenticated-encryption-with-pycrypto/ | |
""" | |
import hashlib | |
import hmac | |
from Crypto.Cipher import AES | |
from Crypto.Random import random |