Reputation
1,447
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
6 16
Newest
 Yearling
Impact
~45k people reached

  • 0 posts edited
  • 0 helpful flags
  • 19 votes cast
Aug
20
comment How to safely turn off swap permanently? (on Debian Jessie)
@SnakeDoc - you won't typically get a kernel panic, the OOM handler will kick in and kill process(es) to free up memory (and it usually does a pretty good job deciding which one(s) to kill, generally giving preference to killing larger and newer processes). I maintain a large number of servers without swap that are set to panic on OOM instead of killing processes because the servers are configured such that they will normally never run out of memory and if they do, I want them to panic and reboot rather than swap and slow down (or let the OOM handler decide what processes to kill)
Jul
27
comment What does the `-C` flag exactly do in `scp`?
@Score_Under - The zip format is also used by Java to package .jar files, so zip is still used extensively on many Linux servers.
Apr
21
comment Download a file to a server?
The semicoon can mean anything the receiving side wants it to mean, but in this case, it does look like it's a parameter separator.
Apr
21
comment Download a file to a server?
@hildred Good suggestion, I changed the answer to use single quotes.
Apr
8
comment How to 'drop'/delete characters from in front of a string?
For just a few characters, I'd use ... instead of .\{3\} since (to me) it's easier to read: sed -e 's/^...//' -e 's/....$//' or in a single expression with alternation: sed -r 's/^...|....$//g'. If it were more than a few characters to delete, then I'd use the /.\{17}\/ expression instead of /.............../.
Mar
12
comment monitor linux file systems using df
I believe that for some older kernels unless the filesystem is mounted with the "intr" flag, then all NFS operations are uninterruptible. I'm not sure what "timeout" does in this case, but I suspect that it abandons the "df" command so you may end up with a bunch of zombie df's in the background.
Mar
2
comment How do I grep recursively through .gz files?
That's only looking at a single file, it's not recursive.
Feb
14
comment Cloning a drive larger than your own
How about using operating system utilities (resize2fs on linux) to resize the partition, then use p2v to virtualize it?
Feb
14
comment Cloning a drive larger than your own
That doesn't really address his problem since 2TB is larger than his entire filesystem... and if he's unhappy about taking 6+ hours to clone, he's not going to be happy at the overhead of bzip2. I'd use "gzip --fast".
Jan
30
comment How do I list files ending in txt only on Unix?
@don_crissti - Even knowing that his problem set is limited to the given set of files would be useful, but few real-world problems are so well defined that the entire input space is known and can be enumerated in a few items. Questions here are supposed to be based on real problems, not open-ended questions that could spawn dozens of answers. There are 4 answers below that work with the file set above, but without further information, it's not clear if any of them meet his needs.
Jan
30
comment How do I list files ending in txt only on Unix?
@don_crissti - I think the unclear part is why he doesn't want to use the period in *.txt, which is the obvious way to get the list of files he's looking for -- if he can state what problem he's trying to solve, then maybe someone can give him the answer. There are lots of ways to list only the files ending in .txt without using a '.' in the glob match, but some may not meet his needs in other ways.
Jan
29
comment Any disk encryption that locks itself for some time after a number of failed attempts?
@AaronLS - The xkcd comic assumes 11 bits of entropy per word, which is equivalent to a 2048 word vocabulary. The average 5 year old has an expressive vocabulary of 2150 words (by high school it's around 10,000 - 17,000 words), so as long as you have the vocabulary of at least a 5 year old, and don't just pull the passphrase from a few common words, the XKCD model holds true. The most important thing is to pick random words, not well known phrases.
Jan
29
comment Any disk encryption that locks itself for some time after a number of failed attempts?
Of course, a determined hacker can divide your iter-time by the number of computer's he's willing to expend on hacking you - if you have iter-time set to 60000, and he has 1000 computers to spend on hacking you, that's the same as if you set iter-time to 60, so don't assume you can use a 4 character alphanumeric password in the belief it would take him years to crack it.
Jan
28
comment Can signal be ignored (lost)?
Did you mean to write "A signal is guaranteed to be delivered" since you went on to describe some of the ways in which the signal would not be delivered (i.e. process died before it was received, or signals were coalesced)?
Jan
20
comment How to represent date format in '2015120' in Linux shell?
out of curiousity, does he zero pad days? Is Feb 1st written as 201521 or 2015201?
Jan
13
comment Is it good to have multiple version of Linux Kernel?
The other option is to have enough server redundancy that you don't care what happens to any particular server, if it fails to boot after an update, you just deploy a new server and add it back to the server pool. Harder to do if your clients are logged in locally, but generally easy to do if it's providing some service to users and it takes a lot of the stress out of system updates.
Dec
29
comment Move file but only if it's closed
@JohnWHSmith - That's normally true if moving the file within the same filesystem, if he moves the file to a new filesystem before the writer has finished writing to it, he'll lose some data.
Nov
26
comment Can I use my original GPG key even though I've re-installed Linux?
How do you securely erase a USB stick? It'd be better to store it on an encrypted filesystem.
Oct
24
comment Exclude one pattern from glob match
@jbarker2160 - that's not really a regular expression, it's more commonly called a glob (or filename pattern), which is more or less a subset of a regular expression - see the pattern matching section of the bash manpage for details. His pattern foo.*[^org] will match any filename that begins with foo. with one or more characters after the dot where the last character is not o, r, or g. So it would match foo.orb, but not foo.org or foo.or or foo.o. GlennJackman's answer shows how to enable extended pattern matching features to negate a match.
Sep
6
comment Remove all files/directories except for one file
If it's a large file on a separate filesystem from /tmp and you're trying to remove everything from the root of the filesystem down, then moving it somewhere safe may not be an option.