11,888 reputation
13961
bio website
location
age
visits member for 3 years, 7 months
seen 11 hours ago

GNU/Linux user. Systems Engineer. Runner.


Apr
5
comment How do I restart the network or ask the system to seek a refresh IP from the DHCP?
Added some more that I found that might help.
Mar
27
comment What is the relationship between root and kernel?
@RonVince It depends on what parts of the system you would like to learn. For some of the questions you have been asking, I would recommend a combination of /Advanced Programming in the Linux Environment/ by W. Richard Stevens and your system's development manpages.
Mar
27
comment Read the middle of a large file
You've likely identified the right cause. Note however, that you'll also need to adjust the skip I believe as that is also in BLOCKs. In new versions of GNU dd there are count_bytes and skip_byes iflags that allow you to specify the count and skip in bytes.
Mar
27
comment How to parse JSON with shell scripting in Linux?
@user3086014 I'm sorry, but I won't be putting more work into this answer. Take a look at the Ruby example I have there. It should give you a good place to start on how to get tags out of various parts of the JSON you want.
Mar
27
comment libpam load pam modules at every connection
Out of curiosity, did your debugging actually show that PAM loading was slow compared to the other parts of starting the session? If so, is PAM doing a lot of work to do authentication or is it really just the loading that is slow? Sorry to ask so many skeptical questions, it is just very surprising to me. I would expect other portions of the connection to dwarf simply loading the PAM modules. For example, if you have "UseDNS" set to yes.
Mar
27
comment How to parse JSON with shell scripting in Linux?
To be fair, he wasn't asking to parse it with regular expressions. You could write a fine JSON parser in awk, it would just take a lot more time than anyone would reasonably spend on an answer for stackexchange. :) More seriously, jq has been useful to me: stedolan.github.io/jq
Mar
27
comment Result from kernel returned to what process?
Also helpful are the syscall manpages. A system calls response code is returned via an architecture-defined register (eax on x86). For system calls that return a lot of data, the arguments that you pass include an address where the data should be put. Your process can then just look at that same address once the system call returns.
Mar
27
comment What is the relationship between root and kernel?
I've added my commend to the answer with some links.
Mar
27
comment What is the relationship between root and kernel?
Processes running as UID=0 have superuser privileges; however, they still make requests of the kernel via the system call interface. A userspace process, even running as root, is still limited in what it can do as it is running in "user mode" and the kernel is running in "kernel mode" which are actually distinct modes of operation for the CPU itself. A userspace process running as root still only has access to the kernel mode features that the kernel exposes to it. See linfo.org/kernel_mode.html for more info.
Mar
27
comment What happens when I run the command cat /proc/cpuinfo?
linux.com/learn/linux-training/… and lwn.net/Articles/22355 (a bit dated)
Mar
27
comment What happens when I run the command cat /proc/cpuinfo?
Nice answer! On linux, if you want to dig deeper, the source for the proc filesystem is in fs/proc in the kernel source. You'll see that there is a fs/proc/cpuinfo.c but, unfortunately, it is rather empty since the heavy lifting is spread out all over arch/ as it is architecture dependent. For a simpler example see fs/proc/uptime.c. By glancing at the file we can guess that uptime_proc_show is the workhorse of what gets us the data we want and we could explore it more by diving into the functions it calls. To understand the seq_file interface and how it is used in procfs see:
Mar
25
comment Why is the service unavailable the second time?
So, this isn't an answer, but my guess is that if you want to figure out what is going on and it isn't logging, you will need to dig in a bit. How does tdtool talk to the daemon? A network port, an AF_UNIX socket, something else? If you aren't sure, I would try (1) run lsof on the daemon and see what files and sockets it opens. Do their state change after the first connection? (2) start the daemon in the forground and run it under strace. In another shell run tdtool, perhaps under strace as well.
Mar
25
comment Download Only a Part of a File
Are you referring to downloading using HTTP or some other protocol?
Mar
25
comment Does Public and Private key remain the same for a user or system?
"after I gave my public and private keys." As a rule you typically don't share the private key.
Mar
25
comment nc: bind failed: Address already in use
Nice answer. You might want to explain The releasing of the port 8140 takes some time to occur with a sentence or two about TIME-WAIT.
Aug
23
comment Can you recommend a GUI text editor for a developer (features needed are inside)?
@jw013 Well, I eventually did get it online but then forgot about this comment. My .emacs folder has grown significatly since then. Here is the UI bits: github.com/stevendanna/emacs-config/blob/master/modules/ui.el
Jan
6
comment What makes Ubuntu not totally Free Software?
I agree Ubuntu One is a bit out of place in that list. I think (it was a while ago) I was simply trying to list items people might be referring to, even if they are not /actual/ issues. Edited to remove.
Apr
29
comment In bash, how can I convert a Unicode Codepoint [0-9A-F] into the printabale character?
Since it seems you used penguin359's information in your answer, you might consider marking his answer as correct rather than mine.
Apr
29
comment In bash, how can I convert a Unicode Codepoint [0-9A-F] into the printabale character?
Yeah, the .encode('hex') was just to get the hex code that seemed to work with echo for me. Glad that at least part of this was helpful.
Apr
28
comment checking an argument to a bash script is a string of all digits
Try running ls -al $(which sh) to see if your sh command is what you think it is. :-)