Raspberry Pi3の初期設定

再インストールをしたので設定をメモしておく。

初期設定
まずは設定を変更する。
sudo raspi-config
設定画面が表示されるので以下を対応する。
4 Localisation Options
I2 Change TimezoneをAsia – Tokyoにする。
HHKを使っているためキー配置を変える必要があるので下記を設定する。
I3 Change Keyboard LayoutでGeneric 102-key (Intl) PC – Other – Japanese – Japanese (Macintosh)を選択する。(以降はデフォルト)

5. Interfacing Options
P2 SSHでSSHを有効にする。

7.Advanced Options
A1 Expand Filesystemを有効にする。
CUIで使う場合はメモリを節約するため、A3 Memory Splitを16にする。

設定を反映するためここで再起度する。

Wi-Fi設定
まずinterfacesの設定から。

sudo vi /etc/network/interfaces
下記を追加
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

次にWi-Fiの接続情報の設定をする。
パスワードは暗号化した方がよいが今回は家のLANしか使わないのでそこまでしない。
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
追加する内容
country=JP
network={
ssid="[SSID]"
psk=[PASS]
key_mgmt=WPA-PSK
}

IPを固定する場合は下記を設定する。
sudo vi /etc/dhcpcd.conf
最後に追加
interface wlan0
static ip_address=192.168.0.100/24
static routers=192.168.0.1
static domain_name_servers=8.8.8.8

ネットワークインターフェイスを再起動する。

sudo ifdown wlan0
sudo ifup wlan0
iwconfig wlan0

今回は試していないがSDカード作成時にWi-Fiの設定をできる模様。
参考サイト

TEFCASとは

TEFCASについてのメモ。
マインドマップを考えた人が考案したらしい。

Trial(Try-all) 試行
Event 出来事
Feedback 反応
Check 点検
Adjust 調整
Success 成功

上記の頭文字を取ってTEFCAS(テフカス)と言うらしい。
大切なのは一番下のSuccessから始めること。

Successをイメージして、TryするとEventが起きる。

そこからFeedbackを受けて、できない要因をCheckする。

改善するためにAdjustする。

上記を繰り返して改善していくことで最終的に成功するという流れ。

Youtube

インセプションデッキ

プロジェクト管理の勉強中に見つけたインセプションデッキについてのメモ。
プロジェクト管理といえばPMBOKが有名だが、インセプションデッキは10個の質問に答えていくだけでプロジェクト管理に必要な情報が一式揃えることができる。
詳しいことは書籍「アジャイルサムライ」に詳しいことが書いてある。

インセプションデッキの10個の質問

1.我われはなぜここにいるのか
プロジェクトの目的やゴールを確認する。

2.エレベーターピッチを作る
30秒以内に2センテンスでプロジェクトをアピールするとしたら、何を伝えるべきか。
テンプレートがある。
・[潜在的なニーズを満たしたり、抱えている課題を解決したり]したい
・[対象顧客]向けの、
・[プロダクト名]というプロダクトは、
・[プロダクトのカテゴリー]である。
・これは[重要な利点、対価に見合う説得力のある理由]ができ、
・[代替手段の最右翼]とは違って、
・[差別化の決定的な特徴]が備わっている。

3.パッケージデザインを作る
キャッチコピーと3つのユーザーアピール、パッケージのイメージを決める。

4.やらないことリストを作る
やること、やらないこと、あとで決めることを一覧として明確にする。

5.「ご近所さん」を探せ
プロジェクトの関係者を再確認する。

6.解決案を描く
システムアーキテクチャの概要を書く。

7.夜も眠れなくなるような問題は何だろう
リスクと対策を考える。

8.期間を見極める
プロジェクトの期間を決める。

9.何を諦めるのかをはっきりさせる
トレードオフ・スライダーを使って優先度をつける。

10.何がどれだけ必要なのか
予算、期間を決める。

参考
原文
インセプションデッキ の テンプレート (日本語版)

RaspberryPi3にDockerでLAMP環境を構築

RaspberryPi3にDocker(Docker Compose)でLAMP環境を作るまでのメモ。
Dockerのインストール方法はメモしてないがhypriotではなく標準のDockerを入れた。

Docker Composeのプロジェクト構成は下記のような感じ
/home/pi/docker_lamp
├─ conf -> Webアプリの設定ファイル
│ ├─ Dockerfile
│ └─ php.ini
├─ db -> MySQL関連
│ ├─ Dockerfile
│ ├─ my.cnf
│ └─ mysql_data
├─ html -> DocumentRoot
└─ docker-compose.yml

conf/Dockerfileの内容

FROM php:7-apache

RUN apt-get update && \
apt-get -y install mysql-client && \
docker-php-ext-install pdo_mysql mysqli mbstring

COPY ./php.ini /usr/local/etc/php/

conf/php.iniの内容

[Date]
date.timezone = “Asia/Tokyo”

[mbstring]
mbstring.internal_encoding = UTF-8
mbstring.language = Japanese

db/Dockerfileの内容
※MySQLの公式ではエラーになるのでhypriotを使う

FROM hypriot/rpi-mysql:latest

