Live data from Hacker News

Unix Tricks

cfenollosa.com

161–166 of 166 posts

Re: Unix Tricks

#161
>Don't know where to start? SMB is usually better than NFS for most cases.

Not sure why he feels SMB is better, because in my experience, NFS usually works more smoothly and is easier to setup than SMB. But then, I don't usually use windows.

Re: Unix Tricks

#162

Another one: Use dcfldd instead of dd if you want to see how far your dd operation is progressing... dcfldd if=[infile] of=[outfile] sizeprobe=if So. Much. Better. dcfldd also has many other useful options - read the man pages - and note that you'll have to install it from your linux distro's package repo beforehand.

Just pipe dd to pv

Re: Unix Tricks

#163

Earlier quoted context omitted.

There's no good way to refer to the entire DOS/Windows command shell lineage without confusion, but that's what I meant. I don't technically use DOS at all anymore. I think "that system" is easier to understand in it's entirety and find your way around than Unix, although it has been getting progressively more complex for years. I actually use OS X most of the time now (plus Linux on servers and Windows for 3D stuff)…

> I think [DOS] is easier to understand in it's entirety and find your way around than Unix Yikes, I recently had to do a bit of development on a windows box and I found the command-line tools (not to mention CMD itself, which seems to have stopped development in 1993) to be absolutely awful. I could barely survive without Cygwin, git bash, etc giving me some semblance of a functional shell setup. I guess it's differ…

What really gets me is that MS almost fixed that with powershell -- and then made the defaults policies so restrictive that you need to go through hoops to actually be able to use the thing. I do get that it's "really powerful and lets not create another set of visual basic script viruses" -- but the UI is just horrible. Maybe it's better in 8, but last I checked I think you had to go into the policy editor and choose between "safe - no powershell for you", "safe-ish - only signed powershell (still no powershell for you) and: open season on shooting your feet off: powershell always, everywhere, all the time.

Don't get me wrong, I still prefer living with bash and a full GNU system -- it's just sad about what MS did (or didn't) do with their command line tools since 2003ish and on.

Re: Unix Tricks

#164

A really handy one a colleague showed me yesterday was the /dev/fd/0|1|2 files, which are stdin/out/err respectively. Means you can use that file for utils that expect a file only. E.g echo "This would be contents of file" | someCommand /dev/fd/0

These are also available as /dev/std{in,out,err}; the names of which are a little more self documenting :) $ ls -l /dev/fd /dev/std* | column -t lrwxrwxrwx 1 root root 13 Jun 27 16:32 /dev/fd -> /proc/self/fd lrwxrwxrwx 1 root root 15 Jun 27 16:32 /dev/stderr -> /proc/self/fd/2 lrwxrwxrwx 1 root root 15 Jun 27 16:32 /dev/stdin -> /proc/self/fd/0 lrwxrwxrwx 1 root root 15 Jun 27 16:32 /dev/stdout -> /proc/self/fd/1 Yo…

"process substitution" is one of the new useful things I learned this year (switched to bash from csh over 20 years ago).

/proc/${pid}/fd/ is very useful for forensic purposes when you find some malware running that deleted itself and/or config files but still has a handle open to them.

Re: Unix Tricks

#165
post #73

Earlier quoted context omitted.

I never got RVM working with fish; unsurprising, seeing as it’s 20k lines of bash. rbenv works well though (with one additional conf line), and chruby was working on support last time I checked.

RVM is pretty heavyweight. Why not something like chruby?

I started using RVM when it was the only (possibly well-known?) game in town, and never switched until I started using fish and found that it didn’t work.

Re: Unix Tricks

#166

Earlier quoted context omitted.

I never got RVM working with fish; unsurprising, seeing as it’s 20k lines of bash. rbenv works well though (with one additional conf line), and chruby was working on support last time I checked.

There's a wrapper to get RVM working with fish, in case it matters to you now; details here: https://rvm.io/integration/fish

Doesn’t matter now :) rbenv does everything I need in a lighter package.
Post reply on HN