seodisparate

Joined 9 years ago

Karma
106
Submissions
25
Member since
May 1
https://nexus.seodisparate.com

https://github.com/Stephen-Seo

View on Hacker News

Recent submissions

Comment · 1 year ago
One can use C's `cleanup` attribute like a defer. https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attribute...

The function signature is `void(MyType*)` if it is used like:

    __attribute__((cleanup(MyTypeCleanupFunction)))
    MyType myType;
If it's a pointer, it'll call the cleanup as a double ptr, and etc. Note that the specified cleanup function can do anything you want to, though the intended purpose is to cleanup the variable when it goes out of scope.
Comment · 2 years ago
Or using .ssh/config since entries in there act like hostnames:

    # ~/.ssh/config
    Host github_ssh
        HostName github.com
        User git
        IdentityFile ~/.ssh/my_github_key

    > git remote add github github_ssh:Username/RepoName.git
This has worked reliably for me for quite a while now.
Comment · 2 years ago
Comment · 2 years ago
Isn't there `proc` on Linux systems?

Get the pid of the process you want to inspect, and while its running, execute `ls -lh /proc/<pid>/fd/`. It will list the open file descriptors for that process.

Comment · 2 years ago
One could use `printf 'first\0second'` in the Bash shell as an example of making a "string" with null embedded into it, but you can't store that in a Bash variable.

    $ TEST_VAR="$(printf 'first\0second')"
    bash: warning: command substitution: ignored null byte in input
I'm not familiar with working with null characters in Bash in this way, but I think there might be a way to do it.
Comment · 2 years ago
Comment · 3 years ago
https://choosealicense.com/ is a good resource that lists a bunch of licenses explained.
Comment · 3 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Is it too old-fashioned of me to prefer IRC? Discord has its place, but I favor IRC.
Comment · 4 years ago
Comment · 4 years ago
Been using Linode since 2019. Service worked as expected (worked well), and I hope that won't change after this. If I had to move, I'd have to go through the pain of setting up my website(s) again, but at least I have backups, so it's just a matter of time spent getting set up again..

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton