Saturday, October 12, 2013

Even More Mac Tricks

So one thing I ended up doing was assigning Ctrl-T to Open New Tab and Shift Ctral T to Reopen Closed Tab - I use Ctrl-Tab to switch between tabs and it just feel strange to have to use Cmd-T to open a tab and Ctrl-Tab to switch between tabs. Anyways, here goes.

Networking, VMs and Firewalls

I use Samba to share files with my Windows Machines at home. However, for some reason, the PF firewall on my Mac does not allow SMB connections through. While it is possible to load custom rules into PF using Icefloor or manually, its often simplest just to disable PF as:
sudo pfctl -d
and when you are done, re-enable it as:
sudo pftcl -e

Another option: Use a VM. You can setup a Ubuntu VM with Bridged Networking, setup Shared Folders between your Mac and the VM and then share things on the VM via SMB. It works out way better than Mac's SMB implementation (in Lion, Apple switched to their own SMB implementation to avoid having to comply to GPLv3) This is not recommended unless you have a Mac with at least 8 GB of RAM.

Another nice feature of bridged networking: it bypasses VPN so your VM will be outside the VPN even when your host is inside the VPN. I generally setup multiple network cards in my VM, one with NAT, one with Bridged and then connect the relevant card depending on what I want to do with the VM. Disadvantages of Bridged Networking: you will need to add your VMs MAC to any WiFI MAC filter if you have enabled it in your Router and it does not work with GSS/Cert based networks. And obviously, it doesn't work over VPNs.

Other Mac Weirdness

For some reason, every time I connect to another Linux machine using NX client on my Mac, it keeps switching on the Caps-Lock of the other machine. Now since Caps-Lock is pretty much useless anyway, the cleanest fix I have found to this is to disable caps lock entirely on the target machine.

Then there are NTFS formatted USB HDDs - one of my friends recently gave me his USB HDD to copy some stuff. However while I could read from it, I couldn't write to it. Turns out, Mac turns off Write capability on NTFS drives by default. To get around this, you have to manually create an entry for the drive in fstab. Then when you are done using the drive, you have to unmount it from the command line using the diskutil command.

Final Notes

I have yet to find a good replacement for Visio on my Mac. Omnigraffle looks to be good - lets see, I might get it. Some other interesting stuff I found:
  • How to use your Mac as an Alarms Clock:
  • How to reset your NVRAM:
  • How to reset your SMC: