Live data from Hacker News

Linux utils that you might not know

shiroyasha.io

151–159 of 159 posts

Re: Linux utils that you might not know

#151
post #88

Earlier quoted context omitted.

A large proportion (if not the majority) of the world starts their calanders on Monday. While the ordering is arbitrary, I always thought of the weekend as a single block of days so it's odd to say that the week ends in the middle of the weekend (rather than at the end of the week end ).

I always saw "weekend" in the same way as "book end", that is, that one is at the beginning of the week (one starting end), and one is at the conclusion of the week (the finishing end). Because our weeks come successively, the end of one is immediately followed by the beginning of the next, hence the "block" called the "weekend".

Bookends usually come in pairs.

Re: Linux utils that you might not know

#152
post #61
post #37

Earlier quoted context omitted.

Before evaluating the claims myself: The shred manual specifically claims that it is "not guaranteed to be effective" on "log-structured or journaled file systems", and specifically calls out ext3 in data=journal mode. I would assume that the concern with ext3/4 in data=journal mode is that shred does not guarantee that the records of previous writes are evicted from the journal.

In data=journal mode, data to be written is first written into the journal. Only after the journal is flushed it will be written out to the correct location. Therefore, a crash at any time is fixed by replaying the journal forwards. Note that the ext3/4 journal is a redo log, not an undo log. Old file contents are not copied into the journal on a write. Thus, I don't see why shred should be less effective in data=jou…

> Thus, I don't see why shred should be less effective in data=journal mode compared to the other journaling modes.

Because with data=journal, content that was previously written to a file (and made its way through the journal) might still be in there if the journal has not been replayed or garbage-collected in a while.

Re: Linux utils that you might not know

#153
post #149

Earlier quoted context omitted.

Yeah. You'd be amazed what you can do with a scanning electron microscope. (ie, read individual bit states off after a rewrite.)

Someone would have done it by now if it was possible, so where are the published papers? It's not possible, and it's never been possible unless we're talking about 1970s 24" platters, and we're not talking about those.

http://escholarship.org/uc/item/26g4p84b#page-5

Re: Linux utils that you might not know

#154

Since the article mentions numfmt(1), I'm surprised that no one mentioned units(1) yet. I use it all the time to convert units. $ units '4123412312312 bytes' 'tebibytes' 4123412312312 bytes = 3.7502217 tebibytes 4123412312312 bytes = (1 / 0.26665091) tebibytes $ units "50 miles per gallon" "liters per 100 kilometers" reciprocal conversion 1 / 50 miles per gallon = 4.7042917 liters per 100 kilometers 1 / 50 miles per…

I use it as a general purpose calculator.

Re: Linux utils that you might not know

#155
post #61

Earlier quoted context omitted.

In data=journal mode, data to be written is first written into the journal. Only after the journal is flushed it will be written out to the correct location. Therefore, a crash at any time is fixed by replaying the journal forwards. Note that the ext3/4 journal is a redo log, not an undo log. Old file contents are not copied into the journal on a write. Thus, I don't see why shred should be less effective in data=jou…

> Thus, I don't see why shred should be less effective in data=journal mode compared to the other journaling modes. Because with data=journal, content that was previously written to a file (and made its way through the journal) might still be in there if the journal has not been replayed or garbage-collected in a while.

That's a good point I overlooked. Although the journal is not that big (<1 GB); so doing some extra I/O after the shred should get rid of that. When the original contents are older, then it's rather unlikely they're still in the journal.

Re: Linux utils that you might not know

#156
post #100

Anyone here will probably enjoy checking out commandlinefu: http://commandlinefu.com Especially looking down the list of all time greats: http://www.commandlinefu.com/commands/browse/sort-by-votes

Thanks for the second link. I go there every few weeks but never thought to check out the top voted. ...In hindsight, of course... The gem I just plucked out is something I've been curious about for a while but never looked up: CTRL-X e The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR [then run it when saved] Similar to `fc` except you don't need t…

Is there an equivalent to that for urls typed on the command line to be opened using whatever $BROWSER

Re: Linux utils that you might not know

#157
post #156
post #100

Earlier quoted context omitted.

Thanks for the second link. I go there every few weeks but never thought to check out the top voted. ...In hindsight, of course... The gem I just plucked out is something I've been curious about for a while but never looked up: CTRL-X e The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR [then run it when saved] Similar to `fc` except you don't need t…

Is there an equivalent to that for urls typed on the command line to be opened using whatever $BROWSER

start http://example.com/

works in Windows.

xdg-open [1] is for Linux.

https://linux.die.net/man/1/xdg-open

Re: Linux utils that you might not know

#158
post #157
post #156

Earlier quoted context omitted.

Is there an equivalent to that for urls typed on the command line to be opened using whatever $BROWSER

start http://example.com/ works in Windows. xdg-open [1] is for Linux. https://linux.die.net/man/1/xdg-open

Oh wow! Thanks. For macs you can use

  open http://example.com/
Post reply on HN