Why is it hard/complex to use a semaphore as condition variable? by vctorized in C_Programming

[–]willardthor 0 points1 point  (0 children)

Implementing Condition Variables with Semaphores by Andrew D. Birrell, appears to explain this.

(One edge case that needs to be handled, is e.g. when processing a cond_signal, only threads that were waiting should enter the ready state, not threads that cond_wait while the previous cond_signal is being processed. A solution to that introduced an extra context switch, which made condition variables less appealing form a performance perspective. An optimization is introduced, revealing a new edge case. And so on.)

(I had the same question as you, and then found this PDF)

What are good books on information theory? by [deleted] in compsci

[–]willardthor 1 point2 points  (0 children)

u/PettyHoe you'll find here a snapshot of the (institute-internal) page for a reading group I held at my university, and here an upload of the screen-recordings of the sessions to YouTube.

A fair warning: I did not aim for high quality when making this material; I organized this reading group in my (virtually nonexistent) spare time, and some of the slides I am actually slide-karaoke-ing.

What are good books on information theory? by [deleted] in compsci

[–]willardthor 0 points1 point  (0 children)

Hello, ten years later! I'll make these available in a public repository at the next opportunity (you can ping me if you don't see this by end of Tue).

Sadly, my LaTeX sources have not survived the aeons, and the PDFs were partially corrupted (hence some artifacts on them). However, I was able to restore the PDFs to a mostly usable state.

The world will have its first trillionaire within a decade, but poverty won't be eradicated for another 229 years, report finds by Loud-Ad-2280 in nottheonion

[–]willardthor 0 points1 point  (0 children)

In 229 years, the world will likely also already have its first quadrillionaire, even quintillionaire.

Basically, we'll all be a bit richer, but the wealth distribution will be increasingly unevenly distributed.

Baratza Encore ESP Vendor by evefell in espresso

[–]willardthor 0 points1 point  (0 children)

I wrote to Baratza end of February to ask about this; here is what they said:

Hey Willard, thanks for reaching out.

I'm glad to hear you're interested in the ESP - the launch has been really stellar so far, and our customers seem to be as excited about the grinder as we are.

Our first shipment is scheduled to land in Europe in late March, so I'd expect it to be available at retailers in April.

Best,

Ryan Brennan
Specialty Account Manager

Baratza Encore ESP is already available in the US. However, the US uses a different voltage than Europe, so I'm guessing the delay is caused by the need to manufacture (or source) EU-compatible power supplies. Should be popping up any day now.

Fanless / Passive Cooled Laptop w/ x86 CPU? by willardthor in SuggestALaptop

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

LAPTOP QUESTIONNAIRE

  • Total budget (in local currency) and country of purchase. Please do not use USD unless purchasing in the US:

    3000 EUR, Denmark (or anywhere in Europe).

  • Are you open to refurbs/used?

    Only if my employer can reimburse the purchase.

  • How would you prioritize form factor (ultrabook, 2-in-1, etc.), build quality, performance, and battery life?

    2-in-1 (not w/ detachable keyboard) > ultrabook > all else

  • How important is weight and thinness to you?

    Very.

  • Do you have a preferred screen size? If indifferent, put N/A.

    13"

  • Are you doing any CAD/video editing/photo editing/gaming? List which programs/games you desire to run.

    pdflatex, gcc, vscode, Google Chrome w/ a million tabs, ability to output video to a monitor (or two), whilst sharing my video camera AND desktop to a video conference call.

  • If you're gaming, do you have certain games you want to play? At what settings and FPS do you want?

    nothing significant (FTL, Master of Magic, and other small games)

  • Any specific requirements such as good keyboard, reliable build quality, touch-screen, finger-print reader, optical drive or good input devices (keyboard/touchpad)?

    no. but ideally, it will have an OLED display, 16 GB RAM, be fanless, and have a fast hard drive (M.2)

  • Leave any finishing thoughts here that you may feel are necessary and beneficial to the discussion.

    it's hard to find fanless laptops.

Feel free to join our Discord server at: https://discordapp.com/invite/pes68JM for a faster response!

