Skip to content

Instantly share code, notes, and snippets.

@amien8
amien8 / setup-php-dev.sh
Created December 19, 2015 22:17 — forked from mystix/setup-php-dev.sh
(OSX 10.7.x/10.8.x + Homebrew + nginx + mysql + php 5.4 + php-fpm + apc + xdebug) development environment
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql
@amien8
amien8 / xa-add.sh
Created December 14, 2015 08:34 — forked from rommelfs/xa-add.sh
add information about file into metadata of file to be indexed by spotlight (OS X centric)
#!/bin/bash -x
FILENAME="$1"
echo "Collecting attributes for $FILENAME" &&\
HASHMD5=`md5 "$1" | cut -d"=" -s -f2|tr -d " "` &&\
echo -e "MD5\t\t$HASHMD5" &&\
HASHSHA1=`shasum "$1" | cut -d" " -f 1` &&\
echo -e "SHA1\t\t$HASHSHA1" &&\
SHA2ALGOS="224 256 384 512" &&\
HASHSHA2_224=`shasum -a 224 "$1"|cut -d" " -f1` &&\
echo -e "SHA2-224\t$HASHSHA2_224" &&\
@amien8
amien8 / xa-add-comment.sh
Created December 14, 2015 08:34 — forked from rommelfs/xa-add-comment.sh
add comments to file in metadata to be indexed by spotlight (OS X centric)
#!/bin/bash
FILENAME="$1"
OLDCOMMENT="`mdls -r -nullMarker "" -n kMDItemFinderComment \"$FILENAME\"`"
echo "Old comment: $OLDCOMMENT"
while read LINE
do
COMMENT="$OLDCOMMENT $LINE"
done
echo "Updated comment: $COMMENT"
PATH=`pwd`
@amien8
amien8 / dupecheck.sh
Created December 14, 2015 08:33 — forked from sixman9/dupecheck.sh
dupecheck - identify potential duplicates of a file using Spotlight metadata
#!/bin/sh
# dupecheck - identify potential duplicates of a file using Spotlight metadata
# see http://www.macosxhints.com/article.php?story=20061003163429425
#
# by Derick Fay, October 2006
# Extended to check md5sums by Craig Hughes, October 2006 -- removed by Marc Shapiro, Oct 2006.
# Making more MacOS/Darwin standard and added speedups and efficiencies by Scott Barman
# Support filenames and attributes that contain spaces; avoid duplicates; replace expensive MD5 computation with 'cmp'; bug fixes. Marc Shapiro, Oct 2006
@amien8
amien8 / spotlight_cli.sh
Created December 14, 2015 08:33 — forked from natritmeyer/spotlight_cli.sh
An alias for your .bash_profile that allows you to search in the current folder using spotlight
function sl() {
/usr/bin/mdfind -onlyin \. $@
}
#usage:
# sl Search for this phrase
@amien8
amien8 / gist:3e1c4071a6480621c1a1
Created December 14, 2015 08:32 — forked from ssp/gist:2966967
UnicodeChecker + Spotlight + command line
# Assuming you have UnicodeChecker’s Spotlight support installed on your Mac,
# you can use mdfind to find unicode characters on your machine.
# A bit of command line wrangling later you may find the character names.
mdfind roman numeral uccharacter | xargs -I FILENAME -L 1 sh -c 'plutil -convert xml1 -o - "FILENAME" | xpath "//string[preceding-sibling::key/text()=\"name\"]/text()"; echo ""' 2>/dev/null
@amien8
amien8 / picasa2tags.sh
Created December 14, 2015 08:30 — forked from cjreeve/picasa2tags.sh
Copies picasa meta data (region names) to OpenMeta and Windows tags so they are searchable via Spotlight and windows search
#!/bin/bash
usage="
NAME
picasa2tags -- copies Picasa Region Names to OpenMeta and Windows tags
SYNOPSIS
picasa2tags [OPTION] [DIR/FILE]
OPTIONS
@amien8
amien8 / more.md
Created December 14, 2015 08:30 — forked from vasilisvg/more.md
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.

You should have a similar script.

@amien8
amien8 / README.md
Created December 14, 2015 08:30 — forked from redoPop/README.md
Hazel: "photo taken" custom date attribute

At the time of writing, Hazel's default date attributes all refer to an image file's creation date rather than the date on which the photo was originally taken. The two dates may differ.

This script provides a custom date attribute reflecting the time the photo was actually taken. As written, it's intended to be added as an embedded script in a "Run JavaScript" rule action, so that it's custom attribute can be used in subsequent "Sort into subfolder" patterns.

The date this script exposes is obtained via sips -g creation [filename]. It's not clear to me exactly which EXIF attribute the sips "creation" property comes from, but it seems reasonable to assume it's either DateTimeOriginal or DateTimeDigitized.

@amien8
amien8 / README.md
Created December 14, 2015 08:30 — forked from fnichol/README.md
Testing on Mac Platforms with Test Kitchen

Testing Mac Platforms with Test Kitchen

We'll assume an OS X Mavericks (10.9) box here.

Requirements

You'll need:

  • Vagrant
  • Vagrant's VMware Fusion provider