忍んでいる肉球の足跡

プログラムに関連することを雑多に扱います

噂のwlinuxでidea動かしてscalaでhelloworldする。

window側で必要な要素です

計 ¥1,580

wlinux後の初期設定とかいろいろ

※ Hyperを利用してwlinux.exeを叩くと失敗するので注意です。
(少なくとも初期設定のWindow\bash.exeから叩いたらGUIの立ち上がりに失敗しました)

  1. X410を起動します。
  2. wlinuxを起動します。
  3. user, passwordを設定します。

    • ※WSLと同じ仕様なら再変更が非常に面倒くさいので、一発で決めてください。
  4. user, passwordの設定以降は次のように行いました

cd $HOME

# 誤入力・Tab補完時にうるさいベル音の削除(重要)
sudo sed -i "s/# set bell-style none/set bell-style none/" /etc/inputrc

# aptでinstallするものとか(結構時間がかかります)
sudo apt install openjdk-8-jdk gedit bash-completion -y

# git flow avhのインストール
wget --no-check-certificate -q https://raw.githubusercontent.com/petervanderdoes/gitflow-avh/develop/contrib/gitflow-installer.sh && sudo bash gitflow-installer.sh install stable; rm gitflow-installer.sh

# completion(tab補完の調整)
wget https://raw.githubusercontent.com/bobthecow/git-flow-completion/master/git-flow-completion.bash -O $HOME/.git-flow-completion.bash
cat >>$HOME/.bashrc <<EOF
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
EOF
cat >>$HOME/.bashrc <<EOF
if [ -f $HOME/.git-flow-completion.bash ]; then
. $HOME/.git-flow-completion.bash
fi
EOF

#git config
git config user.name "xxxxx"
git config user.email  "xxxxx@example.com"

#github系の調整
mkdir -p $HOME/.ssh/github/
ssh-keygen -t rsa -b 4096 -C "xxxxx@example.com" # ${HOME}/.ssh/github/id_rsa を絶対パスで指定
cat >>$HOME/.ssh/config <<EOF
Host github.com
HostName github.com
IdentityFile ~/.ssh/github/id_rsa
User git
EOF
chmod 600 $HOME/.ssh/github/id_rsa
chmod 600 $HOME/.ssh/config
gedit $HOME/.ssh/github/id_rsa # pbcopy無いのでコピペ
# githubのアカウントにsshkeyを追加する部分は省略

# giboのインストールも省略

ideaの設定編

お好みのjetbrainsのLinux版を拾ってきて展開してideaを起動する。

tar zxvf ideaIU-2018.2.4.tar.gz
./idea-IU-182.4505.22/bin/idea.sh

!動く! f:id:nukisashineko:20180927030954p:plain

右下からpluginの設定を行って再起動

とりあえず、scalaとsbt。 f:id:nukisashineko:20180927031037p:plain f:id:nukisashineko:20180927031035p:plain

create projectして、hello-worldを書く、テストも書く!

ウェーィ

LinuxのWindow」にコピペできるの素敵

spec2を利用したいので、build.sbtに追記
windowschrome→wlinuxのx401のideaへコピペ

  • コピペができる!!!

f:id:nukisashineko:20180927032539p:plain
f:id:nukisashineko:20180927032551p:plain

WindowsLinuxを行き来するプログラムは大概コピペが最初できなくてつらみがあるので、これはうれしい。 なんて言っても、試しのコーディングの際にササッとコピペできるのがいい。

sbt shell, test run, debugが一通り動くことを確認

f:id:nukisashineko:20180927033021p:plain f:id:nukisashineko:20180927033011p:plain f:id:nukisashineko:20180927033012p:plain f:id:nukisashineko:20180927033015p:plain

githubで適当にリポジトリを作ってPush

省略。

動作中のメモリとか

16GBの約10%で1.6GBほどの消費。
プロジェクト作成時にscala本体のsource codeも持ってきたのでそれのせいで重くなってしまった感。

before:

f:id:nukisashineko:20180927033228p:plain

after:

f:id:nukisashineko:20180927033235p:plain

感想・総評

昔のWindowsでは考えられないくらいに開発環境(パッケージ管理・UNIXコマンド・パイプ処理・UX)してる。
desktopで動かしたので、オーバーヘッドによる速度の低下も(aptからの展開時を除けば)余り気にならなかった。
人権のないノートブックからでもコマンドライン操作はほぼ気にならないと思う。
WebServer立ててないので、IP周り(というかファイヤーウォール周り)がどうなってるのかがわからないのでまだ様子見ではある。
1.5kなら電子小物代にもならないので、少しでも気になる人は買っておくと吉かもしれない。
後々7kで口に指をくわえることになるくらいなら、今買ったほうが絶対得。
(↑7k高すぎてlinux入れとけばいいやってなりがち)
chrome bookのOP1も気になってたけど、こんだけWindowsで動くなら割とどっちでもいい気がしてきた。

その他

今回作ったリポジトリ

GitHub - nukisashineko/scala_hello_world_from_wlinux

参考