Reputation
295
Top tag
Next privilege 300 Rep.
Create tags
Badges
2 15
Impact
~10k people reached

Mar
30
awarded  Popular Question
Mar
17
comment Check if the residence's connection has internet access
Yes, although I still find your answer useful. Thanks!
Mar
12
revised Strange behaviour of uninitialized arrays and unset arrays
Slightly improved formatting and removed superfluous prompt in the code blocks.
Mar
12
awarded  Popular Question
Mar
11
comment list graphical processes from terminal
@j0h Well... try to define what it means to "have a GUI". In the end it means that the process is sending some commands to the GUI server of the OS to display some windows. X is the display server for linux systems, hence all processes with a GUI somehow "use" X. There's really no real difference between GUI and non-GUI process from the point of view of the kernel, and as such there isn't a simple system call to determine whether a process has or not a GUI.
Feb
3
comment Write Python stdout to file immediately
@Paul Before introducing new content in an answer you should look the other answers, to avoid these kind of situations. Only edits about formatting/adding references and such don't need the context from other answers. (Btw: Python<3.3 is my definition of ancient version of python.)
Feb
3
revised Write Python stdout to file immediately
Added link to flush documentation.
Feb
3
comment Write Python stdout to file immediately
@Paul Please avoid copy pasting contents between answers, or at the bery least mention the original authors that provided the content.
Feb
3
comment Write Python stdout to file immediately
@dotancohen Actually the part about print(flush=True) was added to that answer after mine by a third party author. I find it bad taste to rip contents from my answer to put them in an other without credit. I decided to add my answer solely because no answers provided any mention of the simplest way of achieving what the OP wanted in newer versions of python, and I added the "old way" just for completeness. The next time please check the revision history before commenting and or downvoting.
Feb
3
revised Write Python stdout to file immediately
added 486 characters in body
Feb
3
answered Write Python stdout to file immediately
Feb
2
awarded  Critic
Feb
2
comment Generating a random password; why isn't this portable?
What you say is utterly wrong. Forcing users to use only ascii letters, digits and underscore reduces the alphabet size considerably, making much easier to break passwords for attackers. An authentication system that cannot even handle ? or ^ is just too bad to be taken seriously.
Jan
26
revised How can I kill a process and be sure the PID hasn't been reused
Use lstart= instead of start= for more reliable comparison.
Jan
26
comment How can I kill a process and be sure the PID hasn't been reused
@StéphaneChazelas Yes, but you let it continue afterwards. I explicitly said: depending on the type of task that that process is performing you may have some trouble for stopping it some milliseconds. Thanks for the tip on lstart, I'll edit it in.
Jan
26
revised How can I kill a process and be sure the PID hasn't been reused
Added warning note about shell=True.
Jan
26
awarded  Yearling
Jan
26
awarded  Teacher
Jan
26
answered How can I kill a process and be sure the PID hasn't been reused
Jan
26
comment How can I kill a process and be sure the PID hasn't been reused
You can save the start time of the original process and, before killing, check that the start time of the process with that pid matches what you saved. The pair pid, start-time is a unique identifier for the processes in Linux.