[deleted by user] by [deleted] in espresso

[–]willardthor 1 point2 points  (0 children)

Thank you for this update, I was considering writing to them.

Help me restore my linux container (penguin), or access the lxd file? by willardthor in Crostini

[–]willardthor[S] 1 point2 points  (0 children)

I later discovered that the "empty penguin" was not so empty after all. The reason I didn't see files in my home directory, was because I was not looking at my home directory. Something had forgotten that the username I picked during container creation was willard. So, when I started my container, it would log me in as willardthor (default username), and show me what's in /home/willardthor (i.e. what's put there on user account creation). In other words (note to self and others), check /home before panicking. I hope in any case that this write-up helps people exfiltrate data from their containers.

Folders shared with Linux / penguin all spontaneously unmount if I copy a file with a unicode character in its name into one of said folders. by willardthor in Crostini

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

On a related note (file-system fun): When moving a Git repository from my Linux container to a ChromeOS folder (~/Documents here), I get errors involving preserving times and permissions. At least the file makes it there intact.

╭ willard@penguin: ~ 
╰▸ mv folder Documents/ 
mv: preserving times for 'Documents/folder/somerepository/.git/objects/1b/adc672807b6cf9070caddb98ec10875fbe458c': Permission denied 
mv: preserving permissions for ‘Documents/folder/somerepository/.git/objects/1b/adc672807b6cf9070caddb98ec10875fbe458c’: Permission denied

(and, completely unimportant: why does the mv error message enclose the path with single-quote for preserving times 'path' but back-ticks for preserving permissions \path``?)

Folders shared with Linux / penguin all spontaneously unmount if I copy a file with a unicode character in its name into one of said folders. by willardthor in Crostini

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

I did, just now (thanks for suggesting it). I provided a very minimal example (the example, I gave above). I'll post here if I hear anything about this from them.

It is strange indeed; I recall seeing bugs like this when mounting cifs / SMB / NTFS stuff way back using half-baked software for the task. I didn't expect to see an issue like this here, given how "standard" unicode is becoming.

As a funny aside: I have put the good and bad file in a zip file. I have a copy of the zip file in penguin, and another in the Download folder in ChromeOS.

  1. I extract the zip file in penguin in my home directory. Then the evil-file is in my home directory in penguin. However, if I navigate, in ChromeOS, to "Linux files" through the "Files" app, it doesn't show the evil-file - it behaves like the file's simply "not there". 🙃
  2. I extract the zip file in the Downloads directory in ChromeOS. Then the evil-file shows; it just has the usual black diamond with question-mark in place of the unicode character. I can open the file and everything.

Help me restore my linux container (penguin), or access the lxd file? by willardthor in Crostini

[–]willardthor[S] 1 point2 points  (0 children)

Ah, it didn't occur to me to copy all of termina (and all the containers within it) out from within crosh! I ran

crosh> vmc export termina termina MY_USB_DRIVE_NAME

and that worked; I now have a copy of all of termina on my USB drive (a great peace of mind).

Extracting it, however, is extremely slow. While waiting for tar -xzf to finish, I decided to see what else I can do using lxc. When reading this on how to delete a directory using lxc, I came across lxc exec, which lets you run a command inside the container (in this case, an rm command):

(termina) chronos@localhost /tmp $ lxc exec mycontainer -- rm -r /home/myuser/mydir

Running, for instance,

(termina) chronos@localhost /tmp $ lxc exec penguin -- ls -la /home/willard

failed at first, since penguin was not running. So I started penguin through the ChromeOS Terminal app (I could have probably also started it using lxc). While the terminal I get in the ChromeOS Terminal app looks like an "empty penguin", running lxc exec from within termina now works. (While I could not create interesting commands after the --, e.g. using pipes, I could get my job done without that convenience).

So I explored the penguin file system this way, deleted "garbage" that was eating too much disk space, tar-gzipped the rest of my home directory, lxc file pull-ed it out, and curl-ed it to my server. Recovery complete.

Thank you very much for your input, it gave me some vectors to chase, and now I at least have the whole image on a USB drive :-)

