105

Here is the laziest way (or homebrew way) First install Homebrew if you haven't Second brew install htop Third, done


31

If you're wanting to do this on an Apple keyboard, try this out: echo 1|sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd To get this to work for a lower version of Linux you can try this out: http://blog.chaselambda.com/2014/10/09/apple-keyboard-on-linux-3.8.html


23

One way to achieve that is via xmodmap. You can run xev to get key events. On running xev a box should appear and you can focus it and press the keys you want to swap. It should output details similar to for the Alt key: KeyPress event, serial 28, synthetic NO, window 0x8800001, root 0x25, subw 0x0, time 2213877115, (126,91), root:(1639,475), state 0x0, ...


23

If you only want to swap left alt and super key execute the command in your terminal: setxkbmap -option altwin:swap_alt_win To restore the default behavior just use: setxkbmap -option Note: This is temporary. If you want the effects permanently add it to your startup file.


22

It seems that NetworkManager automatically reuses an existing connection. In case your existing connection does not have any secrets stored, the new connection attempt will not update the existing connection and fail due to missing secrets. So in my case these steps helped: nmcli con delete <SSID> Then reconnect using nmcli dev wifi connect <SSID&...


21

It's currently not possible to install anything except Windows 10 on Apple computers equipped with T2 chip. This security chip makes it impossible to see the internal drive, Apple generously did an exception only for Windows 10 (but only if you install it via Boot Camp). A possible option could be Linux installed on a USB/Thunderbolt external drive, ...


18

Darling (link) is a project that aims to become analogous to wine. Currently it only runs some command-line OSX programs, though. As of mid-2019, it can run many command-line programs, and according to their homepage appears to be approaching the point where it can run some rudimentary graphical software as well. It probably won't run what you want just yet, ...


18

Set the EDITOR and VISUAL environment variables to nano. If you use bash on macOS, this is easiest done by editing your ~/.bash_profile file and adding the two lines export EDITOR=nano export VISUAL="$EDITOR" to the bottom of the file. If the file does not exist, you may create it. You should set both variables as some tools use one and others may use ...


17

I didn't convert the ISO to img, I just formatted a USB drive for FAT and used dd: sudo diskutil unmountdisk /dev/disk1 sudo dd if=./debian.iso of=/dev/disk1 bs=1m I tested this with Debian 9. It's important to note that the appropriate /dev/disk# should be determined by using the following command on the macOS command line: diskutil list In the ...


16

According to this SO answer, arch distinguishes between PowerPC (ppc) and Intel (i386), not between 32- and 64-bit kernels on x86. So in this context, i386 means an x86 CPU. Check the output of uname -m to find out your machine type. (On Linux, arch is the equivalent of uname -m.) See also this Ask Different Q&A.


14

I have a MacBook Pro Mid 2018 and managed to get the SSD working for like 10 seconds. When you live boot Linux Mint or Ubuntu and do: modprobe nvme Then check for the hardware ID of the Apple Storage controller by doing: lspci -nn | grep NVMe Then put that ID in the new_id file under nvme: echo 106b 2005 > /sys/bus/pci/drivers/nvme/new_id When you ...


14

On a macOS system, as on other BSD systems, you should use the machine utility: $ arch i386 $ machine x86_64h The i386 is misleading if you're used to the arch utility on other systems. On macOS Mojave, i386 means it's capable of running 32-bit software compiled for the Intel family of processors. Note that the arch utility on macOS is used for quite ...


13

The UltraVideo device If you look at the specs for that particular device it doesn't support Linux. Features Support Windows XP,Vista, Winodws 7,Windows 8, windows 8.1, Mac OS up to 10.9.4 (**Does NOT support XP 64bit and Windows Server**) System Requirements Does NOT support XP 64bit and Windows Server/Linux Other compatible devices? ...


12

Use neither: enter a filename and press Enter, and the file will be saved with the default Unix line-endings (which is what you want on Linux). If nano tells you it’s going to use DOS or Mac format (which happens if it loaded a file in DOS or Mac format), i.e. you see File Name to Write [DOS Format]: or File Name to Write [Mac Format]: press AltD or ...


12

PKCS#7 signature not signed with a trusted key This message is typically coming from a piece of hardware. In your case it's likely the Nvidia graphics card that's emitting this. This issue is discussed here in more detail, where 2 users were actually experiencing this issue, titled: PKCS Signature error/warnings running dmesg on Ubuntu Mate 18.04. If you ...


