Live data from Hacker News

Htop explained

peteris.rocks

51–60 of 105 posts

Re: Htop explained

#51
post #15

I switched to macOS from Linux two weeks ago and I am starting to regret that decision. Most — if not all — the commands that I thought I had mastered after years working on Linux environments stopped working because their BSD counterparts have slightly differences that completely break everything I try to do. It is even more frustrating when I realize that I have to deactivate security features built-in the new Appl…

You should give Macports a try if you haven't already! I run it on my macbook, and it's made a world of difference. 99% of everything I use in Linux can be found in Macports, and it "just works" for the most part. You can't get kernel-specific things like strace, but they do have just about everything else. The big sell for me was being able to install the GNU versions of everything. Macports keeps everything in /opt…

One of the things that I really dislike about homebrew is its refusal to run via sudo plus the requirement that you own /usr/local.

This means:

1) It is a security hole; any application can now modify system-wide applications at any time.

2) You can't have multiple users able to use homebrew.

I was expecting homebrew to be something similar to apt/yum/etc, but this makes it pretty fundamentally different.

How does Macports handle this? Does $USER still need write access to /opt?

Re: Htop explained

#53
post #49
post #40

I like the investigation into various cruft that Ubuntu installs (and runs) that can safely be turned off. Goodbye polkit!

Uh, wait. Can't really get rid of policykit-1 on Ubuntu desktop, I think. Maybe server. Pretty OT, but does anyone know if that's true (or worthwhile?)?

To be a bit snarky, polkit is freedesktop dbus centric (and thus over-engineered) reimplementation of sudo for the GUI.

It uses a session tracker (used to be Consolekit, these days it is systemd-logind) to tell if something is running under an active user session and, and checks that against a bunch of rules (stored in XML, natch) to see if what is being attempted is allows (and if not, spawn a password prompt so the user can elevate their privileges).

If you want to do anything "complicated" like powering down your PC by clicking a button in your DE of choice you need polkit (and entourage) to be present these days.

Its one of those CADT things that seems to lead to "year of the (linux) desktop" never happening.

Re: Htop explained

#54
post #29
post #5

Earlier quoted context omitted.

unless by non-Linux you meant non-unix, htop recently got updated to better support BSDs and OSX/MacOS.

That's excellent news.

https://archive.fosdem.org/2016/schedule/event/htop/

Found a presentation from Hisham about the effort.

Re: Htop explained

#55
post #51
post #15

Earlier quoted context omitted.

You should give Macports a try if you haven't already! I run it on my macbook, and it's made a world of difference. 99% of everything I use in Linux can be found in Macports, and it "just works" for the most part. You can't get kernel-specific things like strace, but they do have just about everything else. The big sell for me was being able to install the GNU versions of everything. Macports keeps everything in /opt…

One of the things that I really dislike about homebrew is its refusal to run via sudo plus the requirement that you own /usr/local. This means: 1) It is a security hole; any application can now modify system-wide applications at any time. 2) You can't have multiple users able to use homebrew. I was expecting homebrew to be something similar to apt/yum/etc, but this makes it pretty fundamentally different. How does Ma…

It's also very difficult to roll back to a previous version of a package unless the maintainers specifically opt in to tagging them. Homebrew also updates itself when you install something now, so say if you install python, it might update readline, so your postgres client will break.

It's not the worst approximation of ports, but it doesn't share the quality and care that goes into package maintenance and dependency management.

Re: Htop explained

#56
Love this post, first function explanation for 'uptime' module gives a concise 'strace' demo showing how to determine the files the standard 'uptime' binary opens.

Really excellent example of showing your work!

Re: Htop explained

#57
post #51
post #15

Earlier quoted context omitted.

You should give Macports a try if you haven't already! I run it on my macbook, and it's made a world of difference. 99% of everything I use in Linux can be found in Macports, and it "just works" for the most part. You can't get kernel-specific things like strace, but they do have just about everything else. The big sell for me was being able to install the GNU versions of everything. Macports keeps everything in /opt…

One of the things that I really dislike about homebrew is its refusal to run via sudo plus the requirement that you own /usr/local. This means: 1) It is a security hole; any application can now modify system-wide applications at any time. 2) You can't have multiple users able to use homebrew. I was expecting homebrew to be something similar to apt/yum/etc, but this makes it pretty fundamentally different. How does Ma…

Re 2) I'm running a multi user homebrew setup for years. I have my users (personal and various work accounts) live under the "Local" Group and do

``` sudo chmod -R 770 /usr/local/ sudo chmod -R +a "group:Local allow delete,readattr,writeattr,readextattr,writeextattr,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit" /usr/local/ ```

I remember sometimes running into permissions issues but nothing re-running that command didn't fix.

Re: Htop explained

#58

Earlier quoted context omitted.

`brew install coreurils && brew install htop`

You probably also want to chmod +s htop, or it won't actually show you CPU/memory stats.

and if you want to use `sed` not `gsed`, do `brew install --default-names coreutils` to supercede the OS provided utilities.

Re: Htop explained

#59
post #41

I switched to macOS from Linux two weeks ago and I am starting to regret that decision. Most — if not all — the commands that I thought I had mastered after years working on Linux environments stopped working because their BSD counterparts have slightly differences that completely break everything I try to do. It is even more frustrating when I realize that I have to deactivate security features built-in the new Appl…

A little nitpick, dtrace is not an alternative to strace. DTrace is far more powerful. Alternative to strace would be dtruss, which is implemented through dtrace.

Until I can, as an unprivileged user, watch my own process's syscalls with dtruss, it's not an alternative to strace. Requiring root is a major hindrance.

Re: Htop explained

#60
post #39

Slightly related utility I discovered to my great delight today: ncdu - "htop for disk space usage" https://dev.yorhel.nl/ncdu

oh yes, i mostly don't bother with 'du -sch' anymore since ive come to know ncdu
Post reply on HN