Changing Primary Domain for a Google Apps account

Changing the primary domain name on a Google Apps account is a non-trivial process. I recently needed to do this for a customer, and created a console application that makes the job easier.

This works on OS X and Linux; Windows support is unknown (and will not be tested by me). It’s written in Go, so you will need to have a Go development environment set up to build or run it.

Continue reading Changing Primary Domain for a Google Apps account

Installing collectd with Minimal Dependencies on Ubuntu Server 14.04

Installing collectd with the usual command on an Ubuntu 14.04 server:

sudo apt-get install collectd

results in a ton of packages being installed:

acl
at-spi2-core
ca-certificates-java
collectd
collectd-core
colord
dconf-gsettings-backend
dconf-service
default-jre-headless
fontconfig
fontconfig-config
fonts-dejavu
fonts-dejavu-core
fonts-dejavu-extra
hicolor-icon-theme
java-common
libasound2
libasound2-data
libasyncns0
libatk-bridge2.0-0
libatk1.0-0
libatk1.0-data
libatspi2.0-0
libavahi-client3
libavahi-common-data
libavahi-common3
libcairo-gobject2
libcairo2
libcanberra-gtk3-0
libcanberra-gtk3-module
libcanberra0
libcolord1
libcolorhug1
libcups2
libdatrie1
libdbi1
libdconf1
libdevmapper-event1.02.1
libesmtp6
libexif12
libflac8
libfontconfig1
libgd3
libgdk-pixbuf2.0-0
libgdk-pixbuf2.0-common
libgphoto2-6
libgphoto2-l10n
libgphoto2-port10
libgraphite2-3
libgtk-3-0
libgtk-3-bin
libgtk-3-common
libgudev-1.0-0
libgusb2
libharfbuzz0b
libieee1284-3
libjasper1
libjbig0
libjpeg-turbo8
libjpeg8
liblcms2-2
libltdl7
liblvm2app2.2
libmemcached10
libmnl0
libmodbus5
libnotify4
libnspr4
libnss3
libnss3-nssdb
libogg0
libopenipmi0
liboping0
libpango-1.0-0
libpangocairo-1.0-0
libpangoft2-1.0-0
libperl5.18
libpixman-1-0
libpq5
libprotobuf-c0
libpulse0
librabbitmq1
librrd4
libsane
libsane-common
libsctp1
libsensors4
libsndfile1
libsnmp-base
libsnmp30
libtdb1
libthai-data
libthai0
libtiff5
libtokyocabinet9
libtokyotyrant3
libupsclient3
libv4l-0
libv4lconvert0
libvarnishapi1
libvirt0
libvorbis0a
libvorbisenc2
libvorbisfile3
libvpx1
libwayland-client0
libwayland-cursor0
libxcb-render0
libxcb-shm0
libxcomposite1
libxcursor1
libxdamage1
libxfixes3
libxi6
libxinerama1
libxkbcommon0
libxpm4
libxrandr2
libxrender1
libxtst6
libyajl2
lksctp-tools
notification-daemon
openjdk-7-jre-headless
rrdtool
sound-theme-freedesktop
ttf-dejavu
ttf-dejavu-core
ttf-dejavu-extra
tzdata-java
x11-commoni

Most likely this is overkill. To install with minimal dependencies:

sudo apt-get --no-install-recommends install collectd

which results far fewer dependency packages being installed:

collectd
collectd-core
fontconfig
fontconfig-config
fonts-dejavu-core
libcairo2
libdatrie1
libdbi1
libfontconfig1
libgraphite2-3
libharfbuzz0b
libltdl7
libpango-1.0-0
libpangocairo-1.0-0
libpangoft2-1.0-0
libpixman-1-0
librrd4
libthai-data
libthai0
libxcb-render0
libxcb-shm0
libxrender1

Much better.

Bonus: Saltstack state example:

Install collectd:
  pkg.installed:
    - name: collectd
    - install_recommends: False

Convert from FLAC to ALAC

Sites that sell lossless usually offer only FLAC files. To convert to ALAC for iTunes and iDevices using ffmpeg:


for f in `ls *.flac`; do ffmpeg -i $f -c alac ${f/flac/m4a}; done

This assumes the current directory is the directory containing the FLAC files.

Explanation:

  • For all .flac files
  • Call ffmpeg with the original file as input (-i $f)
  • Use the ALAC codec (-c alac)
  • Name the output file the same as the input file but with a m4a extension (${f/flac/m4a})

More on for loops in bash from the OS X command line.

Recovering Videos Deleted from iPhone

My 19 month old daughter loves to watch videos on my iPhone. She knows right where to go in the Photos app — either in the Camera Roll folder to watch videos we might have recently captured, or in the “Videos” folder containing videos from the computer. Content in the Videos folder is safe from deletion, but not content in the Camera Roll. Occasionally she gets to tapping on the screen and starts the process of sending a video to someone via email (inevitably to someone in my contact list that I haven’t contacted in years), or accidentally deleting a video. More than once she has deleted a video I wished to keep.

I’ve seen “undelete” iPhone apps on the web, but no free ones. In my case, I frequently charge/sync my iPhone with my computer, but only occasionally download the Camera Roll photos and videos to an image or video editor. Figuring the video must be on my computer as part of a recent iPhone backup. I went looking for them. Continue reading Recovering Videos Deleted from iPhone