Putting your .dot files in a repository

After 15 years of manually copying my dotfiles between my machines I finally decided it was time to put them in a repository.

GitHub has a good page explaining why you’d want to do this along with many links to different scripts. I settled on dotfiles because it seemed the simplest and at this point, I didn’t want too many moving parts.

Let’s imagine you have a single .vimrc file that you want to manage.

# Install dotfiles
pip install dotfiles
# Copy ~/.vimrc to ~/Dotfiles/vimrc and symlink ~/.vimrc to ~/Dotfiles/vimrc
dotfiles --add ~/.vimrc

At this point, you now want to manage your Dotfiles directory somehow. I’ve become partial to Bitbucket lately given that they let you have unlimited private repositories. Congratulations! You’re almost done.

On a new machine, clone your repostiory in to ~/Dotfiles and then run

dotfiles --sync

And that’s it! It makes me wonder why I didn’t do this years ago.

 

Bulk-queueing photo posts on Tumblr

Let’s suppose you have a folder full of images and you want to queue
each image as a unique post
in Tumblr. You spend a few minutes manually
uploading each one as a queued post in your browser before exclaiming,
“Argh! This is terrible! There must be a better way…”

Several minutes of googling later you proclaim, “Argh! I can’t believe no one has made a tool to do this!”. Time to pour yourself a drink and break out some python.

  1. Install python-tumblpy
  2. Register an app for yourself on Tumblr – you’ll need this to get a valid oauth token for uploading
  3. Download and run this script

It will authorize your app and generate an oauth token. Pass it a list of images on the command line and each one will be uploaded and queued as a unique post. Each image that is successfully uploaded has “_done” added to its filename.

Enjoy!