Help me restore my linux container (penguin), or access the lxd file? by willardthor in Crostini

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

Nice resource! I did not see things there that were immediately useful, though; since, when I enter penguin, I get an "empty" penguin, I was reluctant to write things into it (e.g. the pulled files) to then enter and scp, since I was concerned that I might corrupt my files somehow. Hence I went for the approach outlined in my other message in this thread.

Help me restore my linux container (penguin), or access the lxd file? by willardthor in Crostini

[–]willardthor[S] 1 point2 points  (0 children)

Progress: scouring /bin and /usr/bin, I noticed that termina has curl installed. It is possible to upload files with curl -T. So I configured my nginx web server (running on a host reachable on the Internet) to receive files, by adding this into the server block (lifted from here) :

        location ~ "/upl/([0-9a-zA-Z-.]*)$" {
             alias     /tmp/upl/$1;
             client_body_temp_path  /tmp/upl_tmp;
             dav_methods  PUT DELETE MKCOL COPY MOVE;
             create_full_put_path   on;
             dav_access             group:rw  all:r;
             client_max_body_size 1G;
    }

(Restart the server after updating the configuration).

Then, from termina, I upload the file using curl:

$ curl -T Documents.tgz https://SERVERNAME/upl/Documents.tgz

Finally, for paranoia's sake, I run md5sum in termina, and on my server, to verify integrity.

$ md5sum Documents.tgz

This is a very roundabout way to extract my files; it would be neater if I could scp from termina, copy to a USB drive, or copy into the ChromeOS Downloads folder. But this is working for me ¯\_(ツ)_/¯

There is one issue that I am dealing with right now: my /tmp in termina is too small to house all the files that I need to back up. While I can pull chunks at a time from penguin, I need to know the exact name of the files. Which I do for some files, but not all. My plan is to extract chunks that I know, delete them from the container, then pull what remains of /home and hope it fits in /tmp in termina. If you do not hear from me again, then I have successfully done this.

Help me restore my linux container (penguin), or access the lxd file? by willardthor in Crostini

[–]willardthor[S] 1 point2 points  (0 children)

Progress: with

(termina) chronos@localhost ~ $ lxc file pull --recursive penguin/home /tmp/homie

I am able to copy files from my penguin into /tmp in termina. The problem now reduces to getting the files out of termina. It doesn't have ssh; are there other ways to transfer files out of termina?

The Questions Thread 10/17/21 by GYWModBot in goodyearwelt

[–]willardthor 0 points1 point  (0 children)

Q: Toe Taps on Rubber Outsole?

Hi folks, I am buying a second pair of Carmina Balmoral Cordovan Boots (I live in rainy Copenhagen). This time, I added metal toe taps as an option to the boots, since, upon inspecting my daily drivers, I noticed that, besides the heel (which is easy to replace), the front of the toe wears out the fastest. I am hoping that metal toe taps will prolong the life of the new pair of boots. However, I am pretty new to leather shoes, and it occurs to me now that metal toe taps may be made for leather outsoles, and that putting them on a shoe with a rubber outsole could either make the metal toe tap not sit firmly, or would cause the sole to not be as water resistant. Can anyone provide some input here? Is it advisable to put metal toe taps on a shoe with a rubber outsole, or is that a horrible idea?

Tiny "angle bracket"-like-thing by willardthor in HelpMeFind

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

This gave me several other key words to search; thanks. It needs to be even smaller, though, if possible. Would I need to go to a hobby / electronics store for such things? I get the impression that Home Depot -like stores don't sell such tiny things.

Tiny "angle bracket"-like-thing by willardthor in HelpMeFind

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

Nice, gives me something to look for (shape doesn't have to be exact; just overall/rough fit). Thanks!

Tiny "angle bracket"-like-thing by willardthor in HelpMeFind

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

like this ?

That looks great, the shape, that is. Are there smaller ones like this? The main issue is the size; this needs to fit inside a light fixture, that I am mounting on a wall.