Pushing a new CocoaPods Version with Trunk

CocoaPods is a useful dependency management tool for OSX and iOS. They’ve recently introduced some changes, to ease the process of publishing new versions of your Framework.

Just in case you’re lost, just like me, these are the commands required to push a new release:

[cc]
pod trunk register EMAIL@HERE.COM ‘Your Name’ –description=’MBP 15′
pod trunk me
pod trunk push FrameworkName.podspec.json
[/cc]

Note that after hitting trunk register, you’ll get an email to confirm your identity.

Codesign Check

Keychain access for iOS apps is tied up to the provisioning profile you use to sign the binary. So, what happens if you release a new build, signed using a different provisioning profile?.

Yes! your guess is accurate!. You loose access to anything you’ve stored in the keychain, resulting in (probably) deauthentication.

There is a command that allows you to verify the “Keychain Access Group” for a given executable. By means of this, you’ll be able to verify if your new release will have the same access than your previous build (assuming you also have that binary!).

Take notes…

codesign -d --entitlements - /path/AppName.OSX.1.0.2.xcarchive/Products/Applications/AppName.app/

Git toggled folders as submodules!?

Few days ago, i had to struggle with a strange scenario in which git began tracking a folder, as if it was a submodule.

Now, what’s strange with that?: i didn’t set any submodules!. My .gitmodule file was empty (in fact, i didn’t even have that file).

Thanks to this stackflow question, i ended up figuring out this solution:

git ls-files --stage | grep 160000
git rm --cached [Paths retrieved from the command above]

Hopefully, this will help another lost soul!

Shrinking EBS Volume

It took me a while to shrink my EBS volume, but this post helped quite a lot.
For further reference, this are the exact steps i’ve performed:

  1. Created a snapshot of the EBS volume, for backup reasons.
  2. Added a new volume, based on the snapshot.
  3. Added another volume with the desired size.
  4. Attached both, the Normal and Shrunken volumes.
  5. Check the big volume, and resize it:

    [cc]
    e2fsck -f /dev/bigvolume
    resize2fs -M -p /dev/bigvolume
    [/cc]

  6. Note that ‘resize2fs’ will say something like:
    [cc]Resizing the filesystem on /dev/xvdg to 1035624 (4k) blocks.[/cc]
  7. Let’s calculate how many 16MB blocks we’ll need:
    [cc]x = 1035624 * 4 / 1024 / 16 = 253[/cc]
  8. Proceed copy’ing blocks to the small volume:
    [cc]dd bs=16M if=/dev/bigvolume of=/dev/smallvolume count=253[/cc]
  9. Resize + Check the small volume:
    [cc]
    resize2fs -p /dev/smallvolume
    e2fsck -f /dev/smallvolume
    [/cc]
  10. Stop the instance.
  11. Detach the 3 volumes: Root, Big and Small.
  12. Attach the Small volume at the same location as the previous root volume was. In my case, /dev/sda1.
  13. Ready!