2019年3月5日火曜日

Hubotの設定

概要

仕事のSlackのワークスペースを作成したので、そこにbotを使って作業効率を上げようと考えた。実際のところ、チャネルごとに発言をしてハッシュタグのようなゆるい分類を入れる仕組みが作りたい。以下のサイトのようなもの。

Slackにハッシュタグ的な「ゆるく情報をまとめる方法」が欲しかった話 - コネヒト開発者ブログ

そのためには、hubotをHerokuにデプロイして、CoffeeScript(かJS)でbotを記述しないといけないようだ。色々調べながらチャレンジ。


Hubotのドキュメント(英文)



Windows 10のネイティブでビルドしたためnode.jsやgitはChocolatelyパッケージマネージャを使った。
そのため、HubotのAPIキーを環境変数にセットする際に、管理者権限を持つPowerShellでセットする必要が出た。長いコマンドで面倒^^;

[System.Environment]::SetEnvironmentVariable("HUBOT_SLACK_TOKEN","HubotのAPIキー")


このWindowsでの環境変数のセットについては以下のサイトに説明がある。
WSLをインストールしてbashで操作したほうがよっぽど楽だ。

以下、slackのアダプタ実行(ローカルテスト)とherokuのアプリとの連携(?)
.\bin\hubot --adapter slack
heroku git:remote -a hubotuse2

ビルドの際にnode.jsとnpmのバージョンをローカルPCのものに統一する
  "engines": {
    "node": "11.10.1",
    "npm": "6.7.0"
  }

git add .\package.json

以下、botのスクリプトをVSCodeで編集&保存した後にデプロイする流れ。
git add .\scripts\hubotuse2.coffee
git commit -m 'コミットの際のメッセージ'
git push heroku master


botスクリプトはCoffeeScriptで書くのが普通らしいので、文法などを調べた
Gitのコマンドも忘れがちなのでこちらなどを見た。


2017年1月4日水曜日

Yun- root password?

Arduino Yunを久しぶりに使おうと設定しようとするもパスワード(デフォルト:arduino)を受け付けない。何年か前に変更してしまったか。



YunのWifi側のLinuxのパスワードをリセット。

Yun- root password?:

(検索キーワードは"YunSerialTerminal root reset password"で)

パスワードがデフォルトに戻った。sshでもデフォルトのパスワードでログインできた。

よかったよかった。

$ ssh root@192.168.240.1The authenticity of host '192.168.240.1 (192.168.240.1)' can't be established.RSA key fingerprint is 25:b7:86:c0:b4:be:a5:cc:ed:28:2c:0b:1c:4e:7a:c8.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.240.1' (RSA) to the list of known hosts.root@192.168.240.1's password: 

BusyBox v1.19.4 (2014-04-10 11:08:41 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------

root@Arduino:~# 



'via Blog this'

2015年3月7日土曜日

Google+

 rails new first_appで以下のメッセージ

        run  bundle install

DL is deprecated, please use Fiddle

Fetching gem metadata from https://rubygems.org/..........

Resolving dependencies...



Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read

server certificate B: certificate verify failed (https://rubygems.org/gems/rake-

10.4.2.gem)

An error occurred while installing rake (10.4.2), and Bundler cannot continue.

Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.

http://blog.livedoor.jp/tknemuru/archives/42511171.html のサイトで解決できた!
「Windowsでbundle install を実行したら、Gem::RemoteFetcher::FetchError: SSL_connect のエラーが発生」





'via Blog this'