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

You do not have sufficient permissions to access this page: WordPress Contact Form ][ plugin

There is a problem that seems to still be plaguing many WordPress plugins since upgrading to WordPress 2.8.2 over the summer: Navigating to the plugin admin page results in the WordPress error, “You do not have sufficient permissions to access this page.” The only affected plugin on sites I maintain is the Contact Form ][ plugin. Zalds.com has a good write up on how to fix the problem for the Adsense Deluxe plugin, and the solution is the same for the Contact Form ][ plugin.

Here are the steps to fix the problem. It seems like a lot, but only because I am breaking it down into very fine steps.

  1. Log in to the admin area of the site.
  2. Go the the list of installed plugins by clicking the “Installed” link in the Plugins menu.
  3. Deactivate the Contact Form ][ plugin. It is not recommended to make changes to an active plugin.
  4. Edit the Contact Form ][ plugin by clicking the “Edit” link next to the Activate/Deactivate link. This will allow access to the actual PHP code of the plugin.
  5. Find the text “admin_head” using the browser find functionality, just like you would search for text in a web page (usually “Control-F” on Windows, “Command-F” on Mac).
  6. Change “admin_head” to “admin_menu”.
  7. Hit the “Update File” button.
  8. Go back to the list of installed plugins and reactivate the Contact Form ][ plugin.

To better illustrate the line that needs changed, this line:

    add_action('admin_head', 'wpcf_add_options_page');

needs to be changed to look like this:

    add_action('admin_menu', 'wpcf_add_options_page');

The zalds.com solution has some screen captures to illustrate the process as well, although that fix is for the Adsense Deluxe plugin. Again, the process is identical, so substitute “Contact Form ][” for “Adsense Deluxe” in that solution, and you should regain access to the admin pages for the Contact Form ][ plugin.

Tech stuff: The admin_head hook should not be used to add plugin specific content to admin pages, as it adds the plugin specific content to every admin page, which has the potential to break other plugins. More on this topic here.

Incidentally, the author of the Contact Form ][ plugin seems to have stopped maintaining it and has taken his site down, apparently due to lack of donations.