Levitron Ion Revolution Platform "Ez Float" teardown

I bought this fun toy, but it had a misaligned LED so i had to disassemble it to fix it. I took some pictures to share with the world, in case someone is curious about the components or inner workings of this alien anti-gravity technology.

See here for product demo: https://www.youtube.com/watch?v=W6SSY7ABJkw

PCB photos follow:

Apple photos corrupted import from iPhone

I was importing my photos from my iPhone to my MacBook running El Capitan, and I got errors saying some files were in an unrecognised format, and some pictures turned out completely weird.

What’s sad is that the Photos app though that the pictures got successfully imported (apparently there was no integrity check), and so it reported back to iPhone that it could delete the photos after the “successful” import (according to the checkbox in the import dialog.)

Guess I’ll have to manually delete each photo on the iPhone after manually checking that all photos are in fact imported successfully now…

Personal Hotspot not working

Personal Hotspot disappeared from settings on iPhone when using a new SIM card? Googled for a solution but I didn’t find one. Seems that the problem was that the APN for personal hotspot wasn’t configured.

Go to Settings -> Mobile Data -> Mobile Data Network
Set the same settings under section Personal Hotspot as section Mobile Data

Super simple VPN over SSH (Mac and Linux)

There is a cute litte program called sshuttle for shuttling IP subnet traffic over and SSH connection, like a VPN but doesn’t require any setup on the remote end.

As far as i understand, it will add a firewall rule to the client saying which destinations to tunnel (the specified netmask), and will forward these packets using a python script through an ssh pipe to a python script in the other end that will spit out the packets into the target network.

Turns out in Yosemite Apple removed ipfw and moved over to pf, so in order to get it to work you need the newest version of sshuttle, from here (which supports pf):

https://github.com/sshuttle/sshuttle

…or install via homebrew

Sources:
https://ariejan.net/2012/07/11/vpn-too-complicated-use-a-ip-over-ssh-tunnel-instead/

Mac Photos Library on a NAS

I struggled a bit to find out how to store my Photo Library on a NetGear ReadyNAS. SMB did not work, and SSHFS did not work either. I was unable to get AFP working too, and I saw that it was discouraged.

The solution was to mount the drive using NFS. Then I created a sparse bundle disk image with a Mac OS Extended (Journaled) partition with an Apple Partition Map, on the NFS mounted partition, and moved my Photos Library.photoslibrary onto the mounted image. Everything seems to be running fast and smoothly. (I’m on a gigabit LAN.)

It should be noted that I use ext4 for my NAS partitions, don’t know if it matters.

Time Machine backup to NTFS without installing anything

Here’s a way to use an NTFS drive for Time Machine backups, even though it is used for other purposes too.

Find out the NTFS drive volume’s UUID:

1
diskutil info /Volumes/DRIVENAME | grep UUID

Put this in fstab: (Replace ENTED_UUID_HERE with the one you found from the previous command.)

1
sudo echo "UUID=ENTER_UUID_HERE none ntfs rw,auto,nobrowse" >> /etc/fstab

Eject, plug out and back in. MAKE SURE THE DRIVE WAS SAFELY REMOVED FROM WINDOWS, or it will not mount RW in Mac (See dmesg when plugging in).

Find your RW mounted volume

1
open /Volumes

Now we will create a Mac OS disk image on the NTFS volume.

  1. Open Disk Utility
  2. Click New Image
  3. Select a large enough size
  4. Format: Mac OS Extended (Journaled)
  5. Partitions: Single Partition - Apple Partition Map
  6. When done, mount this image

Now we will tell Time Machine to use this disk. It does not show up in the list of available drives, so we will use a command:

1
sudo tmutil setdestination /Volumes/MOUNTED-DISK-IMAGE

(Replace MOUNTED-DISK-IMAGE with the disk image you created, NOT the NTFS drive)

Now just test backing up and see that it works.

Resources:

I use this for backing up to my NAS via SMB/NFS

Mac OS X preferences and config tricks

So I bought a MacBook Pro and wanted to start using Mac OS X as my primary OS. I’m used to Windows/Linux so I have some preferences as to behaviour. There are some things that are kind of annoying, many of which can be fixed. Also there are some tricks that make me more productive.

Command line settings

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Disable trackpad acceleration:
defaults write .GlobalPreferences com.apple.trackpad.scaling -1

# If you have an external mouse, you have to disable its acceleration separately:
defaults write .GlobalPreferences com.apple.mouse.scaling -1

# Always show Finder path bar
defaults write com.apple.finder ShowPathbar -bool true

# Always show Finder status bar
defaults write com.apple.finder ShowStatusBar -bool true

# Show full path in Finder title:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES; killall Finder

# Set Current Folder as Default Search Scope
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

# Show All File Extensions
defaults write -g AppleShowAllExtensions -bool true

# Dock instant hide/show (disable Dock animation):
defaults write com.apple.dock autohide-time-modifier -float 0.00; killall Dock

# Disable character picker
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

# Speed up animation
defaults write NSGlobalDomain NSWindowResizeTime -float 0.03

# Don’t prompt for TimeMachine when plugging devices
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true

# Disable two finger swipe back/forward in browser etc.
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE

# Disable local time machine (I have an external backup)
sudo tmutil disablelocal

# Disable Creation of Metadata Files on Network Volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

# Disable Auto-Correct
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false

# Disable SpotLight (saves space and CPU)
sudo mdutil -a -i off

Finder tricks

Go to path:
Cmd + Shift + G

cd ..
Cmd +

cd / “Run” file
Cmd +

Print screen:
Cmd + Shift + 4 (press space to select window)

Keyboard shortcuts

System Preferences -> Keyboard -> Shortcuts -> keyboard move focus to next window: Cmd+<

Reduce animations

Makes mac faster and use less CPU/power:

System Preferences -> Accessibility -> Display -> Reduce transparency

Other

Remove iTunes Helper from Login Items to prevent auto launch on iPhone connect

In iTunes, for iPhone, enable *Manually manage music and videos.

http://osxdaily.com/2013/03/01/9-simple-tricks-improve-finder-mac-os-x/
http://osxdaily.com/2011/07/28/turn-off-auto-correct-in-mac-os-x-lion/

References

https://gist.github.com/lexrus/081fa687d8b2475d3367
https://github.com/divio/osx-bootstrap/blob/master/core/defaults.sh
https://github.com/herrbischoff/awesome-osx-command-line
http://osxdaily.com/2015/04/06/windowserver-high-cpu-usage-mac-os-x/