1,379 reputation
17
bio website
location
age
visits member for 1 year, 9 months
seen 7 hours ago

Aug
4
comment Script using “split” in a loop over large files
In the awk solution, do you close the files as soon as you wrote into them? It should help (I can't do a test today :/ )
Aug
4
comment Script using “split” in a loop over large files
+1 for a nice catch! The answer then woyld be to use a "head -1" to get the number of lines, then awk to read chunks of n+2 lines and write them in a file
Jul
29
revised Debugging a Solaris network issue
added 284 characters in body; added 1 character in body; deleted 4 characters in body
Jul
27
comment Where does the pattern occur in a match by find?
+1. I'd just add that the single quote around the pattern are mandatory, as otherw ise the shell itself would try to expand them, therefore sometimes (when it matches something in the current dir) changing it into something else. (And if you really want just files, add -type f after the ~ )
Jul
27
answered Debugging a Solaris network issue
Jul
8
comment Is SAMBA routable?
+1 for good answer
Jul
8
comment Is SAMBA routable?
Regardless of feasability, having a Samba3 remotely accessible without VPN is a big "No" security wise... You may instead try to have an OpenVPN connection that makes the remote Samba3 server "appear as if part of your own lan", or make you appear part of its lan (ex: serverfault.com/questions/137933/…). That way, only have the OpenVPN port accessible (via proper authentification), and OpenVPN encryption would also provide privacy and a bit of security for the travelling packets between local and remote.
Jul
8
comment Is this command safe to run from / as root
1) you should really add also -type d so you don't run thousands of "rmdir" on files... 2) may we ask you why you want to remove empty directories everywhere? As some already said : it could be problematic (programs needing a directory, creating it when installed, but having it deleted before they could use it could result in a crash, or unexpected behavior)
Jul
8
comment Can gdb debug suid root programs?
+1 : Learned something today. Thanks.
Jul
8
comment Why ssh-agent group ownership is not root
+1(00) for those important additionnal infos! (for why setgid prevents same user to debug: Gilles himself comes up in a google search : unix.stackexchange.com/a/15912/27616 )
Jul
8
comment Why ssh-agent group ownership is not root
+1. More programs setuid/setgid root means more entry points on the machine (and everything connected to it) (Each bug, weak security, etc in the program's code could maybe be exploited to create/run things as root. Whereas setuid/setgid nobody wouldn't give exploits much access, other than basic unpriviledged commands use and file creation).
Jul
4
comment Why do some commands not read from their standard input?
@sylye: For instance, gzip, in the SYNOPSIS, it didn't say it must take a FILENAME as input : It doesn't say it, because it doesn't need a FILENAME as input. gzip can compress file(s) in its argument list, and also can compress stdin (and output the compressed result on stdout). tar is the same. exemple: ssh user@remote "tar cf - /some/dir | gzip -c -" >some_dir_from_remote.tar.gz
Jun
19
comment What is the point of CTRL-s?
See : linusakesson.net/programming/tty (read it all, but especially the section about Flow Control...)
Jun
15
comment Execution order with multiple commands
The whole thing should be a script, so that it's easy to debug and test. Your cron then just call that 1 script (which can then contain "if" statements, etc)
Jun
8
answered How to change font colors in terminal?
Jun
8
comment ctrl c vs. ctrl z with foreground job
Caleb is right (+1). The ctrl-Z stops the program, which you should regard as "freezing" it, but that program still is in memory, it's files opened, etc. It is not killed/terminated.
May
31
comment Logrotate behaving unexpectedly
Yes, seems the problem. The OP should see a lot of ascii char 000 (Nul) (shown as : ^@ with cat -v, or in vi) at the beginning of the file. Why? Nagios is writing to the current position in the file, because its file decriptor points to that position. So linux happily do that and create a sparse file with zeroes before that "current position". (To avoid that, a program logging should always seek until the end, having opened the file in append mode (or with >> if it is a script) instead of the regular write (or '>' in a script). Thus it would seek until position 0 when the fil
May
30
comment Change the order of executables started in bash
And to bypass just the alias : \test (this will either start the builtin, or, if no builtin of that name or it is disabled, will start any function of that name, or look for it in the PATH)
May
30
comment How can I get the first column of a 300GB txt file?
The line causing a problem is cited in the error message : " FNR=117897124 "
May
21
comment How do I replace symlinks in a path with their target within a script?
another option : find -H / -inum $(ls -i /path/to/latest/files/test.txt | awk '{print $1}') -print , ie find the inode number (without following links, so it uses only the direct directory route). can take a long time, but could also be used as a verification of the "proper" solution's output