This was my thought as well because the problem resolves itself within a matter of minutes. However it doesn’t make sense that OP would have the same problem for multiple instances, and could access each instance in the browser without issue. Also, our instance showed 100% uptime when I initially checked the post so I’m not sure it’s that.
- 2 Posts
- 53 Comments
tuna@discuss.tchncs.deto PC Gaming@lemmy.ca•A Steam Deck-like experience for Windows 11 handhelds is coming, leak suggestsEnglish4·3 months agoI’m not sure, but I think the windows progress bar thingy includes the time spent actually writing to disk, whereas on Linux (or i guess cinnamon) only shows when it gets to disk-cache. If you are full on RAM or tried shutting down immediately afterwards it should take a bit longer since it has to actually write it to disk
Thats my guess anyway
Thats a good observation. I would think I use Ctrl more frequently than Alt, so it would make sense to have Alt where Ctrl usually is, and Ctrl where Shift usually is.
Interesting, I’ll have to check it out. I’ve been passively wanting to leave brave on iOS for some time now. Thank you!
Nope. I use left shift for everything.
Even if you do use both shift keys correctly, it still feels awkward to me since you have to sacrifice a pinky from home row and shift your hands.
It’s why I’ve been curious to try a layout where Shift and Alt are swapped, that way you can use your thumb to press shift and keep your fingers in place.
tuna@discuss.tchncs.deOPto Linux@lemmy.ml•Linux Terminal: CTRL+D is like pressing ENTER1·4 months agoOhh I gotcha. Honestly no sweat, its kind of just a bit of fun trivia really :)
tuna@discuss.tchncs.deOPto Linux@lemmy.ml•Linux Terminal: CTRL+D is like pressing ENTER2·4 months agoInteresting, I have not heard of these terms before. Thanks for sharing!
I think this adds the bit of nuance that was bugging me: using something like ncurses or vim, presumably when you press a key like ctrl-z or ctrl-d it actually sends the character to the app. It would feel a bit silly if the terminal intercepted the ctrl-d, flushed some buffer, and the program had to reverse engineer whether you pressed ctrl-d or enter or something.
For raw mode, I assume the app asks the tty to please forward some characters to the app. Otherwise, in the default cooked mode, the tty intercepts those control characters to call certain functions. I suppose some REPLs may choose to emulate a cooked mode on top of raw mode, and so they have to handle the \x04 in the same way a tty would to keep it functioning like the user expects. I believe
readline
does something like this, which is why you had to usebash --noediting
for ctrl-d to run the command. Good food for thought :)I also have to say, naming it “cooked mode” is extremely funny as gen z. I love that
tuna@discuss.tchncs.deOPto Linux@lemmy.ml•Linux Terminal: CTRL+D is like pressing ENTER52·4 months ago$ cat You sound very nice :) You sound very nice :) Bye<ctl-d>Bye Oh wait, and cool too Oh wait, and cool too <ctl-d> $
The Ctl-D didn’t end the file when i typed “Bye” :( it only worked when I pressed Ctl-D on its own line. So how does cat know that it should ignore the EOF character if there is some text that comes before it?
What Ctl-D does is flush the input to the program, and the program sees how big that input is. If the length of the input is 0 that is interpreted as EOF. So Ctl-D is like Enter because they both flush the input, but Ctl-D is unlike Enter because it does not append a newline before flushing, and as a consequence you can send empty input (aka an EOF “character”) with Ctl-D.
tuna@discuss.tchncs.deOPto Linux@lemmy.ml•Linux Terminal: CTRL+D is like pressing ENTER122·4 months agoOn any reasonable terminal, RETURN has a key of its own
This reminds me of a time at work when I was not on a reasonable terminal. I was explaining to a co-worker how I automated some tasks by running some scripts, but in my demo my RETURN key didn’t work, so I had to improvise and use CTRL+M which worked, hahaha. I don’t know how the terminal got in such a bad spot but it was probably something to do with msys on Windows… honestly not sure. It was perfect timing to have happen while teaching of course ;)
I would also be doing a disservice not to share what the book you linked says about CTRL+D. Right after your quote, it says:
Other control characters include ctl-d, which tells a program that there is no more input
This is pretty good for an introduction, but it is not the full story. It explains CTRL+D properly later (chapter 2, page 45):
Now try something different: type some characters and then a ctl-d rather than a RETURN:
$ cat -u 123<ctl-d>123
cat
prints the characters out immediately. ctl-d says, “immediately send the characters I have typed to the program that is reading from my terminal.” The ctl-d itself is not sent to the program, unlike a newline. Now type a second ctl-d, with no other characters:$ cat -u 123<ctl-d>123<ctl-d>$
The shell responds with a prompt, because
cat
read no characters, decided that meant end of file, and stopped. ctl-d sends whatever you have typed to the program that is reading from the terminal. If you haven’t typed anything, the program will therefore read no characters, and that looks like the end of the file. That is why typing ctl-d logs you out — the shell sees no more input. Of course, ctl-d is usually used to signal an end-of-file but it is interesting that it has a more general function.This is why the article says it’s “like pressing enter,” because it flushes the input just like enter. The difference is that enter sends a newline, but CTRL+D does not, so you can exploit that to send no data (and the program chooses to interpret that as an EOF).
tuna@discuss.tchncs.deOPto Linux@lemmy.ml•Linux Terminal: CTRL+D is like pressing ENTER31·4 months agonot true. try this:
$ date<C-d>
bash did not terminate stdin, because when i press enter it still runs the command, and my shell continues to work as normal!
you can also try this:
$ bash --noediting $ date<C-d><C-d>
and it will print the date.
so something else is happening here! thats what the link talks about in detail
Aw man :( Asahi Lina and her GPU project has been an inspiration for me. Hope she is alright.
tuna@discuss.tchncs.deto Selfhosted@lemmy.world•Advice on how to deal with AI bots/scrapers?English11·5 months agothis might not be what you meant, but the word “tar” made me think of tar.gz. Don’t most sites compress the HTTP response body with gzip? What’s to stop you from sending a zip bomb over the network?
tuna@discuss.tchncs.deto No Stupid Questions@lemmy.world•Why do people see me as far older than 19 when I type the way I do sometimes?/Why do people think full stops are rude?1·5 months agoTo me, sentences ending in a period feel immutable, and without nuance, but sentences without a period feel incomplete, or up to change. Without periods it is almost a way to say, “this is what I think right now, but I might reconsider.” So, it’s not that periods are rude per-se, but it may appear that you’ve made up your mind and are closed off to interpretation. Sometimes I intentionally remove periods or turn it into an ellipsis for exactly that reason. It’s just way too easy to misinterpret people’s intentions through text for me not to type in a way I think reduces misinterpretation.
As for being associated with older people… anecdotally speaking, my co workers sound like they were taught that there is an immutable, proper way in the world, and so they express themself in that proper way. Nothing wrong with that really! Once I get a feel for their personality, I find it kind of endearing :)
tuna@discuss.tchncs.deto Linux@lemmy.ml•[Solved] Convert commonmark links to Headings with spaces to GitHub flavored markdown.1·5 months agoNo problem. I think this is a great “final boss” question for learning sed, because it turns out it is deceptively hard!! You have to understand not only a lot about regex, but about sed to get it right. I learned a lot about sed just by tackling this problem!
I really do not want to mess around with your regex
It is very delicate for sure, but one part you can for sure change is at the
# Add hyphens
part. In the regex you can see(%20|\.)
. These are a list of “characters” which get converted to hyphens. For example, you could modify it to(%20|\.|\+)
and it will convert+
s to-
s as well!Still it is not perfect:
- If the link spans multiple lines, the regex won’t match
- If the link contains escaped characters like
\\\\\[LINK](#LINK)
or[
]\\\\]( - If the link is inside a code block ``` it will get changed (which may or may not be intended)
But for a sed-only solution this is about as good as it will get I’m afraid.
Overall I’m very happy with it. Someday I would like to make a video that goes into depth about sed, since it is tricky to learn just from the docs.
tuna@discuss.tchncs.deto Linux@lemmy.ml•[Solved] Convert commonmark links to Headings with spaces to GitHub flavored markdown.2·5 months agoI did it!! It also handles the case where an external link and internal link are on the same line :D
sed -E ':l;s/(\[[^]]*\]\()([^)#]*#[^)]*\))/\1\n\2/;Te;H;g;s/\n//;s/\n.*//;x;s/.*\n//;/^https?:/!{:h;s/^([^#]*#[^)]*)(%20|\.)([^)]*\))/\1-\3/;th;s/(#[^)]*\))/\L\1/;};tl;:e;H;z;x;s/\n//;'
Here is my annotated file
# Begin loop :l; # Bisect first link in pattern space into pattern space and append to hold space # Example: `text [label](file#fragment)' # Pattern space: `file#fragment)' # Hold space: `text [label](' # Steps: # 1. Strategically insert \n # 1a. If this fails, branch out # 2. Append to hold space (this creates two \n's. It feels weird for the # first iteration, but that's ok) # 3. Copy hold space to pattern space, remove first \n, then trim off # everything past the second \n # 4. Swap pattern/hold, and trim off everything up to and incl the last \n s/(\[[^]]*\]\()([^)#]*#[^)]*\))/\1\n\2/; Te; H; g; s/\n//; s/\n.*//; x; s/.*\n//; # Modify only if it is an internal link /^https?:/! { # Add hyphens :h; s/^([^#]*#[^)]*)(%20|\.)([^)]*\))/\1-\3/; th; # Make lowercase s/(#[^)]*\))/\L\1/; }; # "conditional" branch so it checks the next conditional again tl; # Exit: join pattern space to hold space, then move to pattern space. # Since the loop uses H instead of h, have to make sure hold space is empty :e; H; z; x; s/\n//;
tuna@discuss.tchncs.deto Linux@lemmy.ml•[Solved] Convert commonmark links to Headings with spaces to GitHub flavored markdown.1·5 months agoI’ll give another go at it :)
tuna@discuss.tchncs.deto Linux@lemmy.ml•[Solved] Convert commonmark links to Headings with spaces to GitHub flavored markdown.3·5 months agoWhy you assume there’s only one link in the line?
They did not want external (http) links to be modified as that would break it:
- ✅
[Example](https://example.com/#Some%20Link)
- ❌
[Example](https://example.com/#some-link)
I compromised by thinking that it might be unlikely enough to have an external http link AND internal link within the same line. You could probably still do it, my first thought was
[^h][^t][^t][^p]
but that would cause issues for#ttp
and#A
so i just gave up. Instead I think you’d want a different approach, like breaking each link onto their own line, do the same external/internal check before the substitution, and join the lines afterward.Also, you perform substitutions in the whole URL instead of the fragment component
That requirement i missed. I just assumed the filename would be replaced the same way too Lol. Not too hard to fix tho :)
- ✅
tuna@discuss.tchncs.deto Linux@lemmy.ml•[Solved] Convert commonmark links to Headings with spaces to GitHub flavored markdown.4·5 months agoannotated it is working like this:
# use a loop to iteratively replace the %20 with -, since doing s/%20/-/g would replace too much. we loop until it cant substitute any more # label for looping :loop; # skip the following substitute command if the line contains an http link in markdown format /\[[^]]*\](http/! # capture each part of the link, and join it together with - s/\(\[[^]]*\]\)\(([^)]*\)%20\([^)]*)\)/\1\2-\3/g; # if the substitution made a change, loop again, otherwise break t loop; # convert all insides to the link lowercase if the line doesnt contain an http link /\[[^]]*\](http/! # this is outside the loop rather than in the s command above because if the link doesnt contain %20 at all then it won't convert to lowercase s/\(\[[^]]*\]\)\(([^)]*)\)/\1\L\2/g
I’ve had it where my wireless mouse (connected with a usb dongle) stutters when my wifi/bluetooth chip is going full-throttle. I thought it was some polling rate on my mouse, or maybe my mouse was dying, but nah lol. This is next level insane tho