COPY ./my.cnf /etc/mysql/conf.d/my.cnf

db/my.cnfの内容

[mysqld]
character-set-server=utf8
datadir = /var/lib/mysql

docker-compose.ymlの内容

version: ‘3’
services:
app:
depends_on:
– db
build: ./conf
ports:
– 80:80
volumes:
– ./html:/var/www/html
links:
– db
db:
build: ./db
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
ports:
– 3306:3306
volumes:
– ./db/mysql_data:/var/lib/mysql

docker-composeでビルドして起動。
docker-compose build
docker-compose up -d

htmlにindex.phpを用意してブラウザで開いた際にページが表示されればインストール成功。

参考サイト
Docker for MacとDocker ComposeでささっとLAMP環境を作る
Docker Hubのオフィシャルイメージを使ったLAMP環境(Apache+PHP+MySQL)構築

Xcode9.2でCarthageがエラーになる

環境
macOS High Sierra 10.13.2
Xcode9.2

Realmの勉強をしようとしてCartfileを作ってcarthage updateを実行してみたものの、なぜかエラーになってしまった。

carthage update –platform iOSの場合だとSwiftのバージョンのエラーになる。
carthage update --platform iOS
*** Fetching realm-cocoa
*** Downloading realm-cocoa.framework binary at "v3.0.2"
*** Skipped installing realm-cocoa.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38) and the local version is 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)."

no-use-binariesオプションをつけるとDeveloperToolのパスが違うというエラーになった。
carthage update --platform iOS --no-use-binaries
*** Fetching realm-cocoa
*** Checking out realm-cocoa at "v3.0.2"
*** xcodebuild output can be found in /var/folders/fc/v8sh7c913pg_vrz149mkcxfw0000gn/T/carthage-xcodebuild.GMkcIK.log
A shell task (/usr/bin/xcrun xcodebuild -project /Users/naoyuki/Documents/git/ToDo/Carthage/Checkouts/realm-cocoa/Realm.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

ネットで調べた所、Xcodeのパスに問題があるっぽい。
【メモ】Xcode9ビルドでCarthage経由で導入したライブラリに関してswift version errorが発生

xcode-select -pを実行すると次のパスになっていた。
/Library/Developer/CommandLineTools
これをXcodeのパスに変更。
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcode-select -p
/Applications/Xcode.app/Contents/Developer

改めてcarthage updateを実行すると今度はうまくいった。
carthage update --platform iOS --no-use-binaries
*** Fetching realm-cocoa
*** Checking out realm-cocoa at "v3.0.2"
*** xcodebuild output can be found in /var/folders/fc/v8sh7c913pg_vrz149mkcxfw0000gn/T/carthage-xcodebuild.rwc5nk.log
*** Building scheme "Realm" in Realm.xcworkspace
*** Building scheme "RealmSwift" in Realm.xcworkspace

Hatena Blogが新規登録ができなくなって、そのうちサービス終了しそうなので、今後はこちらのブログに書いていく予定。

旧はてなブログ

Hello world!

Welcome to your new Blog! We’re really excited to see what you do with it.

This draft post is here to show you what your posts will look like and to give you a few tips on getting started. Feel free to edit it, delete it or keep it saved as a draft for reference later.

Publishing

If you’re familiar with WordPress, you’ll be right at home. To get started creating your own posts head to your Dashboard and click Add New to bring up the editor. Fill it up with whatever you choose; it could be a recipe, a review of a new product you love, or simply a new idea that needs to be shared with the world. The world is your oyster.

Hit Publish and that’s it – your post will be live and ready for reading.

The new post will be included in the Reader of other members and may also make an appearance on the Community front page, (vivaldi.net).

P.S. Don’t forget to share your new creation far and wide! Tag Vivaldi (on Twitter or Facebook) and we’ll help you spread the word about your new blog.

Customization

There are a number of ways to customize the look of your new Blog. Head to you site’s Admin Dashboard to adjust the theme, site icon, header images, page layouts, custom widgets and much more. Many of these settings can be found in the Appearance menu.

For the more technically savvy out there, you can of course also use custom CSS to make things just right. To add custom CSS, head to Appearance > Customize.

Import

To import content from another blog, select Tools > Import from menu in your dashboard. Right now there are importers for WordPress, Blogger and Tumblr. If you’d like to import content from another service, let us know!

FAQ

What is the Vivaldi Community?

A place for our friends to hang out online. We want to create a place where people can publish, read and discuss ideas with likeminded folks from around the world. We hope you like it.

Do I have to use Vivaldi’s browser to be here?

No. Many Community members use our browser. But many don’t. Everyone is welcome.

What’s included?

Every member gets a free webmail account ([email protected]), access to the Vivaldi Forums and a free Blog with a custom domain (yourblog.vivaldi.net).

What’s the catch?

We have no plans to monetize, share your data or start charging for any of these services. The Community is simply a way for us to give back something to our users. No catch.

Help and Feedback

Help articles for the Community can be found at help.vivaldi.com. If something seems off or you run into a bug, please let us know by using our contact form or leaving a comment in the forum.

Have a read of our Terms of Use and Privacy Policy and let us know if you have any questions.

Enjoy, and welcome!