Saturday, June 22, 2013
Ripping Blu-rays for Mac OSX, the WD TV Live and everything else
I rip my Blu-rays to play on our WD TV Live (firmware 1.06.43_V), Macs and mobile devices (iPad, iPod, Samsung Galaxy Note II). There have been many issues over the last few years, with subtitles being the last one to solve.
I keep uncompressed mkv files to play on the WD TV Live (and as master copies) and transcode to m4v for all the other devices.
- Rip with Makemkv. I use an external Blu-ray drive on a MacBook Pro. Make sure all english subtitle tracks (forced only) are selected. VLC (2.0.6) plays subtitles correctly but the WD TV Live doesn't.
- Remux the mkv with MKVToolNix using the default settings - fixes the WD TV Live subtitles issue.
- Transcode with Handbrake (0.9.9 x86_64). Use the iPad profile and on the Subtitles tab select Foreign Audio Search, Forced Only, Burned In.
Wednesday, November 24, 2010
Divvy
Continuing on from my post about Optimal Layout I also tried out Divvy (version 1.2.3) for more efficient window management on Mac OS X. My work setup is a MacBook Pro with an external display and Spaces enabled. An important goal is to achieve keyboard only window control.
Divvy is a very simple app. It essentially enables you to divide the screen up into a virtual grid and snap the current window to a region within that grid. The other major feature is the ability to assign keyboard shortcuts to particular regions, enabling you to position and size the current window to one of your predefined regions with ease. There is also an option to use the keyboard shortcuts to move the current window to another display, which I find quite useful.
To tile all the windows on the screen in a particular layout requires shifting the focus to each window to position and size it. If your Divvy shortcuts correspond to where you want the windows than this whole process can be done fairly quickly, without touching the mouse/trackpad. Having said that, I would love to define a layout on the Divvy grid and with a keyboard shortcut arrange all windows on the current screen into that layout.
I have Windows XP running in a Parallels VM in Coherence mode and Divvy does not seem to work with the Windows windows. Some applications (such as Activity Monitor) also have restrictions on window size that Divvy can't change.
Over the days I was trialling Divvy on my work MacBook Pro, I found myself missing it on the Mac at home. For USD14ドル and a license that supports use on multiple Mac's, it is good value.
Tuesday, November 23, 2010
Optimal Layout
Inspired by xmonad on linux, I tried out Optimal Layout (version 1.1.2) for more efficient window management on Mac OS X. My work setup is a MacBook Pro with an external display and Spaces enabled. An important goal is to achieve keyboard only window control.
In Optimal Layout, tiling windows in an arrangement requires
- explicitly selecting the windows in the Optimal Layout UI
- selecting a layout from a list
- selecting the target display
My most common use case is to arrange windows in the current space on the display with the focus, i.e. my current context. There are too many steps for this to feel efficient.
The available window layouts are predefined, including the window sizing. After arranging windows, sizing adjustments can be made using the sticky resizing feature, but this requires using the mouse. Furthermore, should you open one more window, you have to go through the whole process again.
I am disapointed with Optimal Layout and am trying out Divvy, which I will post about next.
Saturday, June 6, 2009
F# Interactive on Mac OS X
Installing F# on Mac OS X is easy (with MacPorts):
$ sudo port install fsharp
I have version 1.9.4.19 installed. Microsoft released a newer version several weeks ago, however it doesn't seem to have made it into MacPorts yet. Then to start F# Interactive:
$ fsi --readline --no-gui
There is basic history with the up/down arrows, but the usual emacs key bindings are not available, so entering and editing text is very slow and painful. I tried to fix this with rlwrap.
$ sudo port install rlwrap
As fsi is already using readline, rlwrap needs the
-a option, See the man page for details, but on the mac you are required to provide a string (representing a password prompt the wrapped application might show) argument for this option. It is completely unnecessary for me at the moment, so I just picked something obvious as a placeholder.$ rlwrap -aPassword: fsi --readline --no-gui
F# Interactive starts up with the usual splash text, but there seems to be some control characters automatically input and the console clears to something like this:
- 0;3R0;3R;3R;3R;3R;3R;3R
The emacs key bindings work, so this text can be deleted with
C-a C-k and terminating the now empty line as per normal in fsi with ;; brings up the usual fsi prompt.Unfortunately, if you type in an invalid expression eg. x = 3;;, the cursor is placed in the middle of the error message. When pressing up arrow to go back through the history, sometimes the prompt is replaced by partial text from a viewed history line.
So this is a pretty dodgy solution. If anyone knows how to get it to work properly, please leave a comment.
Thursday, April 16, 2009
MacBook water resurrection
Over Easter, my (adorable) 4 year old daughter was watching a DVD on my MacBook and she spilt a cup of water on it. When I got to it, the MacBook had water on the keyboard and had stopped working.
After wiping off the liquid on the outside, I pulled out all the parts that are fairly easy to access - battery, RAM and hard drive. The hard drive casing was wet. One RAM stick had a few small drops on it and both had a white powder on the contacts. I wonder if this was a residue from rapidly evaporating water. I propped the MacBook upside down, with the parts still out, hoping it would dry overnight. I didn't hold much hope.
The next morning I put it back together and tried to power it on, but no go.
We traveled home Monday and that night I plugged it in and it actually booted up. There was a wet patch in the bottom of the screen, but otherwise it was working fine. I couldn't believe it.
I found this post, so the next day I tried it. Two terminals executing yes> /dev/null to max out the CPU and the screen open at about 45 degrees, to try and catch the heat. About 4 hours later the wet patch was gone.
I am writing this post on the MacBook. Amazing!
Monday, February 23, 2009
Moving Virtual Box VM to another host
I have Windows XP running in a Virtual Box VM. The iMac it was running on is getting intermittent screen artifacts, so time to switch machines.
I found this, which led me to believe that moving hosts is possible. The VM is named "Win XP" and has one snapshot. I mucked up the transfer the first time. These are the steps I followed the second time, which worked.
- Moved
~/Library/VirtualBox/HardDisks/Win XP.vdito the same location on the new host. - Copied
~/Library/VirtualBox/Machines/Win XPto the same location on the new host. - In the old
VirtualBox.xmlthere was aHardDisktag with the attributelocation="HardDisks/Win XP.vdi"that contained a childHardDisktag (I had one snapshot). Copied these into the newVirtualBox.xml. - Copied the appropriate
MachineEntrytag from the oldVirtualBox.xmlto the new one.
The VM started up on the new host with no problems.
Also stumbled across a site with downloadable Virtual Box images.
Thursday, November 27, 2008
Lock screen via keyboard on Mac OS X
I want to easily lock the screen on Mac OS X, preferably without using the mouse or having to install any other utilities. Assuming the security setting requiring a password to wake from sleep or screensaver is set, here is what I have found:
Control-Ejectkey sequence will bring up the Restart, Sleep, Shutdown dialog window. Presssto put the computer to sleep. From comments on The Design of the Mac OS X Shutdown Feature via Keyboard shortcut of the day.- Add
/System/Library/Frameworks/Screensaver.framework/Versions/A/Resources/ScreenSaverEngine.appto the Dock (via Quickly lock your screen). Unfortunately Spotlight doesn't seem to find this app, however the keyboard shortcut to open the Dock isControl-F3and typingscselects the ScreenSaverEngine.
Command-Alt-Eject will put the mac to sleep. Thanks to Kristian.
Friday, November 21, 2008
VirtualBox - OS Virtualisation on the Mac
Parallels and VMware Fusion both look like good OS virualisation solutions for the Mac. However, with the the current Aussie dollar, the US80ドル licence fee (same price for both of them) is quite expensive, especially if you also need to acquire a license for Windoze as a guest OS.
I stumbled across VirtualBox, which is now owned by Sun. It is touted as:
... the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL).
This can be a little misleading, as there is a dual licensing model, with various useful features only available in the closed-source version.
The closed-source version is available under a Personal use and evaluation license. The strange, but good thing, is that it seems ok to use this version if you want to install it on your machine at work. From point 6 in the licensing faq:
Also, if you install it on your work PC at some large company, this is still personal use. However, if you are an administrator and want to deploy it to the 500 desktops in your company, this would no longer qualify as personal use.
So on that basis, I installed it on my iMac at work and it was trivial to get a Ubuntu 8.04 Desktop guest VM up and running. The bundled user manual provided instructions on installing the Guest Additions which improved the interaction between host and guest OS.
Now if I could only find a version of Windows XP licensed in a similar manner. :-)
Wednesday, November 12, 2008
Jungle Disk R.I.P.
In the past I have tried to manage my files by storing then in Git and keeping a central repository on Amazon S3 via Jungle Disk. I was using this system from two different macs and a linux machine and when it worked, it worked well, but the intermittent corruption/synchronisation issues were a killer.
My fallback plan was to store the central repositories on encFS on a USB memory stick instead of Jungle Disk over S3. I tried with the USB stick formatted as FAT32 and then ext3 but that also had intermittent failures.
Over the last few weeks I have ditched the linux machine and stored the repositories in an encrypted sparse disk image on the USB stick formatted as Mac OS Extended (Journaled). It has worked very well so far!
Wednesday, August 13, 2008
Maths Symbols in NeoOffice
I wanted to have a character (representing the integers) in a NeoOffice document on Mac OS X 10.4. I couldn't find an installed font containing the character and according to Wikipedia I need a Blackboard Bold typeface style. After a few google searches I found a jsMath font that seemed to work fine.
Friday, July 25, 2008
FileVault and EncFS on Mac OS X (Leopard)
In the past I have used FileVault in attempt to protect files in the event of my mac falling into dubious hands. I find it frustrating on a few counts:
- the root user can access your files while you are logged in
- it regularly asks to reclaim space when logging out, making logging out much slower
On my linux machine I am using EncFS, which is working out well. So I thought I would try and install EncFS via MacPorts. I ran into all the following issues:
- boost 1.34.1 still won't build on Mac OS X 10.5 Leopard
- MacFUSE 1.7 fails to build
- encfs: configure fails
Then I ended up with an error I couldn't find a solution for:
$ sudo port install encfs
---> Building encfs with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_fuse_encfs/work/encfs-1.4.2" && make all " returned error 2
...
FileUtils.cpp:163: error: 'make_binary_object' was not declared in this scope
make[2]: *** [FileUtils.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Error: Status 1 encountered during processing.
So I uninstalled MacFuse in MacPorts and used the installer from the MacFuse homepage. After installing EncFS from here and a reboot, I had success.
Wednesday, July 9, 2008
Converting a CD to FLAC Files (Mac OS X)
I have the following software installed:
The following process would be significantly simpler if one app provided both a decent rip log and metadata lookup.
There is no point being concerned with the quality of the audio unless you know if there were errors introduced in ripping the data off the CD. xAct shines here. Max does not provide enough details, although there is a ticket open with the developer to fix that.
Max does well with metadata. xAct is poor.
The process
$TMP and $GIT_REPO represent file paths, e.g. $TMP=$HOME/tmp- Rip CD using xAct, saving files to
$TMP/xAct. [1] - Save xAct output to
$TMP/xAct/xAct.rip.log - Check the log for errors. After the first section of the log file, search for each occurence of 'track' to quickly find the right spots to check.
- Open Max. It will automatically detect the CD and pop up a window. Check the metadata and fix/enter it if necessary.
- Download album art. Press
Command-Din Max. It will automatically search. Choose one of the listed images (assuming some are found). [2] - Rip to FLAC using Max (I have set my output directory to
$TMP) $ mkdir $TMP/max-rip
$ mv $TMP/[Artist]/[Album]/*.flac $TMP/max-rip- Convert
$TMP/xAct/*.wavto FLAC using Max. $ mv $TMP/*.flac [Artist]/[Album]- Ensure that all files in
[Artist]/[Album]have the same names as those inmax-rip. Assumemax-ripas correct - we set the metadata in step 4. The following should identify if there are any differences:$ cd $TMP/[Artist]/[Album]
$ ls -1 ../../max-rip> /tmp/ls.txt; ls -1 | diff /tmp/ls.txt -; rm /tmp/ls.txt - Generate FLAC fingerprints:
$ metaflac --show-md5sum *.flac> ffp.txt
$ mv ffp.txt $GIT_REPO/flac fingerprints/[Artist] - [Album].ffp.txt $ mv $TMP/xAct/xAct.rip.log $GIT_REPO/log/[Artist] - [Album].xAct.rip.log- Transfer tags from the files ripped with Max. I use the following script:
find . -name "*.flac" | while read FILE
do
FIXED=`echo $FILE | sed 's/ /\\ /g'`
metaflac --export-tags-to=- "../../max-rip/$FIXED" | metaflac --import-tags-from=- "${FILE}"
done - Transfer album art (if it was found and used in step 5) from the files ripped with Max. I use the following script:
metaflac --export-picture-to=cover.jpg ../../max-rip/01*
ls -lh cover.jpg
echo "Adding album art ..."
find . -name "*.flac" -exec metaflac --import-picture-from=cover.jpg {} \;
rm cover.jpg - Move
$TMP/[Artist]/[Album]to music library rm -rf $TMP/xAct $TMP/max-rip- In the root directory of the music library:
$ md5deep -rl * | sort> $GIT_REPO/md5deep.txt - Check the $GIT_REPO changes and commit
[1] See FLAC Encoding Guide for mac for a details on using xAct.
[2] At this stage I do not know the correct way to handle album art, as the players have a variety of ways of dealing with it. For the moment, I have chosen to store it in the metadata of each file.
Thursday, July 3, 2008
FLAC Players on Mac OS X
iTunes doesn't play FLAC files by default, which is not suprising given Apple has kept ALAC proprietry and FLAC is an open competitor.
Cog is a free, open source audio player that supports FLAC. It works, but is fairly minimalistic. I couldn't find any way to manage playlists in the UI (version 0.07), although the Help indicates it supports M3U and PLS. There is no real concept of a library of music - just the files and folders as organised on the filesystem.
Songbird is a free media player built on top of the Mozilla stack. I think the idea is to access media from the web and your own local media in the one tool. Apparently it has FLAC playback issues. It also doesn't read album artwork from metadata yet.
Fluke is small utility that enables FLAC files to be played in iTunes. The version I tried (0.11) was a little cumbersome to use as you need to import the FLAC files with Fluke, which I found to be a slow process. Secondly, the track number and album art from the FLAC metadata did not show up in iTunes.
Play is a free audio player. It shows your music as a library that can be browsed via different attributes, has playlists and keyboard shortcuts. No cover flow or album artwork though, but for me that is icing, rather than a necessity.
I am trying Play for now and will give Songbird another go once it is more reliable.
Saturday, June 7, 2008
JungleDisk on Mac OS X 10.4.11
By default JungleDisk mounts to /Volumes/JungleDisk with read/write permissions to all users. So any other user on the machine can access it while it is mounted (a possibility if an SSH server is running or Fast User Switching is enabled).
This situation can be slightly improved by stopping the automatic mounting and manually mounting to a more appropriate directory. Assuming other users don't have permissions to access your home directory:
- In JungleDiskMonitor -> Preferences -> Jungle Disk Options, change the "Mount volume on startup as:" field to be empty.
- Quit JungleDiskMonitor and start it up again. The JungleDisk volume should not be mounted.
$ mkdir $HOME/jungledisk$ mount_webdav http://localhost:2667/ $HOME/jungledisk
A question about this has been asked in the forums, but I can't see a resolution yet.
Configuration is located at
$HOME/Library/Preferences/jungledisk-settings.ini. While the file is in plaintext, the AWS secret key and encryption/decryption keys are actually located in the login keychain, not in the configuration file.The cache is located at
$HOME/Library/Caches/jungledisk/cache. It is not encrypted. This can be protected by using FileVault, although in a multi-user situation (SSH Server of Fast User Switching), once logged in, the home directory is effectively unencrypted, accessible by root and any other user depending on filesystem permissions. Another option is an encrypted disk image, which has the same sort of mult-user issues once it is mounted. I haven't tried encfs on the mac yet.
Thursday, June 5, 2008
Secure File Storage on Amazon S3
I decided to use Amazon S3 for hosted file storage. I would like to store files using rsync as well as storing Git repositories. Some of this data will be private, so I would like it encrypted while it is stored on S3, but decrypted from the perspective of the tools on my computer. I am planning to access S3 from a number of trusted computers running either Mac OS X or linux.
I found a few ways to mount my S3 space as a filesystem:
- PersistentFS. Free FUSE filesystem for linux, not sure about Mac OS X.
- ElasticDrive. FUSE filesystem for linux, Mac OS X not available yet. Free for 5GB, significant price jumps after that and the price is per OS installation. However it is a block device and seems to do much more than I need.
- s3fs FuseOverAmazon. Free FUSE filesystem for linux and Mac OS X.
- JungleDisk. Mac OS X and linux support. Commercial, but costs only 20,ドル which includes lifetime updates and can be installed on multiple machines. Supports encryption using 256 bit AES. Optional service at 1ドル per month that provides block-level file updates and resuming file uploads.
Friday, March 7, 2008
Converting a Subversion repository to Git
Previously, I had tried converting from a local Subversion repository to Mercurial. I thought I would try converting the same projects into Git.
Firstly, to install Git on the mac with Subversion support:$sudo port install git-core +svn
Secondly, setup an authors file to map Subversion committer names to appropriate Git format.
Now my local svn repository has multiple projects in it. The layout is like:
bar/artifacts
branches
tags
trunk
foo/artifacts
branches
tags
trunk
git-svnimport seems to expect the standard svn directories (branches, tags, trunk) to be at the root. So for each import, the paths to these directories need to be specified explicitly.
Foo is a fairly new project with no branches, 2 tags and about 27 commits.
$git-svnimport -C foo -A authors.txt -T foo/trunk -t foo/tags file:///path/to/reposCompleted with no errors.
Bar is an older project with 1 branch, 13 tags and about 464 commits.
$git-svnimport -C bar -A authors.txt -T bar/trunk -t bar/tags -b bar/branches file:///path/to/repos
Initialized empty Git repository in /Users/cbrad/tmp/bar/.git/
...
fatal: Needed a single revision
64: cannot find commit 'origin'!
...
Use of uninitialized value in system at /opt/local/bin/git-svnimport line 877.
fatal: Failed to resolve '' as a valid ref.
Cannot create tag 10:
There were many of the 'fatal: Needed a single revision' errors.
This article mentions the potential for issues if the svn repository layout had changed over time. The bar project was one of the first things in this repository, so it has been moved and changed several times, as the overall repository layout evolved. I tried doing imports around the movement points in the history, with the view to merge (like in this post), but that also failed.
I guess I can start a fresh Git repository, add the current project head and keep the svn repository lying around for reference, but I was hoping not to have to do that.
Friday, February 29, 2008
Setting up Subversion to Mecurial conversion on Mac OS X 10.4.11 take 2
My first attempt at this was the hard way. The easier way is to use MacPorts:$sudo port install subversion subversion-python24bindings
Unfortunately though, I still get the same errors as in my first attempt, when trying to convert the same Subversion repositories.
Thursday, February 28, 2008
Setting up Subversion to Mecurial conversion on Mac OS X 10.4.11
If I am to switch over to Mercurial, I need to be able to import my existing projects that are in Subversion. Mercurial includes a Convert extension for this purpose, so I thought I would try and get it going on my Mac.
[EDIT: This is the hard way. See this post , for the easy way.]
I already had Subversion 1.4.3 installed (compiled from source), but didn't have the Python bindings installed, so I used this article and the instructions in the file subversion/bindings/swig/INSTALL, located in the Subversion source.
I thought I should build against the same version of Python as Mercurial was using. As I had installed Mercurial from MacPorts, Python 2.4 was located under /opt/local/. This meant my configure statements were as follows.
swig:$./configure --with-python=/opt/local/bin/python2.4
Subversion:$./configure --prefix=/usr/local --with-openssl --with-ssl --with-zlib --enable-swig-bindings=python PYTHON=/opt/local/bin/python2.4
The bindings need to be in the python path, so I also created the file:/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/subversion.pth
with the contents:$ cat subversion.pth
/usr/local/lib/svn-python
To confirm the bindings are installed correctly, the following command should execute with no output:$/opt/local/bin/python2.4 -c "from svn import client"
I am not particularly happy with this installation. Compiling source that depends on a port makes me feel uncomfortable. Perhaps it is because I am unfamiliar with MacPorts or just the fact that I have to remember that this dependency exists and not to do anything that may affect it. I also installed swig 1.3.33 (the latest), however the Subversion docs only refer up to version 1.3.29.
So far I have been unable to successfully complete a conversion of a Subversion repository. Trying the example from the Mercurial docs starts working, but after a little while fails:$ hg convert http://code.sixapart.com/svn/memcached
assuming destination memcached-hg
initializing destination memcached-hg repository
scanning source...
sorting...
converting...
710 Fix for flush_all 1-second window bug. You can now do a "set" immediately
...
698 cleanup, cleanup, cleanup, cleanup.
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 0.9.5)
Traceback (most recent call last):
File "/opt/local/bin/hg", line 14, in ?
mercurial.dispatch.run()
...
File "/usr/local/lib/svn-python/libsvn/ra.py", line 511, in svn_ra_check_path
return apply(_ra.svn_ra_check_path, args)
libsvn._core.SubversionException: ("PROPFIND request failed on '/branches/client-xs-20070328/Cache-Memcached-GetParserXS/const-c.inc'", 175002)
Also tried converting one of the work Subversion repositories. It starts working, but after a little while fails with a different error:** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial@selenic.com
** Mercurial Distributed SCM (version 0.9.5)
Traceback (most recent call last):
File "/opt/local/bin/hg", line 14, in ?
mercurial.dispatch.run()
...
File "/opt/local/lib/python2.4/site-packages/hgext/convert/__init__.py", line 267, in convert
if "\n" in desc:
TypeError: iterable argument required
Haven't tried converting a local Subversion repository yet.
Installing Mercurial on Tiger
Thought I would jot down my experiences installing Mercurial on a Mac running Tiger. Mac’s are great for some things, but they can be a bit of a pain when it comes to installing unix open source software.
The first thing I tried was installing the latest binary package from the Mercurial site. It is dependent on python, so first I installed MacPython 2.5 by following the link on the Mercurial Page. Then I tried installing the Mercurial binary package, but it complained because it couldn’t find Apple Python. Tried rebooting, didn’t work, go figure.
The second thing I tried was building from source. This is my preferred way of installing this kind of software, because you can explicitly manage the versions yourself. However the build failed because I didn’t have the documentation tools installed (these can be installed via MacPorts). Also, I didn’t seem to have my python path set up properly, because the built hg executable barfed with an error.
The third way I tried was installing via MacPorts. This worked very easily, once MacPorts was installed. The current version of MacPorts required a newer version of Xcode tools than what was already installed. So it was off to the apple developer site (I already had a login) to download the latest version, which is about 1GB.
IMHO, to have to sign up to an Apple site to get the current C compiler so you can build open source software is really poor form from Apple.