Oddbean new post about | logout

Notes by xyzzy | export

 SF International High School (18th & De Haro, facing the street) 2005 - this was up for many years until one day *poof* painted over (quote by Lady Death in old Sandman comic) https://image.nostr.build/ac263d542cb5db58af9f1b3d0e4f9cdc59a20b4a1fb1f1b9d3b5f529429f8d31.jpg #photography #streetart #graffiti 
 San Francisco, 2002 - 1/3sec exposure, 400 iso https://image.nostr.build/e7f7838241fac04c74c468a03ef874a9df16b7fa5fdd77bb35f047d0960f373c.jpg #photography #sanfrancisco 
 Seefeld, Austria 2001 - cheap 110 disposable film, weather damaged https://image.nostr.build/6e209905c1a6888195440d33947205a581050d42d2801b55366dcfac20af1b05.jpg #photography #austria 
 who do we like for DNS hosting these days? 
 Linode and Vultr DNS have been working reliably for years across the globe, I find the actual webUI for Linode DNS management to be better (as in how it's organized, laid out and presented) than most others I've tried as well as clean zone exports for backup. I run $5 VPS to pay for it so to speak rather than relying on free access, but you can use both their DNS for free if so inclined. 
 I have nothing for or against njalla, had to search who they were right now - prices don't seem very competitive and for use as a _business_ (per your need) they offer little information about their actual datacenters and redendancy of infrastructure. seems targeted at a very specific niche of super-privacy conscious individuals who are willing to pay a premium for anonymization   
 Bash - a small function which can both display output and log the actions of most any command (avoid sed due to it's nature):

    # run action, log output, return exit code
    # - passing in 'sed' should be avoided
    # - functions can only return 0..254
    # -- set a global to check as needed
    ACTLOG="/tmp/action.log"
    _ACTRET=0
    function logact() {
      local ACTION
      ACTION="$*"
      ${ACTION} 2>&1 | tee -a "${ACTLOG}"
      _ACTRET=${PIPESTATUS[0]}
      return ${_ACTRET}
    }

Usage examples:

    logact mkinitcpio -p linux
    logact pacman -Syu --noconfirm --noprogressbar
    logact systemctl enable sshd.service

#bash #linux #opensource 
 Linux - have a subprocess stuck on a network connection, want to kill that connection to force it to create a new one? "ss" (part of iproute2 package) can do that for you. Using rclone as the example, pretend it's been launched by the backup tool (restic, duplicity, etc.) and stuck talking to a remote host.

Find the process and it's stalled TCP connection:

    ps axo pid,comm | grep [r]clone
    # 6874 rclone

    ss -ntp | grep [r]clone | awk '{print $5, $6}'
    # 74.120.9.121:443 users:(("rclone",pid=6874,fd=9))

Pause the process, kill the connection (as root), resume the process:

    kill -STOP 6874
    sudo ss -K dst 74.120.8.14 dport 443
    kill -CONT 6874

Requires a modern kernel (>=4.9) with CONFIG_INET_DIAG_DESTROY compiled into the kernel.

#linux #networking #opensource 
 Bash - trim leading/trailing whitespace without having to resort to a tr/sed/awk/etc. pipe, using the "extglob" feature:

    # turn it on
    shopt -s extglob
    output="    This is a test    "

    # trim leading whitespaces
    output="${output##*( )}"

    # trim trailing whitespaces
    output="${output%%*( )}"
    echo "=${output}="

    # turn it off
    shopt -u extglob

#bash #linux #opensource 
 Linux - if you've run out of file descriptors but can manage to get to a shell without needing to open more, bash can handle the rest using built in features.

  builtin read -r NFM < /proc/sys/fs/file-max
  NFM=$(($NFM+1000))
  builtin echo $NFM > /proc/sys/fs/file-max

#linux #bash #opensource 
 Firefox - if you don't use DRM and have no plan on ever using or enabling DRM, disable the pop-in which occurs when visiting any DRM-infected website by adding to your user.js / prefs.js (about:config)

  user_pref("media.gmp-widevinecdm.enabled", false);
  user_pref("media.gmp-widevinecdm.visible", false);

#firefox #opensource #linux 
 Aye I do, I keep hundreds(?) of settings in my own git server repo, just posting selected snippets here and there in bite-sized chunks for nostr notes. 
 Nostr has the same content discoverability problem as other decentralized networks (Mastodon, Lemmy) in that if you're not connected to read from (not necessarily write to) the big popular relays, you end up missing content that doesn't seem to propagate.

  wss://relay.damus.io/
  wss://relay.primal.net/
  wss://relay.snort.social/
  wss://nos.lol/
  wss://nostr.land/

I've found through trial and error if you want to consume generic content like hashtags for animals (catstr, dogstr, etc.), art, photography and whatnot you really need to read from these 5 relays above; there's no right or wrong here and there are more if you're into coin stuff: https://stats.nostr.band/#relay_users

I'll mention if you want to see Mastodon bridged content there's also wss://relay.mostr.pub/ - I've found it has some unique hashtags not very popular on Nostr so if you're looking into niche content you might add this relay to produce more search results from that universe.

#nostr #relays 
 Some nostr webapps may need a relaxed CORS header set in Nginx to allow access to your self-hosted NIP-05 nostr.json identity file; generally useful for most .well-known/ content depending on details:

  location ~ /\.well-known {
    allow all;
    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET' always;
  }

Add it to your Nginx virtual server definition after any other location exact path (=) or forward-match (^-) items, before any final generic prefix matches (location /...) but as it's a very wide open security policy, make sure it only applies to specific files/folders you don't mind/care being sourced from anywhere. Using "/\well-known/nostr\.json" e.g. would limit the policy to just that one file.

#nginx #nostr #linux 
 Disable the Firefox notification pop-in (?) "add (website.name) as a handler for web+nostr links?" which has no option to never ask you again by adding to your (profile dir)/user.js (or about:config which gets saved to prefs.js): 

    user_pref("network.protocol-handler.external.web+nostr", false);

This pop-in happens when a Nostr webapp uses the javascript function "registerProtocolHandler()" [1] to add itself as the preferred webapp. You can extend this to any "protocol" known or unknown by just using the name of whatever that webapp is trying to register (there's a list of known types in the footnote link).

#firefox #nostr #webapp

[1] https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler 
 The Tidradio TD-H3 is a solid build quality, inexpensive, Linux-friendly handheld if you're looking to get your GMRS or HAM license. It's CHIRP supported as well as their own Android bluetooth app (which works fine, bit finicky but works) and a 3rd party dev has a firmware flash utility[1] which works 100% fine in Linux; there's an unreleased firmware running around[2] which has worked great for me as well. This is the LCD panel sitting on the bench outside in the shade of a tree, very readable:

https://image.nostr.build/43b7f4358c1a100ea58b4a44013252bf12db61675ca771ae41b33572c76a5efc.jpg 

Using a few magic knob combos found on search engines you can even flip the operation between GMRS/HAM/Unlocked but it'll wipe the EEPROM so be careful. Definitely recommend the longer N771 whip antennae over the rubber ducky, I've received feedback on my local repeater I sound crystal clear while sitting inside the house using it (it came included with the radio). Only real downside is it's not IP67/IP68/etc. for inclement weather use. The NOAA, AM and FM receive great as well as just tooling around on VFO for random signals. It's fun to tinker with, honestly.

#linux #gmrs #ham #tidradio

[1] https://github.com/nicsure/TDH3Flash
[2] https://forums.radioreference.com/threads/tidradio-td-h3-ptt-id-issue.476627/ 
 Is it possible to follow hashtags? 
 I know this thread is old, I really would like to refresh this feature making it into nostrudel. Side comment, the gallery view when viewing #catstr e.g. is fantastic, just as good as slidestr.net so thanks!