Hot answers tagged

32

Here is the laziest way (or homebrew way) First install Homebrew if you haven't Second brew install htop Third, done [Updated htop to htop-osx, thanks @clwen] [Updated: htop is actually an alias to htop-osx, so both will work] [Updated 27/03/2016: htop use the latest version from original author, just tested it on El Capitan works fine. Thanks @...


7

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


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

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


7

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


7

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


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


6

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


6

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


5

Unfortunately, it's still very buggy, as per this post on the openSUSE forums lots of stuff still doesn't works: What I have working so far: Retina Display - openSUSE looks fantastic at 2880x1800! Booting in emulated BIOS mode Booting in EFI mode Keyboard and Trackpad - full support including the function key on the keyboard, the keyboard ...


5

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


5

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


5

Perhaps the closest thing to what you are looking for is MacPorts (or some other package management system like Homebrew). It can be used to install software(including many Unix software) easily.


5

sudo dscl . -read /Users/root Password If root is enabled it will output Password: ********, otherwise it will be just No such key: Password. Alternative: sudo plutil -p /var/db/dslocal/nodes/Default/users/root.plist | grep -A 2 passwd If the result is: "passwd" => [ 0 => "********" ] Then root is enabled. If it's: "passwd" => [ 0 => "...


4

There are quite a few Macbook users in the Arch community. There is good documentation on the Arch wiki about installation, and a few threads in the forums describing issues and fixes. Macbook on the Arch Wiki Page with detail on the aluminium model


4

Ubuntu 12.04 and Mint 11 are both rough going. Trackpad support is minimal, though slightly better in Ubuntu than Mint. Even with tweaks, neither works well. No easy answers if you need to run a second monitor. Wireless keyboard and magicmouse... won't work. Even hours spent researching these issues will get you nowhere. Ubuntu forums offer no easy answers, ...


4

I found the most compatible distro's for my Macbook pro's (9,1 and 10,1) tend to be Ubuntu and Fedora. The Xorg drivers for the Macbook touchpad kinda suck, but I haven't messed with that stuff for a couple of years now. Fedora tends to have lots of guides readily available for installs to a Mac. Fedora has out of the box support for EFI systems. So no ...


4

You can blacklist the bluetooth kernel module: echo bluetooth >> /etc/modprobe.d/blacklist.conf This should disable the device from being initialized. As far as -bt 0. I was able to google it with disable bluetooth "bt 0". The first result suggests it was a flag passed to hal to disable bluetooth. Unfortunately hal is depreciated so this ...


4

If you're wanting to do this on a mac keyboard, try this out: echo "1" > /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


4

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


4

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


4

webster is not a common command among Unix systems. It is not a part of Debian's apt repository and it is also not part of the two major packaging tools Homebrew and MacPorts. Probably it is only available on Stanford computers. However additional commands can be installed with ease using one of the two. I would suggest using Homebrew since many packages ...


4

I have the mid 2015 macbook pro (UK keyboard), and have most of the features working with Fedora 22. The brightness setting returning to 100% after reboot, and non-working hibernation/shutdown are the only two issues I'm aware of that I haven't fixed. Here's what I did: Mac OS Boot: Probably not much different to Marcelo's response, but I fixed this by ...


4

Unix is not an OS but rather a family of OS. Mac OS is OS. Linux is not OS but a kernel If you want to learn C programming it doesn't matter on which OS you use because all that matter is compiler. Different compiler will give you slightly different binary but for learning purpose they will all be almost same. I recommend clang or gcc for novice users ...


4

In your example export PATH=./ndk_tools/bin/:${PATH} export CC=arm-linux-androideabi-gcc export CXX=arm-linux-androideabi-g++ echo \ "$CC" CC --version the last line uses the literal name CC (which is conventionally a C++ compiler) rather than a shell variable $CC (which would use the environment variable that you exported). Perhaps you meant export ...


3

It is vastly the kernel that determines compatibility with the hardware and its quirks rather than the distribution. Perhaps the only thing that would really matter in terms of the distribution is whether the default kernel for that operating system was lacking support for some of your hardware, or modules or other packages required for your hardware were ...


3

Well, a change is always a trade of problems. There is no ideal operating system. I do not know what software you use/need, but vtk and gsl are both available for any modern Linux distributions. Driver problems are usually hardware dependent ... do a couple of google searches for your hardware and Linux and see if other people have any problems. If you ...


3

i manage to answer my own question, for comparing string in vimscript we should use =~ instead of == . The reverse one is !~ So edit this line if s:uname == "Darwin" to if s:uname =~ "Darwin" to make this little script work. I rewrite this as function: function! GetRunningOS() if has("win32") return "win" endif if has("unix") if system('...


3

I was able to boot to USB on XServe G4. I was using the "memstick" bootable image I obtained from FreeBSD ftp://ftp.freebsd.org/pub/FreeBSD/releases/powerpc/powerpc/ISO-IMAGES/10.2/ I inserted my USB stick into the first usb port (in OF, it is known as "usb0") Note, this has to be done directly for some reason; you can't insert the USB stick into a hub. ...



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