Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 8
Newest
 Necromancer
Impact
~57k people reached

Mar
30
comment Transfer a file over a unstable SSH connection
It's not possible to resume an upload with scp. It's possible to resume an upload with rsync --partial. It's not possible to resume an upload with sftp. For the other direction, i.e. resuming downloads, you can use rsync --partial, sftp reget or sftp get -a.
Dec
15
awarded  Necromancer
Nov
23
comment How to print total number of file descriptors with index 24
Use setopt nullglob in zsh the get 0 when there are no matches.
May
20
comment useradd command's argument issue
Please provide the full shell script anyway (it can be as short as the command above), so it's easier for others to reproduce the problem.
May
20
comment useradd command's argument issue
This argument truncation looks very strange to me. Does it also happen if you create a shell script (#!/bin/sh) and run it? Can you please add the full source of your shell script and the full strace output? What happens if you run the shell script with /bin/bash?
Jun
29
awarded  Critic
May
19
comment How do I detect wheter the audio cable is connected?
The hardware can detect it, because it mutes the internal speaker as soon as I connect the external speaker.
May
19
comment How do I detect wheter the audio cable is connected?
@CL: The device at the other end is an externally powered speaker, which is turned on. I don't think it has any smart self-announcement capabilities. How do I figure out which HDA codec I have?
May
19
asked How do I detect wheter the audio cable is connected?
May
6
revised Cross-process dup on Linux
fixed argument order
May
6
awarded  Scholar
May
6
accepted Cross-process dup on Linux
May
6
suggested approved edit on Cross-process dup on Linux
May
4
comment Cross-process dup on Linux
@goldilocks, @Gilles: Yes, you are correct that /proc/$pid/mem is read-only. I've just tried it, and reading /proc/$pid/mem has worked, but writing it has failed with Invalid argument (even as root). Thank you for the clarification!
May
4
comment Cross-process dup on Linux
@Gilles: Can you point me to a working implementation of that? I couldn't find one, and I'd like to reuse a good one if possible, because I have the impression that using ptrace naively is very error-prone and unstable -- and I don't want to make the other process crash.
May
4
comment Cross-process dup on Linux
Thank you for the clarification. FYI I can't give +1 to your answer because the beginning (you can't access the memory of an unrelated process) is still incorrect, because ptrace(2) can do it. You are also incorrect about writing the memory of another process: /proc/13115/mem is writable, and it affects the other process. I fail to see why your explanation about buffers makes the socket impossible to dup: in fact, sendmsg(2) can do it using SCM_RIGHTS, also it gets duplicated upon fork(2).
May
4
awarded  Student
May
4
awarded  Commentator
May
4
comment Cross-process dup on Linux
I'm not interested in sniffing packets. I need a duplicate of the socket file descriptor.
May
4
comment Cross-process dup on Linux
Thank you for composing your answer. What you are saying (you can't access the memory of an unrelated process) is incorrect, because ptrace(2) can do it. Are you sure that what I need can't be done? If so, what is your justification? stackoverflow.com/questions/11214066/… ?