HNHacker News
TopNewBestAskShowJobs

junkblocker

73 karma · joined December 5, 2012

submissionscomments
junkblocker··on Ask HN: What are you reading?
Vacuum Diagrams by Stephen Baxter because I have no attention span and wanted to read most Space Operas. It goes through his Xeelee series' history of the universe and beyond in small individual chapters.
junkblocker··on Reddit is putting more limits on old.reddit.com
For days, even after login, neither the automatic redirect, nor the 'click this link' page redirects properly if it all. Clicking it multiple times, sometimes works. The login also seems to expire quite frequently. So it's even worse than stated.
junkblocker··on Gravity seems holographic. What does that mean for reality?
That's old news. They solved five a while ago.
junkblocker··on Yt-Dlp Sequence Diagrams
YTDLnis has been working much better for months now. Switched over from Seal myself.
junkblocker··on Uv is fantastic, but its package management UX is a mess
Here's something I ran into recently. An `env` script started showing up in my path messing with my plain UNIX `env` command usage. Turns out uv's installer creates this when you run

curl -LsSf https://astral.sh/uv/install.sh | sh

  1202│    # In this case we need to:¬
  1203│    #¬
  1204│    # * Install to $HOME/.cargo/bin/¬
  1205│    # * Create a shell script at $HOME/.cargo/env that:¬
  1206│    #   * Checks if $HOME/.cargo/bin/ is on PATH¬
  1207│    #   * and if not prepends it to PATH¬
  1208│    # * Ed
 
What kind of programmers are writing this stuff overriding my default unix commands with this?
junkblocker··on Niri 26.04: Scrollable-tiling Wayland compositor
https://github.com/karinushka/paneru is much more Niri like. I tried both but OmniWM just overwhelmed me with its options and noisy animations while paneru is very smooth, more stable and non-intrusive feeling like niri.
junkblocker··on Hacker News CLI (2014)
Somebody recently vibecoded https://github.com/fragmede/nitpick and posted here which is pretty good but I really want to browse the sites in terminal too. Then I discovered I have had an hn alias to lynx gopher://hngopher.com . w3m also works but I want to be able to browser with full w3m images support but most sites just break on needing JavaScript. Some front end to a headless chrome/Firefox instance like brow6el or awrit might work but I haven't attempted those with much success yet
junkblocker··on Cherri – programming language that compiles to an Apple Shortuct
You ask it to read the docs or site and create a 'skill' out of it.
junkblocker··on 24 Hour Fitness won't let you unsubscribe from marketing spam, so I fixed it
Applied to a job at Oracle 3 years ago. For a couple of years their unsubscribe link went to a broken page . Now they totally ignore my unsubscription choice and keep sending me job offers anyway
junkblocker··on Show HN: difi – A Git diff TUI with Neovim integration (written in Go)
"What is that, a gif for Ants?"

It's really hard to see what is going on in that small blurry demo gif. So please make it bigger in addition to parent's suggestions.

