- OS X Yosemite (10.10.5)
- MacBook Pro (Retina, 15-inch, Mid 2015)
これやらないとなにも始まらない。
#! /bin/bash | |
# extracts a log file for a specified host from Papertrail tsv file | |
HOSTNAME=$1 | |
FILENAME=$2 | |
TSVFILE=$3 | |
awk -F '\t' "{if (\$5 == \"$HOSTNAME\" && \$9 == \"$FILENAME\") print \$10}" $TSVFILE |
diff -Naur before/usr/share/google/set-hostname after/usr/share/google/set-hostname | |
--- before/usr/share/google/set-hostname 2016-03-16 18:30:48.000000000 +0900 | |
+++ after/usr/share/google/set-hostname 2016-03-16 18:34:57.000000000 +0900 | |
@@ -14,6 +14,9 @@ | |
# Deal with a new hostname assignment. | |
+# *** The below line is added by patching. *** | |
+new_host_name=$(curl --fail --silent http://metadata/computeMetadata/v1/instance/attributes/hostname -H "Metadata-Flavor: Google") | |
+ |
#!/bin/bash | |
WORD=$1 | |
TMP_FILE=/tmp/wsay.wav | |
[ -z "$WORD" ] && echo "arg missing" && exit 1 | |
WAV_URL=$(curl -s http://ejje.weblio.jp/content/$WORD | grep playSwfSound | sed -e "s/^.*playSwfSound('\([^']*\)', *'\([^']*\)'.*).*\$/\1\2\.wav/") | |
curl -s -o $TMP_FILE $WAV_URL | |
afplay $TMP_FILE |
#!/bin/bash | |
# Notify elapsed seconds when command is finished | |
# (Mac OS X only) | |
# How to setup: | |
# 1. `brew install terminal-notifier` | |
# 2. Put this file in your /bin dir | |
# How to use: |
var MongoClient = require('mongodb').MongoClient; | |
var mongoUri = "mongodb://192.168.11.2:27017/hoge"; | |
function mapM(fs, cb) { | |
var xs = []; | |
function _mapM(fs, cb) { | |
var f = fs.shift(); | |
f(function(x) { | |
xs.push(x); | |
if (fs.length == 0) { |
hoge: hoge.c | |
gcc -o $@ -g $^ `pkg-config --cflags --libs /usr/lib/x86_64-linux-gnu/pkgconfig/openssl.pc` | |
.PHONY: clean run | |
clean: | |
rm -rf hoge hoge.o | |
run: hoge | |
./hoge |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" $request_time ' |
#!/bin/sh | |
## see https://pqrs.org/osx/karabiner/document.html.ja#export | |
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner | |
$cli set remap.jis_command2eisuukana_prefer_command 1 | |
/bin/echo -n . | |
/bin/echo |
# This fomula is based on: https://raw.githubusercontent.com/Homebrew/homebrew/108279f2050e8768dd8ffd372285d09b6b00d9b7/Library/Formula/pango.rb # pango 1.36.1 | |
require 'formula' | |
class Pango < Formula | |
homepage 'http://www.pango.org/' | |
url 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.36/pango-1.36.1.tar.xz' | |
sha256 '42e4b51cdc99e6878a9ea2a5ef2b31b79c1033f8518726df738a3c54c90e59f8' | |
option 'without-x', 'Build without X11 support' |