11

Regarding an explanation of the explanation: See the FreeBSD forum. Basically the OS X userspace is essentially FreeBSD (with small elements of NetBSD) but the kernel itself is a fork of the MACH Kernel that makes it more monolithic in nature (like the network stack and process model are in line with FreeBSD). For a technical description, you'll probably ...


11

Putting this in my .tmux.conf file was the trick: set -g history-limit 20000


10

I installed htop 0.8 (update: now 2.0.1) from MacPorts with sudo port install htop


10

You'll want to run brew install boost@1.55 $ brew search boost ==> Formulae boost ✔ boost-build boost-python boost-python@1.59 boost@1.57 boost@1.60 ✔ boost-bcp boost-mpi boost-python3 ...


10

You should not be using a Debian repository for Kali Linux. Either use a Kali repository, or switch away from Kali to a different distribution. Since you're a beginner it would make a lot of sense to consider a beginner's distribution. Kali is not a beginner's distribution. Instead, I would recommend Mint, Ubuntu or Fedora (but this is not an exhaustive ...


9

You can try using the undocumented adjust function of the asr command. It can change the filesystem type label, without actually changing the data. In your case, the appropriate command would be: sudo asr adjust --target /dev/disk0s2 --settype "Apple_HFS" This of course assumes that your underlying data hasn't been damaged, but as far as I'm aware, it's ...


8

Need differentiate the points of views: From the shell-users point of view here is no big differences. OS X is fully certified Unix operating system, so it's command line is fully compliant with Unix standards and POSIX. You have terminal with shell, all shell commands (BSD style), you can install e.g. macports for GNU-versions of commands. e.g. the bundled ...


8

Be brave. This is not a big deal. I'll simplify the article from Apple Support, which is wordy and long and documents every button push. Summary Rename the home folder. Update the Account with the new user and home folder names in System Preferences. Details Since you're changing system-level info, you need to have admin privileges. Create a new admin ...


8

The OS X version of date uses the -f option to parse a formatted date/time: date -j -f '%Y%m%d' "$1" +'%Y%m%d' The -j option causes it to just print the time, not try to set the system clock. So the full script would be: #!/bin/bash echo "$1"; startd=$(date -j -f '%Y%m%d' "$1" +'%Y%m%d'); echo "$startd"; Here's a transcript: $ ./testdate.sh 20151010 ...


8

sudo dscl . -read /Users/root Password If root is enabled it will output Password: ********, otherwise it will be just No such key: Password. Edit: After Apple's security patch 2017 Nov 29, if root is disabled, it may output Password: * Alternative: sudo plutil -p /var/db/dslocal/nodes/Default/users/root.plist | grep -A 2 passwd If the result is: "...


8

Well, if you know your IP starts with 10.16, it's trivial: ifconfig -a | grep -oP '\b10\.16\.[0-9.]+\b' Or, if your grep doesn't support -P or -o: ifconfig -a | awk '/10\.16\./ && /inet/{print $2}' If not, you could find all lines starting with inet and print their second field: ifconfig -a | awk '$1=="inet"{print $2}' That, however, would also ...


7

Pre-built binary Found this tutorial that shows how to do it. The steps are as follows: $ curl -O http://themainframe.ca/wp-content/uploads/2011/06/htop.zip $ unzip htop.zip $ sudo mv htop /bin $ rm htop.zip This binary is already pre-built so you should use caution when using executables such as this to make sure that they aren't malicious. Building it ...


7

I don't see why that error would occur. In fact, I am reasonably certain there were more lines to the error than you show; for one thing, there's no actual error message. However, that regular expression won't actually match either of your example files. You are using [a-z]+\.mp3 which will only match lower case letters and, since you're matching all the ...


7

Terminal vim uses colors that your terminal makes available (the ANSI colors you pick, presumably—unless your terminal offers 256 color mode or settable colors), but which of those colors it uses is controlled by the vim color scheme and if it believes the background is light or dark. You can check if the background is set to light or dark by :set ...


7

tmux supports Alt+key (Meta+key) by prefixing the key with M-, or Ctrl+key with the C- prefix in the key binding specification. There is no support for any other modifier keys. Related question on the SuperUser site: bind tmux prefix to OS X cmd key (or any other binding) Also this random Reddit post: tmux on OS X: how to use the Cmd key with bind? The ...


Only top voted, non community-wiki answers of a minimum length are eligible