PowerShell equivalent of find

TL;DR: gci -r -fi <filename-pattern> My favorite use of find in bash is to find files whose name matches a pattern. For instance, find all the jar files under this directory: bash# find . -name ‘*.jar’ In PowerShell, there’s a program called “find” but it ain’t the same program. Short Answer Instead, use Get-ChildItem. The … Read morePowerShell equivalent of find

PowerShell for `rm -rf`

TL;DR – Remove-Item -Recurse -Force <path> On linuxy systems, rm -rf <path> means “remove this path and everything under it, dammit.” If the files aren’t writeable, but you own the files, it deletes them anyway. In PowerShell, rm is aliased to Remove-Item, but it doesn’t accept -rf. Windows Terminal> rm -rf fooRemove-Item : A parameter … Read morePowerShell for `rm -rf`

Line endings in git

Git tries to help translate line endings between operating systems with different standards. This gets sooo frustrating. Here’s what I always want: On Windows: git config –global core.autocrlf inputThis says, “If I commit a file with the wrong line endings, fix it before other people notice.” Otherwise, leave it alone. On Linux, Mac, etc: git … Read moreLine endings in git

Migrating some services from AWS to Pivotal Web Services

My objective is to run some services on Pivotal Web Services (PWS; hosted instance of Pivotal Cloud Foundry), and have them respond to requests to `https://survey.atomist.com` at various paths. Currently these services run on AWS, along with services that respond at other subdomains of atomist.com. TL;DR: this is easy enough for HTTP requests and prohibitively … Read moreMigrating some services from AWS to Pivotal Web Services

git: handy alias to find the repository root

To quickly move to the root of the current git repository, I set up this alias: git config –global alias.home ‘rev-parse –show-toplevel’ Now,  git home prints the full path to the root directory of the current project. To go there, type (Mac/Linux only) cd `git home` Notice the backticks. They’re not single quotes. This executes the command and then uses … Read moregit: handy alias to find the repository root

Cropping a bunch of pictures to the same dimensions

Ah, command line tools, they’re so fast. And so easy to use on a Mac. Given a bunch of image files in the same dimensions, that you want to crop to a fixed portion of the image: 1) Install imagemagick brew install imagemagick 2) put all the images in a directory by themselves, and cd … Read moreCropping a bunch of pictures to the same dimensions

Logs are like onions

Or, What underlying implementation is clojure.tools.logging using? Today I want to change the logging configuration of a Clojure program. Where is that configuration located? Changing the obvious resources/log4j.properties doesn’t seem to change the program’s behavior. The program uses clojure.tools.logging, but that’s a wrapper around four different underlying implementations. Each of those implementations has its own ideas … Read moreLogs are like onions