John Piasetzki's Blog

My Thoughts

Adding Boomerange to Google App for Business (or When Is SSO Not SSO)

When is single sign on not single sign on? When you’re dealing with Google App for business. I was trying to get Boomerang working for someone on App Engine. Won’t working so I was like “I know must need single sign on turned on”. I logged in to admin and then went to Advanced tools and then “Set up single sign-on (SSO)”. Wrong. This was a long rabbit hole. You actually need to go to “Federated Login using OpenID”

iOS 6 Maps Breaks Facebook Check-in

While at Toronto Underground Market I was trying to check-in on facebook. No luck, Here is the view from iOS6.

iOS 6 Facebook Check-in

Here is the same view from an iOS 5 phone in the same spot.

iOS 6 Facebook Check-in

I tried inspecting the flow with mitmproxy but wasn’t able to get the dummy SSL file working. I would have thought check-ins would have been done by tags near to a lat and long but I guess facebook depends on the maps places.

Add Your Picture to Google Results

While Googling myself I noticed some sites were showing the authors pictures beside them on the search result. Here is the before and after of my site.

Before

Steps

Add a link to your header (remember to at ?rel=author on the end of your Google+ profile link)

“In head”
1
<link rel="author" href="https://plus.google.com/u/0/105541666620931424750?rel=author" />

Add the following somewhere on the page

“Anywhere on the page”
1
By <a rel="author" href="https://plus.google.com/u/0/105541666620931424750?rel=author">John Piasetzki</a>

Verify your email address at https://plus.google.com/authorship Wait for google to update

After

If you run into any trouble you can see whether Google is picking up the author with the Rich Snippet Tool.

Next Level Dotfile Management With Libetc

I’ve previously written up my method for managing dotfiles with a git repo and hooks (Git dotfiles without the bloat). I recently found out about libetc which is awesome! It reroute any request to ~/.anything to ~/folder/anything

To get started you’ll need to install libetc. For me it was a simple pacman -S libetc and then add

”.*rc”
1
2
3
export XDG_CONFIG_HOME=~/.dotfiles
export LD_PRELOAD=libetc.so.0
export LIBETC_BLACKLIST=/bin/cp:/bin/ln:/bin/ls:/bin/rm:/usr/bin/find

to .xinitrc and .bashrc (or .zshrc in my case).

1
mkdir .dotfiles && mv .* .dotfiles && cp .dotfiles/bashrc .bashrc && cp .dotfiles/xinitrc .xinitrc

and a reboot and you should be go to go with a nice clean home directory.

Upgrade OpenBSD From 4.5 to 5.1 in 4 Hours

Time flies. I hadn’t realized I was so far behind on updates (3.25 years!). I had originally held back on updating because I heard about softraid changes coming down the pipe in 4.7 however these have long pasted and turned out to not be an issue. It’s a testament to OpenBSD that it just kept work all this time.

For the actually upgrade I started with http://openbsd.org/faq/upgrade47.html and just continued until I reached 5.1. I used the Upgrading without install kernel method because I don’t have a monitor and keyboard hooked up.

Command:

1
mkdir /usr/rel && cd /usr/rel && ftp ftp://ftp.openbsd.org/pub/OpenBSD/5.1/`machine -a`/

And then

1
mget *`

After that just follow the instructions as necessary. I didn’t rebuild my raid array and dnsmasq and samba didn’t work out of the box but other then that suprisely pain free for a 3 year set of updates!

Dnsmasq on OpenBSD 5.1

One of the packages that broke when I was updating to 5.1 was dnsmasq. The dnsmasq package doesn’t appear to yet be set up to work with the new rc.d. There is a port that is however I prefer to work with packages so here are the steps to get the package working.

First navigate to the rc.d directory and download the start script:

1
cd /etc/rc.d && ftp ftp://ftp.openbsd.org/ports/net/dnsmasq/pkg/dnsmasq.rc

Open the file and change line 5 to read:

/etc/rc.d/dnsmasqd
1
daemon="/usr/local/sbin/dnsmasq"

At this point test starting the service by running:

/etc/rc.d/dnsmasqd
1
/etc/rc.d/dnsmasqd start

If it say it starts in rc.conf.local add:

/etc/rc.conf.local
1
pkg_scripts="dnsmasqd"

And you should have a speedy dns server setup!

Install LFS in VirtualBox

  1. Create a New VirtualMachine (Setting operating system to Linux and Version to Linux 2.6)
  2. I’m going to use Ubuntu for the Host System so download the latest iso.
  3. Go to Settings on the VirtualBox -> Storage. Select the CD IDE controlller and point it to the ISO file. Also check the live CD checkbox.
  4. Boot up the VirtualBox and you’re ready to go (I prefer to use the commandline so hit ctrl + f1 bring up your first tty).

Follow along with the book

For the depencies and the latest ubuntu I needed to install patch, texinfo, m4, gawk, bison (sudo apt-get install patch texinfo m4 gawk bison).

Followed the book with no problem except at the end if it complains about unknown filesystem type devtmpfs you’ll want to recompile your kernel according to https://answers.launchpad.net/lfscript/+question/186427

PHP Auto Image Resizer

I wrote a small script that automatic resizes images. A simple .htaccess and thumbnails.php that will automatic create resized images. If an image exists at http://example.org/img/test.jpg and someone vists http://example.org/img/test_10x10.jpg it will copy the image and resize it to 10 x 10 serve it and save a copy in the folder.

It’s smart too and checks whether the image exists. If the image exists it just serves it up. Otherwise if the base images exists it creates it or returns 404.

If you want it you can get it via gumroad at [https://gumroad.com/l/Cscd](htt ps://gumroad.com/l/Cscd)

Download Your Github Receipt With Cron

Github is awesome! I love using it for sharing code.

Github’s receipt system is less awesome. I try to keep all my receipts (never know when your taxes will get audited).

My workflow used to be:

  1. Get emailed receipt
  2. Download and file in proper folder
  3. Archive email.

After three months of that I wrote a python script that downloads the pdfs for me.[1] Now I just run it on cron and auto archive the emails.

Ideally Github would make a private repo for ever account that would get update with your receipt. A monthly pull and you would be up to date.

[1] I use John Wiegley’s excellent ledger so I use my ledger branch to also print an update the ledger file.