junkblocker··on Scripts I wrote that I use all the time
I had found a zsh version somewhere which I've updated a few times over the years though I don't get a chance to use it much. :'D

    un () {
 unsetopt extendedglob
 local old_dirs current_dirs lower do_cd
 if [ -z "$1" ]
 then
  print "Must supply an archive argument."
  return 1
 fi
 if [ -d "$1" ]
 then
  print "Can't do much with directory arguments."
  return 1
 fi
 if [ ! -e "$1" -a ! -h "$1" ]
 then
  print "$1 does not exist."
  return 1
 fi
 if [ ! -r "$1" ]
 then
  print "$1 is not readable."
  return 1
 fi
 do_cd=1 
 lower="${(L)1}" 
 old_dirs=(*(N/)) 
 undone=false 
 if which unar > /dev/null 2>&1 && unar "$1"
 then
  undone=true 
 fi
 if ! $undone
 then
  INFO="$(file "$1")" 
  INFO="${INFO##*: }" 
  if command grep -a --line-buffered --color=auto -E "Zstandard compressed data" > /dev/null <<< "$INFO"
  then
   zstd -T0 -d "$1"
  elif command grep -a --line-buffered --color=auto -E "bzip2 compressed" > /dev/null <<< "$INFO"
  then
   bunzip2 -kv "$1"
  elif command grep -a --line-buffered --color=auto -E "Zip archive" > /dev/null <<< "$INFO"
  then
   unzip "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "RAR archive" > /dev/null
  then
   unrar e "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E 'xar archive' > /dev/null
  then
   xar -xvf "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "tar archive" > /dev/null
  then
   if which gtar > /dev/null 2>&1
   then
    gtar xvf "$1"
   else
    tar xvf "$1"
   fi
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "LHa" > /dev/null
  then
   lha e "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "LHa" > /dev/null
  then
   lha e "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "compress'd" > /dev/null
  then
   uncompress -c "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "xz compressed" > /dev/null
  then
   unxz -k "$1"
   do_cd=0 
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "7-zip" > /dev/null
  then
   7z x "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "RPM " > /dev/null
  then
   if [ "$osname" = "Darwin" ]
   then
    rpm2cpio "$1" | cpio -i -d --quiet
   else
    rpm2cpio "$1" | cpio -i --no-absolute-filenames -d --quiet
   fi
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "cpio archive" > /dev/null
  then
   cpio -i --no-absolute-filenames -d --quiet < "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E "Debian .* package" > /dev/null
  then
   dpkg-deb -x "$1" .
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i " ar archive" > /dev/null
  then
   ar x "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "ACE archive" > /dev/null
  then
   unace e "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "ARJ archive" > /dev/null
  then
   arj e "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "xar archive" > /dev/null
  then
   xar -xvf "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "ZOO archive" > /dev/null
  then
   zoo x "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -Ei "(tnef|Transport Neutral Encapsulation Format)" > /dev/null
  then
   tnef "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "InstallShield CAB" > /dev/null
  then
   unshield x "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -Ei "(mail|news)" > /dev/null
  then
   formail -s munpack < "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "uuencode" > /dev/null
  then
   uudecode "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "cab" > /dev/null
  then
   cabextract "$1"
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E -i "PPMD archive" > /dev/null
  then
   ln -s "$1" . && ppmd d "$1" && rm `basename "$1"`
  elif [[ $lower == *.zst ]]
  then
   zstd -T0 -d "$1"
  elif [[ $lower == *.bz2 ]]
  then
   bunzip2 -kv "$1"
  elif [[ $lower == *.zip ]]
  then
   unzip "$1"
  elif [[ $lower == *.jar ]]
  then
   unzip "$1"
  elif [[ $lower == *.xpi ]]
  then
   unzip "$1"
  elif [[ $lower == *.rar ]]
  then
   unrar e "$1"
  elif [[ $lower == *.xar ]]
  then
   xar -xvf "$1"
  elif [[ $lower == *.pkg ]]
  then
   xar -xvf "$1"
  elif [[ $lower == *.tar ]]
  then
   if which gtar > /dev/null 2>&1
   then
    gtar xvf "$1"
   else
    tar xvf "$1"
   fi
  elif [[ $lower == *.tar.zst || $lower == *.tzst ]]
  then
   which gtar > /dev/null 2>&1
   if [[ $? == 0 ]]
   then
    gtar -xv -I 'zstd -T0 -v' -f "$1"
   elif [[ ${OSTYPE:l} == linux* ]]
   then
    tar -xv -I 'zstd -T0 -v' -f "$1"
   else
    zstd -d -v -T0 -c "$1" | tar xvf -
   fi
  elif [[ $lower == *.tar.gz || $lower == *.tgz ]]
  then
   which gtar > /dev/null 2>&1
   if [[ $? == 0 ]]
   then
    gtar zxfv "$1"
   elif [[ ${OSTYPE:l} == linux* ]]
   then
    tar zxfv "$1"
   else
    gunzip -c "$1" | tar xvf -
   fi
  elif [[ $lower == *.tar.z ]]
  then
   uncompress -c "$1" | tar xvf -
  elif [[ $lower == *.tar.xz || $lower == *.txz ]]
  then
   which gtar > /dev/null 2>&1
   if [[ $? == 0 ]]
   then
    xzcat "$1" | gtar xvf -
   else
    xzcat "$1" | tar xvf -
   fi
  elif echo "$INFO" | command grep -a --line-buffered --color=auto -E 'gzip compressed' > /dev/null || [[ $lower == *.gz ]]
  then
   if [[ $lower == *.gz ]]
   then
    gzcat -d "$1" > "${1%.gz}"
   else
    cat "$1" | gunzip -
   fi
   do_cd=0 
  elif [[ $lower == *.tar.bz2 || $lower == *.tbz ]]
  then
   bunzip2 -kc "$1" | tar xfv -
  elif [[ $lower == *.tar.lz4 ]]
  then
   local mytar
   if [[ -n "$(command -v gtar)" ]]
   then
    mytar=gtar 
   else
    mytar=tar 
   fi
   if [[ -n "$(command -v lz4)" ]]
   then
    $mytar -xv -I lz4 -f "$1"
   elif [[ -n "$(command -v lz4cat)" ]]
   then
    lz4cat -kd "$1" | $mytar xfv -
   else
    print "Unknown archive type: $1"
    return 1
   fi
  elif [[ $lower == *.lz4 ]]
  then
   lz4 -d "$1"
  elif [[ $lower == *.epub ]]
  then
   unzip "$1"
  elif [[ $lower == *.lha ]]
  then
   lha e "$1"
  elif which aunpack > /dev/null 2>&1
  then
   aunpack "$@"
   return $?
  else
   print "Unknown archive type: $1"
   return 1
  fi
 fi
 if [[ $do_cd == 1 ]]
 then
  current_dirs=(*(N/)) 
  for i in {1..${#current_dirs}}
  do
   if [[ $current_dirs[$i] != "$old_dirs[$i]" ]]
   then
    cd "$current_dirs[$i]"
    ls
    break
   fi
  done
 fi
    }
junkblocker··on Introduction to GrapheneOS
There did not seem to be an RCS story. Whether the device is RCS capable or not seems to be up to some unfathomable Google logic the tickling of which didn't work for me. Having old RCS chat histories and new RCS chats not work made me go back to stock quick.
junkblocker··on A proposal to restrict sites from accessing a users’ local network
Relevant Firefox extension - https://addons.mozilla.org/en-US/firefox/addon/behave/
junkblocker··on Yahoo change their ToS to let them scrape your email content
Quoting

    Use of AI and Third-Party AI Providers. Some of our Services have features and functionality powered by our trusted third-party AI providers (“AI Providers”). AI-powered chat service provided by Microsoft Copilot relies on search services from Bing. By utilizing our Services, you consent to sharing data that you provide to us, or that resides within your Yahoo account, including your Yahoo Mail inbox with our AI Providers for the purpose of enhancing features within our Services made available to you. In some instances, use of AI query features may be governed by the AI Provider’s terms of service and privacy policy. You understand and agree that content or responses generated by AI may contain inaccuracies and should never be relied upon without independent verification. Yahoo does not control the content or responses provided by AI Providers, and makes no representations or warranties about the accuracy or completeness of such content or responses (or the sites and sources accessed through such content or responses). You also agree not to enter sensitive personal information into any AI powered query.
junkblocker··on Linux Text Manipulation
TIL a neat way to add comments to continued shell lines. Thanks!
junkblocker··on $HOME, not so sweet $HOME
Regarding ~/.cargo (and other tools), I've had some success with following suggestions from https://github.com/b3nj5m1n/xdg-ninja
junkblocker··on Show HN: Redo – Command line utility for quickly creating shell functions
I use this https://github.com/erichs/composure which seems to do more.
junkblocker··on Starship: Cross-shell prompt written in Rust
Oh, you are right! This works by looking at /proc/$ppid/fd/1

    format = """$all\
    ${custom.tty}"""

    [custom.tty]
    description = "tty"
    when = 'true'
    command = """
    tpid=$(ps -o pid= -p "$(($(ps -o sid= -p "$$")))")
    tpid=$(( tpid + 0 ))
    readlink /proc/$tpid/fd/1 | sed -e 's|/dev/||'
    """
    format = ' [$output]($style)'
    shell = ["bash", "--noprofile", "--norc"]
    style = 'blue'
junkblocker··on Starship: Cross-shell prompt written in Rust
Since I was trying out nushell, I came across Starthip which supports nushell! I noticed that prompt managers which run non-shell binaries may be unable to support things like showing the tty since I assume they are execing any external tools (/usr/bin/tty) in a non-tty environment. But still very cool to have the same prompt run unmodified in zsh, bash, nushell etc. The git VCS performance in it is pretty good too even in large monorepos.
junkblocker··on Code Review from the Command Line
I wrote https://github.com/junkblocker/patchreview-vim for exactly that workflow.
junkblocker··on Show HN: Yarr – Yet Another RSS Reader
> Anyone have a browser extension that can find rss feeds for pages?

I wrote/use this greasemonkey script - https://greasyfork.org/en/scripts/6261-rss-atom-feed-subscri... - it still mostly works but strict CSP on sites these days has been causing some trouble. Maybe turning it into a browser extension is the thing to do.

junkblocker··on Show HN: Yarr – Yet Another RSS Reader
> Anyone have a browser extension that can find rss feeds for pages?

I wrote/use this greasemonkey script - https://greasyfork.org/en/scripts/6261-rss-atom-feed-subscri... - it still mostly works but strict CSP on sites these days has been causing some trouble. Maybe turning it into a browser extension is the thing to do.

junkblocker··on Show HN: YouTube Search Fixer – Firefox addon that removes unrelated suggestions
This addon makes is super easy and convenient to inspect any addon's source code

https://addons.mozilla.org/en-US/firefox/addon/crxviewer/

junkblocker··on LICEcap: Simple Animated Screen Captures
Sure, but there's no option to control which format it creates the capture in. Besides I end up ffmpeg converting it to mp4 and get a video about 10x smaller.
junkblocker··on LICEcap: Simple Animated Screen Captures
I believe it is mov instead of mp4. mp4 would be great since it takes much much less space.
junkblocker··on Apple neutered ad blockers in Safari, and users didn't say a thing
Really? That was downvote worthy?
junkblocker··on Apple neutered ad blockers in Safari, and users didn't say a thing
Maybe there aren't that many Safari users at all and the remaining just moved to Firefox/Chrome.
junkblocker··on Simon Tatham's Portable Puzzle Collection
I definitely have much better experience with the Android version than the iOS version. The iOS version has somewhat poorer control where a sliding motion is used. The display wants to slide in that case rather than the game control being used.

Love the collection!

junkblocker··on iTunes built, and then broke, my meticulous music-listening system
I tried to use Clementine every few months for a while but had SQLite crashes every time.
junkblocker··on A proof-of-concept of a vulnerability in custom shell prompt scripts
Since branch name parsing is done by a lot of scripts, and I can't control the default branch name, I've installed this global post-checkout hook for now until I can stop panicking and think clearly.

    #!/bin/sh
    prev_head=$1
    new_head=$2
    changing_branch=$3

    REPO_DIR="$(git rev-parse --show-toplevel 2>/dev/null)"

    if [ "$changing_branch" = 1 -a "$prev_head" = "0000000000000000000000000000000000000000" ]; then
        new_head_name="$(git name-rev --name-only "$new_head"|sed -e 's|`|_|g' -e 's|$(|_|g')"
        new_head_name_untaint="$(git name-rev --name-only "$new_head"|sed -e 's|`|x|g' -e 's|$(|x|g')"
        if [ "$new_head_name" != "$new_head_name_untaint" ]; then
            echo "
    DANGER! INSECURE BRANCH NAME.
    ">&2
            git name-rev --name-only "$new_head"

            echo "
    MOVING $REPO_DIR TO TRASH.
    ">&2
            mkdir -p ~/.Trash
            mv "$REPO_DIR" "$HOME/.Trash/${REPO_DIR##*/}.$(date +"%Y%m%d%H%M%S")"
        fi
    fi
Page 1 of 3Next →