mysqldump -h<host> --compatible=postgresql -u<user> -p <database_name> > /tmp/my_dump.sql
cat my_dump.sql | mysql -h<host> -u<user> -p <database_name>
| module ActiveAdminHelper | |
| def admin_arbre_context | |
| @admin_arbre_context ||= Arbre::Context.new(assigns, self) | |
| end | |
| def default_renderer | |
| case controller.send(:resource_class).name | |
| when "ActiveAdmin::Page" | |
| "page" |
| #!/bin/sh | |
| if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi | |
| exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit | |
| -- another way of waiting until an app is running | |
| on waitUntilRunning(appname, delaytime) | |
| repeat until my appIsRunning(appname) | |
| tell application "Messages" to close window 1 | |
| delay delaytime | |
| end repeat |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.
$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10
$ pyenv install 2.6.9
| # If you installed Hadoop and Pig with Homebrew on OS X, then get this error: | |
| # | |
| # ERROR org.apache.hadoop.mapreduce.lib.jobcontrol.JobControl - Error whiletrying to run jobs.java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected. | |
| # | |
| # Then this formula is for you. It downloads pig src, then builds it for >Hadoop 2.3 | |
| # | |
| # | |
| require 'formula' |
| # lib/tasks/db.rake | |
| namespace :db do | |
| desc "Dumps the database to db/APP_NAME.dump" | |
| task :dump => :environment do | |
| cmd = nil | |
| with_config do |app, host, db, user| | |
| cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
| end | |
| puts cmd |
| exiftool -n -g -json \ | |
| -imagewidth \ | |
| -imageheight \ | |
| -composite:gpslatitude \ | |
| -composite:gpslongitude \ | |
| *jpg \ | |
| | jq --compact-output --arg urlBase http://mysite.net/myphotos/ \ | |
| '{ | |
| "type": "FeatureCollection", | |
| "features": |
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |