- 0 Posts
- 12 Comments
I often want to know the status code of a
curl
request, but I don’t want that extra information to mess with the response body that it prints to stdout.What to do?
Render an image instead, of course!
curlcat
takes the same params ascurl
, but it uses iTerm2’simgcat
tool to draw an “HTTP Cat” of the status code.It even sends the image to stderr instead of stdout, so you can still pipe
curlcat
tojq
or something.#!/usr/bin/env zsh stdoutfile=$( mktemp ) curl -sw "\n%{http_code}" $@ > $stdoutfile exitcode=$? if [[ $exitcode == 0 ]]; then statuscode=$( cat $stdoutfile | tail -1 ) if [[ ! -f $HOME/.httpcat$statuscode ]]; then curl -so $HOME/.httpcat$statuscode https://http.cat/$statuscode fi imgcat $HOME/.httpcat$statuscode 1>&2 fi cat $stdoutfile | ghead -n -1 exit $exitcode
Note: This is macOS-specific, as written, but as long as your terminal supports images, you should be able to adapt it just fine.
kibiz0r@midwest.socialto Linux@lemmy.ml•Progress towards universal Copy/Paste shortcuts on LinuxEnglish7·4 months agoIt’s the #1 thing that drives me crazy about Linux.
It seems obvious. You’ve got a Windows/Apple/Super key and a Control key. So you’d think Control would be for control characters and Windows/Apple/Super would be for application things.
I can understand Windows fucking this up, cuz the terminal experience is such a low priority. But Linux?
There’s some projects like Kinto and Toshy which try to fix it, but neither work on NixOS quite yet.
kibiz0r@midwest.socialto Linux@lemmy.ml•how to investigate unexpected power management behaviorEnglish3·5 months agoupower -d can provide some useful info on-demand. I think there’s a daemon component to it too, which may have variable log levels.
kibiz0r@midwest.socialto Selfhosted@lemmy.world•Trump cuts funding to FOSS projects.English82·5 months agoIt’s okay, Let’s Encrypt only provides SSL certs for… 63.7% of the market?
Okay okay, that is a lot. But what does a CA need funding for anyway? It doesn’t take much bandwidth to send out new certs.
The only thing that could be expensive is if they had to rapidly invalidate thousands of certs to protect the security of the entire internet.
But haha, that’s a pretty outlandish scenario that would never happen.
kibiz0r@midwest.socialto Linux@lemmy.ml•Which areas of Linux would benefit most from further standardization?English0·5 months agoNot really. There are barely any chips out there.
Oct 2021: 200 billion ARM chips
Nov 2023: 1 billion RISC-V chips, hoping to hit 16 billion by 2030
Nov 2024: 300 billion ARM chips
Cool, but… why not just NixOS?
kibiz0r@midwest.socialto Linux@lemmy.ml•Which areas of Linux would benefit most from further standardization?English0·5 months agoARM support. Every SoC is a new horror.
Armbian does great work, but if you want another distro you’re gonna have to go on a lil adventure.
kibiz0r@midwest.socialto PC Gaming@lemmy.ca•'Is this a practical way to play your Steam games? Nope, not even a little bit.' But getting Steam running on Armbian and a single board computer really is a thingEnglish0·5 months agoSteam on ARM?! Gimme gimme gimme!!!
kibiz0r@midwest.socialto PC Gaming@lemmy.ca•Pacific Drive developers change their mind: A year after refusing to give it mid-run saves, it's getting mid-run savesEnglish0·5 months agoI’m fine with that. That’s how I’d prefer to play anyway. It’s just hard to commit 1-2 hours to completing a run sometimes.
kibiz0r@midwest.socialto PC Gaming@lemmy.ca•Steam Deck won't have yearly refreshes because it's "not really fair to your customers", says Valve0·10 months agoYearly refreshes make a lot more sense for phones, where the OS defines a lot more of the app lifecycle and common features, consumers might be interested in non-performance hardware upgrades like cameras, and things tend to be less spec-sensitive in the first place.
For a gaming device, giving devs an uneven foundation and users a confusing compatibility matrix would spell doom.
Edit: I should probably clarify that I wasn’t saying a yearly refresh for phones is good. Just that the context of Android+iOS is very different from the Steam Deck, and that context makes more frequent refreshes more attractive to consumers and less damaging to developers than it would be if applied to the Steam Deck also.
Edit 2: I also just realized this is not the same story as the one a day or two ago that drew a direct comparison to phones. So I guess I should’ve gone back and commented on that one instead. I just wanted to share cuz I’ve had a lot of meetings about device support and consumer upgrade habits, as a mobile dev and as a game dev, and I don’t think most people would guess quite how different those two worlds are.
Eh, every distro is trade-offs. There’s not a straightforward “better or worse”.
The worst mistake you could make? Making it hard for you to change your mind later.
So take notes on what you modify, try to keep your data/configs consolidated so you could easily migrate to a new distro, etc.
And ideally have your hardware set up so that you can try booting a new distro without losing your existing setup.