Hacker Newsnew | past | comments | ask | show | jobs | submit | Zacru's commentslogin

Probably simply "makes you feel full longer".


They changed something about the noodles and now they are way overcooked if you follow the box instructions. And you need way more butter to get a similar flavor to before.


Because that's a syscall ;) https://man7.org/linux/man-pages/man1/flock.1.html is the command line manual.

I would say one good reason is that

  waitlock myapp &
  JOB_PID=$!
  # ... do exclusive work ...
  kill $JOB_PID
is a lot easier to use and remember than

  (; flock -n 9 || exit 1; # ... commands executed under lock ...; ) 9>/var/lock/mylockfile


Why

  (; flock -n 9
and not

  ( flock -n 9

?


It's a "for" loop.


Could you elaborate?


A for loop in a shell script may sometimes look like this:

`for ((i = 0 ; i < max ; i++ )); do echo "$i"; done`

Here this is essentially a "while" loop, meaning it will keep executing the commands as long as we don't reach `exit 1`.

(; flock -n 9 || exit 1; # ... commands executed under lock ...; )


It doesn't seem to work?

  [~] 0 $ ( flock -n 9 || exit 1; echo in loop ; sleep 3 ; echo done working ; ) 9>~/tmp/mylock
  in loop
  done working
  [~] 0 $ (; flock -n 9 || exit 1; echo in loop ; sleep 3 ; echo done working ; ) 9>~/tmp/mylock
  -bash: syntax error near unexpected token `;'
  [~] 2 $

(This is bash)


Flock can be used in a single line for example for cronjobs.

Flock -s file && script.

Pretty simple. (I forgot the argument, I think is -s..


just pushed a change so now it's:

waitlock myapp & #... do stuff waitlock --done myapp


Got to number 15 and the color was #C61. My choices were #D52, #161, #C61, and #C63. Sadly, I guessed #C63 and lost.

Maybe there should be some minimum distance between all of the choices.



>dual-license the engine under both their current non-OSS modified Apache and the GPL.

Of course if they do, I hope they will say "either modified Apache or the GPL".

My company's lawyers made a big stink about us using jQuery plugins that said "and" instead of "or".


This makes a SSRF bug go from "oops, that's bad" to "oops, your whole cluster is pwned", right?


The thing I wish more error messages did was tell me exactly which file was not found.


This is something really annoying about simple error codes. Sure they're lightweight but how the hell am I supposed to know the problem with my input when all the error information I get is "The parameter is incorrect"? I've actually had cases where I disassembled Windows system libraries to track down the exact validation that was failing.


A fun 20-minute summary: https://youtu.be/rStL7niR7gs


The running user may not have a home directory.


The default on macOS is to chuck them in /cores (which seems quite reasonable to me).

Security-wise I wouldn't worry too much about the Solaris/Illumos defaults. There, dumps can be created in up to three contexts: system-wide "global", zone-wide "global", and local. All are created with mode 600 and global dumps are created with owner of uid 0. Local core dumps are owned by user that owns the process unless its uid/gid has changed (e.g. setuid/setgid), then the owner is the superuser like the global dumps.

Otherwise yeah I'm not a huge fan of leaving core dumps in the current directory. What if you're doing something on a read-only filesystem?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: