Neat output to show you the #lxd lxc containers used for #snapcraft :

alias snapcraft_lxc='lxc list --project snapcraft --columns nstS --format compact'

#DWDsTips

💡#DWDsTips List the diskspace used by your LXD containers & VMs storage:

 sudo bash -c 'du -cshx /var/snap/lxd/common/lxd/storage-pools/default/{containers,virtual-machines}{,-snapshots}/*' | sort -rh

I didn't set up a zpool on my laptop so I can't use that good stuff.

#Linux #LXD #Ubuntu

💡 #DWDsTips: Some useful rust tools:

🦀 cargo-audit: Audit Cargo.lock for crates with security vulnerabilities
🦀 cargo-deny: manage large dependency graphs
🦀 cargo-license: Cargo subcommand to see license of dependencies

#Rust #Cargo

💡 #DWDsTips

If you use CloudFlare to reverse proxy to your server, they add the header "CF-Connecting-IP" and "CF-Connecting-IPv6"to supply you with the originator IP address.

In NGINX, you can access these headers via:

  $http_CF_Connecting_IP
  $http_CF_Connecting_IPv6

🌐 https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/#web-server-instructions

#NGINX #CloudFlare #ReverseProxy #Webhosting #Ubuntu

Restoring original visitor IPs

When your website traffic is routed through the Cloudflare network, we act as a reverse proxy. This allows Cloudflare to speed up page load time by routing packets more efficiently and caching static resources (images, JavaScript, CSS, etc.). As a result, when responding to requests and logging them, your origin server returns a Cloudflare IP address.

Cloudflare Docs

 A few of us (@foobarry , @bigcalm ) have been tinkering with Firefox tab unloading.

Noteworthy settings:

⚙️ browser.tabs.fadeOutUnloadedTabs will fade the tabs icons
⚙️ browser.tabs.min_inactive_duration_before_unload sets the minimum time the tab will live before the unloader does it's thing. general consensus is that this is the number of milliseconds, with the default being 10 minutes (mine is much less than that now)
⚙️ browser.tabs.unloadOnLowMemory will account for low ram
⚙️ browser.tabs.unloadTabInContextMenu enables manual unloading of tabs via a context menu action

📄 There's a page called about:unloads with useful metrics, which references this page of information https://firefox-source-docs.mozilla.org/browser/tabunloader/

🛠️ Pinned tabs are deprioritized in the eyes of the unloader. Which is a setting I'd like to change.

Pictures attached for reference

I wish this sort of thing was more well-known.

#Firefox
#WebBrowser
#UnloadTabs
#AboutUnloads
#AboutConfig
#DWDsTips

Tab Unloading — Firefox Source Docs documentation

💡 #DWDsTips Minicom logging + options

#Minicom can annotate the received data.

Here I add timestamps to my sensor data and create a log file with the data in it

 now=-$(date '+%F_%T' --utc | tr -d -- '-:')
 logfile="${HOME}/Logs/minicom-capture-${now}"
 minicom \
--baudrate 115200 \
--device /dev/ttyACM0 \
--option timestamp \
--capturefile "${logfile}"

#Linux #Ubuntu #UART

💡 #DWDsTips use pv to monitor the loading of data into a database table

 command-to-generate-data |
pv --line-mode --size ESTIMATED_NO_OF_LINES --progress --rate |
psql DB_NAME -c "\copy TABLE_NAME (...COLUMNS... FROM STDIN with (format 'csv', header false)"

My data is generated from a command which reads and transforms files - last time it took a few seconds shy of 90 minutes.

Having a progress estimate is really helpful

💡 #DWDsTips Convert some NDJSON to CSV on the #CLI using #jq

  jq -r '[.name, .description] | @csv' << 'EOF'
{"name": "dwd", "description": "tips"}
{"name": "not-dwd", "description": "unhelpful tips"}
EOF

✅ Yielding

"dwd","tips"
"not-dwd","unhelpful tips"

Had to do this for a lot of data yesterday, did not want to program a solution.

💡 Tip: You typed message in capitals and wanted it in lower case:

copy it to your clipboard then execute in the #CLI

 xsel -ob | tr 'A-Z' 'a-z' | xsel -ib

Now paste the contents of your clipboard

You can save this as a shell alias or function for convenience

#Linux #Ubuntu #CLI #DWDsTips

💡 #DWDsTips: limit the resources available to a program using systemd-run

 systemd-run --user --scope --property MemoryMax=250M --property MemorySwapMax=0M YourProgram

Take that, you RAM guzzling, Electron based, applications

Docs:

- https://www.freedesktop.org/software/systemd/man/latest/systemd-run.html
- https://www.freedesktop.org/software/systemd/man/latest/systemd.resource-control.html

#Linux #Ubuntu #CLI

systemd-run