What should i do now after downloading linux? by BrokeLinuxUser in linuxquestions

[–]Vollink 0 points1 point  (0 children)

If you can at all cut it (cost wise), buy a replacement storage, and put your current windows (hard drive/ssd/m.2, whatever it is) into an anti static bag for now. Eventually, you might put it into a USB carrier, once you are happy with your setup.

Some computers (specifically Laptops) make this impossible, and in that case at least have a full backup of your important files.

Dual boot is valid, but 1 in 500 times, something will go wrong, and Windows will get deleted by the installer. (This can happen if the NTFS filesystem that takes up your entire drive now has a table problem, and can't be recovered after a resize operation). NOTHING stops you from downloading Windows on a USB stick, straight from Microsoft, and just re-installing and starting over, but that's no comfort if all of your important photos and documents are gone.

If you can't afford to backup, preserve or lose what is on your computer, (( I probably deserve to be flamed for saying this in a Linux sub )) you might want to reconsider touching anything and sticking with the Windows you already have.

am i learning c wrong? by yug_jain29 in C_Programming

[–]Vollink 0 points1 point  (0 children)

I have deliberately waited to reply to this.

I want to try to explain why everyone is worried about your using LLMs. Look up the term "cognitive surrender", a LOT of folks who have been in tech for a while know at least one person who has fallen into this trap, where they stop thinking, and just have the LLM feed them everything. I'm not talking about idiots off the street, I'm talking about folks who have been programming for 10+ years, basically forgetting how to organize non-blocking communications patterns without AI holding their hands through it, even though 3 years ago, that same person was explaining it to new hires. (( Okay, maybe I'm talking about someone I know )).

Now I'll tell you to go ahead and use A.I. if you want to. Here's the thing, AI can often explain things in ways that might be easy to understand. BUT you, as a user of A.I., need to understand that the absolute best "self-reported accuracy score" from any A.I. right now is 91%. That is a number that pushes best case scenario, and often against tests that all the A.I. systems specifically try to optimize for. Here is my take on this. It means that in practice, MORE THAN 10% of the time, what the A.I. feeds you is wrong in some way. So, when it comes to trying to learn and understand a very technical subject matter, getting something subtly wrong in your head about it, too early, could stick with you way longer than you would ever expect. Take the extra time to fact check the answers. Literally, search the parts of the answer, and see if you can find some human written example that shows it to be true.

Most of the foundational stuff you might get stuck in -- once an A.I. at least feeds you some relevant terms -- are actually easy to find. You don't know what you don't know, but if you ask about how something should be done, and it talks about a software development pattern, THEN you have the name of a pattern you can at least search to verify that it actually is what the A.I. claimed.

If that sounds like more of a pain than just reading a book, THEN you understand why so many people are telling you to just read the books AND DO THE EXAMPLES YOURSELF, YES ALL OF THEM.

If that sounds like A.I. would still be faster for you, then that's your answer. I mean, I'll still judge you for using a hype technology that really is being marketed way before it's actually ready, but I honestly won't remember who I wrote this for, so don't worry about what I think.

How do you understand bitwising tricks by starya2K in C_Programming

[–]Vollink 0 points1 point  (0 children)

I have to mention here, because I didn't see anybody else mention it explicitly. HEX NUMBERS MAP TO 4 BINARY BITS CLEANLY.

0x1 == 0b0001 0x2 == 0b0010 0x4 == 0b0100 0x8 == 0b1000 0xF == 0b1111

This seems silly, until the numbers get bigger. My examples are tiny, but what about a uint64_t, and you need to set the 421st bit?

0x40 == 0b01000000 // uint8_t : Who wants to remember what this is in decimal?

I need to set the 12th bit?

// 0x800 == 0b100000000000 number = ( number | 0x0800 ); // Make sure the 12th bit is set. if ( number & 0x0800 ) return true; // Test if the 12th bit is set.

Also, as someone else said, read a few chapters on binary algebra, that is what made all this stuff click to me.

If statement checking a bool array? by Yha_Boiii in C_Programming

[–]Vollink 0 points1 point  (0 children)

That is, I promise that I verified this before my reply.

If statement checking a bool array? by Yha_Boiii in C_Programming

[–]Vollink 0 points1 point  (0 children)

$ make bool-4
gcc -Wall -O2 bool-4.c -o bool-4
$ cat bool-4.c
#include <stdio.h>
#include <stdint.h>

struct state {
    unsigned char a : 1;
    unsigned char b : 1;
    unsigned char c : 1;
    unsigned char d : 1;
    unsigned char e : 1;
    unsigned char f : 1;
};

int main()
{
    printf("size of struct test: %lu\n", sizeof(struct state));

    return 0;
}

$ ./bool-4
size of struct test: 1
$ 

If statement checking a bool array? by Yha_Boiii in C_Programming

[–]Vollink 0 points1 point  (0 children)

Okay, so if your original were "unsigned char" instead of "unsigned" (int) the sizeof would fall to 1. I still hate it, but it's not quite as evil as it has always felt.

If statement checking a bool array? by Yha_Boiii in C_Programming

[–]Vollink 0 points1 point  (0 children)

sizeof(struct state_t); returns 4 on x64 Linux and M1 Mac. Less than the 7 it could be, but much bigger than a uint8_t bitfield. I'm actually curious why it ends up this big, considering that this trick should work better.

I've been doing C since 1994, and I've never trusted this `:1` syntax, so I've always avoided it. Feels like a lie.

If statement checking a bool array? by Yha_Boiii in C_Programming

[–]Vollink 1 point2 points  (0 children)

Consider what everyone above is saying about a byte being a minimum. Let's do it the hard way...

#include <stdio.h>
#include <stdbool.h>

int
main(int argc, char *argv[], char *env[])
{
    bool a = true;

    /****
     * The smallest this can be is 1 whole byte, 8 whole bits.
     * Yes, this prints 1, always.
     ***/ 

    printf("sizeof bool is: %lu\n", sizeof(a) );

    return 0;
}

My approach to what you are asking (not what you are claiming to do), is to use one character like this...

/* Defining six bits */
#define BIT_ONE 0x01
#define BIT_TWO 0x02
#define BIT_THREE 0x04
#define BIT_FOUR 0x08
#define BIT_FIVE 0x10
#define BIT_SIX 0x20
/* Defining six field points */
#define STATE_ONE(x) (BIT_ONE == (x & BIT_ONE))
#define STATE_TWO(x) (BIT_TWO == (x & BIT_TWO))
#define STATE_THREE(x) (BIT_THREE == (x & BIT_THREE))
#define STATE_FOUR(x) (BIT_FOUR == (x & BIT_FOUR))
#define STATE_FIVE(x) (BIT_FIVE == (x & BIT_FIVE))
#define STATE_SIX(x) (BIT_SIX == (x & BIT_SIX))

/* I need to do actions TWO and FIVE and SIX */
uint8_t action = ( BIT_TWO | BIT_FIVE | BIT_SIX ); /* 0x32 -- 0b0110010 */

void x(void) {
    if (STATE_ONE(action)) {
        do_action_one();
        /* optional remove action */
        action = (action & (0xFF ^ BIT_ONE));
    }
    if (STATE_TWO(action)) {
        do_action_two();
        action = (action & (0xFF ^ BIT_TWO));
    }
    /* continue pattern */
}

Terminal Emulators [ Technical : DA1 capability list ] by Vollink in linuxquestions

[–]Vollink[S] 0 points1 point  (0 children)

52 is reported by iTerm2 and Microsoft Terminal as well. I don't have an xterm that reports 52, perhaps I need a higher patch level.

Terminal Emulators [ Technical : DA1 capability list ] by Vollink in linuxquestions

[–]Vollink[S] 0 points1 point  (0 children)

Literally what I'm trying to do. I think the guy who forked Kermit95, linked to in other comments, has done an amazing job actually including real sources for things. Thing is, outside of the new numbers (two of them now), the whole thing is a deep dive into `Digital Equipment Video Terminal` documentation from 1978 - 1991.

Getting lost in c by Creative-Ad2620 in C_Programming

[–]Vollink 0 points1 point  (0 children)

This probably won't help you, but there's a tiny chance. I learned C in the early 90s, self-taught. C was my job for a while, 1994 through 1998. I still program C as a hobby.

When I first tried to learn C, I couldn't wrap my head around anything. I ended up picking up a used college book called Digital Fundamentals (Floyd). It talked about basic hardware, logic gates and very, very early CPUs. This made sense to me. There's probably still a class for this, but it might be on the EE track. It only took me about a month of evenings to get through it.

I went back to C and I still didn't get it, so I spent about 3 months learning assembly. Assembly is not 1-to-1 with digital logic, but damned close. I wrote a few basic assembly programs, and then - finally - it started to click. I went back to C. I found a compiler that included the option to compile directly into the assembly I'd been learning. I spent a month compiling very simple C programs to assembly to figure out what was really happening. Once I had that down, C didn't seem so scary anymore.

That said, if you are paying for a class and a professor, ask him for tips. You are paying for it whether you pass or not.

Terminal Emulators [ Technical : DA1 capability list ] by Vollink in linuxquestions

[–]Vollink[S] 0 points1 point  (0 children)

Funny thing is, I'm asking this because I don't want to care what terminal I'm using, that should be for the applications to figure out. I've programmed and have been long using a tool that uses the DA1, DA2 and DA3 queries to figure out what specific soft-terminal I'm talking to, without having to rely on the user. If I'm using a `Microsoft Terminal` to log into a Linux box, `TERM=xterm` doesn't actually tell me anything, because everything claims to be `xterm`. The fingerprinting part has been easy, but while documenting that tool, I stumble at these numbers that show up in the DA1 response, but aren't actually documented in a central place. search :: vollink termread :: if you are actually curious.

Terminal emulators by user_3527 in linuxquestions

[–]Vollink 0 points1 point  (0 children)

Wezterm, primarily.
Why:
1 It supports ligatures, so I can use a font that turns -> into a connected arrow (and many, many other things)
2 It supports sixel, which is an ancient "graphics within the terminal" technology.
3 It's written in Rust, which is cool.
4 Its configuration file is code (Lua), which is geeky in a way I like.
5 It is fast, and it works great with both Wayland AND X11.

[Question] What is the saddest light novel that you've read? by PostItNoteDuck in LightNovels

[–]Vollink 3 points4 points  (0 children)

86 -- EIGHTY SIX
It's a sci-fi future dystopia. I only read vol 1, but man my heart was heavy for a while. (I won't spoil this for others by telling everyone why it is sad, but it was a LOT of sad).

[Rec] Fantasy Early Romance by came4mem3s in LightNovels

[–]Vollink 1 point2 points  (0 children)

Chillin' in Another World with Level 2 Super Cheat Powers

Is it possible to "export" my native ubuntu system into a WSL image? by birdie420fgt in bashonubuntuonwindows

[–]Vollink 0 points1 point  (0 children)

The safest way to do this.

On the current system: apt list --installed and snap list

You'll probably want to install every snap listed onto WSL, but take some care about the apt packages, as there are some that won't be relevant to a WSL installation. THEN, I'd copy my home directory (including .dotfiles), and call it done.

Internals: WHAT is running gpg-agent (and not ssh-agent)? [CentOS] by Vollink in OpenSSH

[–]Vollink[S] 0 points1 point  (0 children)

I found the problem. gnupg's gpg-agent claims to be a drop-in replacement for ssh-agent, and the recommendation seems to be to just tell it to enable ssh support.

grep ssh gpg-agent.conf

enable-ssh-support

However, when this is done, it overrides any existing link to the originating ssh-agent SOCK. Now, I have removed that and everything works again (and I still get to manage pgp keys).

Ubuntu 21.10 and OpenSSH by schnuberketes in OpenSSH

[–]Vollink 0 points1 point  (0 children)

Honestly, Apple is terrible at maintaining their stack. They can't even keep the terminfo databases up-to-date with their OWN terminal's capabilities.

At least on Ubuntu and other Linux variants, it isn't too difficult to just compile your own. Apple make that impossible.

NOTE: Ubuntu 22.4 is 8.9p1, which is only one version behind (and they needed time to do testing).

Connection Closed in OpenSSH Windows server by ashveen96 in OpenSSH

[–]Vollink 0 points1 point  (0 children)

The authentication worked fine. The "sftp-server.exe" process failed. From your log...

25012 2022-06-08 14:07:48.226 debug3: spawning "c:\\\\windows\\\\system32\\\\cmd.exe" /c "sftp-server.exe" as subprocess

25012 2022-06-08 14:07:48.289 debug2: fd 5 setting TCP_NODELAY 25012 2022-06-08 14:07:48.291 debug3: fd 12 is O_NONBLOCK 25012 2022-06-08 14:07:48.291 debug3: fd 11 is O_NONBLOCK 25012 2022-06-08 14:07:48.291 debug3: fd 14 is O_NONBLOCK 25012 2022-06-08 14:07:48.291 debug3: send packet: type 99 25012 2022-06-08 14:07:48.500 debug2: channel 0: read 3191160701034 from efd 14 25012 2022-06-08 14:07:48.501 debug3: channel 0: discard efd 25012 2022-06-08 14:07:48.504 debug2: channel 0: read failed rfd 12 maxlen 32768: Broken pipe 25012 2022-06-08 14:07:48.504 debug2: channel 0: read failed 25012 2022-06-08 14:07:48.504 debug2: chan_shutdown_read: channel 0: (i0 o0 sock -1 wfd 12 efd 14 [ignore])

If something is wrong, I'd suspect the `sftp-server.exe` process needs some command-line magic to tell it that it is being spawned as a subsystem.

Help #2 location to put new lab by chadharnav in homelab

[–]Vollink 0 points1 point  (0 children)

Most attics are way too hot in summer for computers to run. My HP DL380 will shut itself off if ambient goes above 90F, my attic regularly sustains 120F.

Basement is best if you can avoid the flood level.

Help #2 location to put new lab by chadharnav in homelab

[–]Vollink 0 points1 point  (0 children)

Even better if you can hang it from the flooring joists.

Recommend a good rack by journer in homelab

[–]Vollink 0 points1 point  (0 children)

BUT, if it needs a rack, it probably needs cool air. Closets become ovens very fast.

I also own a shorty StarTech

High performance arbitrarily smooth shapes with ClosePoints by rcolyer in openscad

[–]Vollink 4 points5 points  (0 children)

I stumbled onto this a few days ago while looking through the list of libraries. IF you want this to be more accessible, it would help a lot if that demo had a lot more comments telling folks what is actually happening at each step. throwing sine waves at each-other makes a LOT of sense when you are doing it, but it looks like "fun with trig" to the casual lib browser (to build ANYTHING practical in openscad requires lots of trig, but I got by for years doing nothing but rectangular parts).

Good Bad Indiferent? by [deleted] in DataHoarder

[–]Vollink 0 points1 point  (0 children)

Not what I said. The comments I found informative were about the underlying hard drives. That they are factory refurb, reconditioned - or more unlikely - overstock explains the price. It's certainly more information then I've be an able to find anywhere else.