Fix For When Bash Can’t Find Its Debugger On macOS

Sometimes Bash needs its debugger but it can’t find it. It looks like this:

/usr/share/bashdb/bashdb-main.inc: No such file or directory
-bash: warning: cannot start debugger

For example when you start bashdb yourself with bash --debugger or set shopt -s extdebug. Another example is when your terminal turns it on.

Here is the fix that worked on my box:

brew install bashdb
bashhome=$(brew --prefix bash)
bdbhome=$(brew --prefix bashdb)
ln -s $bdbhome/share/bashdb $bashhome/share/bashdb
unset bashhome
unset bdbhome

Three Nice Looking Diff Tools and My Pick

1 Desire

Diff’s are hard. 80% of the time they are simple and fast. 20% of the time they are, well, complicated! My days of text-only diffs are coming to an end. They remain a part of my toolbox but I want a grown-up GUI diff tool. Fortunately there are plenty of options. But how to choose?

  • My decision making process was pretty simple: write down questions about them and answer them in a big spreadsheet
  • See where that takes me
  • Make a decision

Here is how it went.

Continue reading “Three Nice Looking Diff Tools and My Pick”

Speed Up FileVault2 Decryption

FileVault2 (FV2) provides disk encryption for OSX. I am unfamiliar with it.
I read about it at the Apple website. It doesn’t explain much. I wanted to know
how OSX handles it. To learn I tried it out.

After installing OSX I turned on FV2. The encryption was seamless. 8GB in 15m.
I installed 58GiB more of applications and copied files. Then I wanted to
re-provision the machine.

I booted into an external drive with OSX 10.9 (10.9) on it. I erased the disk on
the box. When I erased it I was asked for a new password. I provided it. I am
guessing that FV2 wanted a new password. I booted back into 10.9 and OSX
reported that FV2 is turned on. Seems like you can’t just wipe a FV2
encrypted partition. I asked OSX to decrypt the partition. It did and I tried
erasing the partition again and it worked fine. Going through the provisioning
process again I found that decrypting 58GiB takes about 2 hours.

Some experimentation left with the plan that when I want to re-provision a OSX
box I will erase the partition and re-image it and boot into it to decrypt the
partition. Surely there are command line tools to do so. I did investigate
that people I want directions that anyone may follow in the UI.

Moshi’s PalmGuard for the Macbook Pro is perfect

Having grown quite accustomed to ThinkPads, it has been a very long time since
I have worried about the palm rest of a laptop. All of that changed when the
Macbook came into my life. My biggest concern was the resale value of the
device, and I found thta the simplest possible solution what was to just take off my
watch and use my phone to keep time instead. In retrospect, that was kind of
stupid, so I bought one of Mochi’s palm rest protectors 1,
and it has far exceeded every expectation that I had of it.

My expectations:

  • Color matched, doesn’t make the device look like a two-tone paint job
  • Protects the device, doesn’t allow scratches
  • Make it easy and comfortable to wear a watch, thin and tidy
  • Easy to apply, no hair pulling to line things up
  • Touch pad works perfectly

All of those expectations were exceeded.

The color looks just fine to me. Sure it is a tad off, but what matters is that
the device is protected for resale. The pad protects the device flat out. My
watch sits just fine on it, it is thick enough to pad the watch and thin enough
barely to be noticeable. It was shockingly delightful to apply given the often
frustrating nature of such endeavors. The touch pad works perfectly with the
pad on top. The mouse, expose, window switching, and everything just works.
This was a shock given how many ways they could have screwed up here. Instead,
it just works. Very cool.

After installation I used a credit card to work out a few bubbles and and life
went on. For anyone worried that this might not work well for their machine,
I installed it on a 15″ Macbook Pro, and the product is for sale on Apple’s
website which is enough of an explicit endorsement for me.

All in all this has been an amazingly positive user experience and the product
has worked really, really well.

Update OSX 10.9 to use bash4

Source.

Script started on Sat Jun 21 12:25:07 2014
ESC[~> echo $BASH_VERSION
3.2.51(1)-release
gcr@orion:~> which bash
/bin/bash
gcr@orion:~> brew info bash
bash: stable 4.3.18, HEAD
http://www.gnu.org/software/bash/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/bash.rb
ESC[1;34m==>ESC[1;39m DependenciesESC[0m
Required: ESC[1;32mreadlineESC[0m
ESC[1;34m==>ESC[1;39m CaveatsESC[0m
In order to use this build of bash as your login shell,
it must be added to /etc/shells.
gcr@orion:~> brew install bash
[1;34m==>ESC[1;39m PatchingESC[0m
patching file arrayfunc.c
patching file bashline.c
patching file externs.h
patching file jobs.c
patching file lib/glob/glob.c
patching file lib/glob/gmisc.c
patching file lib/readline/display.c
patching file lib/readline/readline.c
patching file lib/sh/shquote.c
patching file parse.y
patching file patchlevel.h
patching file pcomplete.c
patching file subst.c
patching file test.c
patching file trap.c
patching file variables.c
patching file y.tab.c
ESC[1;34m==>ESC[1;39m ./configure --prefix=/usr/local/Cellar/bash/4.3.18 --with-installed-readlineESC[0m
ESC[1;34m==>ESC[1;39m make installESC[0m
ESC[1;34m==>ESC[1;39m CaveatsESC[0m
In order to use this build of bash as your login shell,
it must be added to /etc/shells.
ESC[1;34m==>ESC[1;39m SummaryESC[0m
/usr/local/Cellar/bash/4.3.18: 59 files, 7.4M, built in 41 seconds
gcr@orion:~> /usr/local/bin/bash --versinESCESC[Kon
GNU bash, version 4.3.18(1)-release (x86_64-apple-darwin13.2.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gcr@orion:~> sudo echo "/usr/local/bin/bashbug" >> /etc/shells
bash: /etc/shells: Permission denied
gcr@orion:~> sudo vi /etc/shells
Password:
ESC[?1049hESC[?1hESC=ESC[1;25rESC[?12;25hESC[?12lESC[?25hESC[27mESC[mESC[HESC[2JESC[?25lESC[25;1H"/etc/shells" 10L, 179CESC[>cESC[1;1H# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
gcr@orion:~> chsh

Then login again

gcr@orion:~> which bash
/usr/local/bin/bash
gcr@orion:~> echo $BASH-VESCESC[KESCESC[K_VERSION
4.3.18(1)-release
gcr@orion:~> bash --version
GNU bash, version 4.3.18(1)-release (x86_64-apple-darwin13.2.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
gcr@orion:~> exit

How to install R on OSX 10.9 Mavericks as of 2014-06-01T19:29:55-0500

Here is how to install R on OSX 10.9 Mavericks as of 2014-06-01T19:29:55-0500:

brew install gcc
brew tap homebrew/science
brew install R

Details:

gcr@orion:~> gcc --version
gcc (GCC) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

gcr@orion:~> r --version
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.2.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.

Continue reading “How to install R on OSX 10.9 Mavericks as of 2014-06-01T19:29:55-0500”