89

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


24

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


20

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, ...


18

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, ...


17

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, ...


15

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

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.


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? ...


13

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 ...


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 ...


10

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


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 ...


10

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 ...


9

As far as I know, the Command key modifier syntax (<D-...>) is only effective in GUI-mode instances of Vim on Mac OS X. The Vim instance must be GUI-based because most terminal emulators (Terminal, iTerm, etc.) do not generate control sequences for Command key combinations, so a tty-only instance of Vim has no way to know that a Command key ...


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 ...


9

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


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

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 ...


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

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 ...


7

I have arch linux installed on my Macbook Pro 7.1 & everything works perfectly. For special keys -> pommed Touchpad driver -> default works fine (has two finger scroll & three finger middle click pre-configured). I am not really sure about the two GPU things as I have only one Nvidia 320M. Sleep on closing lid is pretty easy.


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

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 ...


7

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

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 ...


6

You seem to be confusing bash with perl. The default shell on your mac is bash, which cannot set variables in the same way, or using the same syntax, as perl. To set a variable called '$number' to the result of '13 * 2' using perl, on a bash CLI, you would: my-macbook:~ $ perl -e '$number = 13 * 2; print $number, "\n";' 26 To do the same thing in bash ...


6

According to a Lifehacker how-to, it is possible to dual-boot an Intel-based Mac with OSX and GNU-Linux, but you'll need to shrink your HFS partition and create an EXT3/4 partition and a swap partition in that space (instead of installing in/on an HFS partition). The following is verbatim from that How-To: Boot your Mac into OS X. If you're lucky, this ...


6

For tmux you can alter its scrollback buffer with set-option history-limit 10000 The default is 2000. You can put this directive in your ~/.tmux.conf or at the tmux command prompt (prefix + :). It looks like iTerm is integrated with tmux. See: https://gitlab.com/gnachman/iterm2/wikis/TmuxIntegration


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