haiju's 開発メモ

開発に必要な情報を自分用にメモ

Manjaro Fluxbox 15.12_x86-64でVisual Studio Codeを起動する

まだF#のIonide環境構築で盛り上がってる時には、Visual Studio Codeを

よく使っていた記憶があるのだが、最近、全く触ってないのでターミナル

から起動する方法もすっかり忘れたwww(ΦωΦ;)

苦手なフロントエンドを勉強するにあたって、Atom Editorを使うみたい

だけど、そこはVisual Studio Codeでもよくね?

ってことで自分用に備忘録としてメモφ(ΦωΦ)

これを機会にまた使い始めたいし、Ionideのアップデート状況を確認して

他の言語でも使ってみようと思う。

[起動方法]

1. ターミナルで、codeと入力すると起動する。

% code

[参考サイト]

Visual Studio Code - ArchWiki

www.youtube.com

aur.archlinux.org

code.visualstudio.com

qiita.com

リモートから特定のブランチを指定してcloneするには

リモートのdevelopブランチを直接一発でcloneしたい時

って、どうやるのかな?

と思ったので調べて自分用に備忘録をメモφ(ΦωΦ)

[手順]

1. リモートのdevelopブランチを指定してcloneする。

% git clone -b develop https(ssh)://repository_address

※基本形

% git clone -b branch_name https(ssh)://repository_address

2. developブランチの内容が取得できているか確認できればok。

[参考サイト]

qiita.com


CentOS 6.5でapache実行ユーザをrootから切替えられるようにする。

以前書いた記事に関連して、CentOS6.5のテストサーバ

にもCakePHP2.9.5を使用したテスト環境を構築する際に

アプリディレクトリ以下のtmpディレクトリにアクセスする

apacheユーザを使えるようにする自分用の備忘録。

[手順]

1. rootでログインした状態でユーザ切り替えを行うと怒られる。

# su - apache

This account is currently not available.

2. ログインできないユーザ(apache)をログインできるようにする。

# usermod -s /bin/bash apache

3. 2の実行結果を確認する。

# cat /etc/passwd | grep apache

apache:x:48:48:Apache:/var/www:/bin/bash

4. 実際に、apacheに切替えられるか確認する。

# su - apache

-bash-4.1$

apache用にbashが起動すればok

[参考サイト]

ログインできないユーザの作成とログインできるように変更するコマンドの使用方法 | レンタルサーバー・自宅サーバー設定・構築のヒント

kimagureneet.hatenablog.com

kazmax.zpp.jp

CentOSでユーザ管理・グループ管理するコマンド | レンタルサーバー・自宅サーバー設定・構築のヒント

CentOS7.xでインストール済みのパッケージを確認する

使うコマンドはyumなので、特にOSのバージョンは

変わらないと思うφ(ΦωΦ)

いろんなディストリビューションを使っていたら

パッケージ管理マネージャの使い方がごちゃごちゃに

なるので改めて。

[手順]

1. インストールしたパッケージを一通り確認したい場合

# yum list installed

2. httpdなど、特定のパッケージを確認したい場合

# yum list installed | grep httpd

※基本形は以下

# yum list installed | grep packege_name

[参考サイト]

genchan.net

yumコマンドで既にインストールしたソフトを調べる

uxmilk.jp

Crystal のバージョンを上げてみる

使おうと思いながらやれてなかったので、バージョンアップの仕方を忘れる

頭のためにメモφ(ΦωΦ)

今回は、現行の0.20.0から最新の1つ手前の0.23.0にしてみる。

[手順]

1. 現在のバージョンを確認。

% crystal --version]
Crystal 0.20.0 [b0cc6f7] (2016-11-22) 

2. crenvでインストール可能なバージョンを確認。

% crenv install -l
Available versions:
0.5.0
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.5.8
0.5.9
0.5.10
0.6.0
0.6.1
0.7.0
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.7.7
0.8.0
0.9.0
0.9.1
0.10.0
0.10.1
0.10.2
0.11.0
0.11.1
0.12.0
0.13.0
0.14.0
0.14.1
0.14.2
0.15.0
0.16.0
0.17.0
0.17.1
0.17.2
0.17.3
0.17.4
0.18.0
0.18.2
0.18.4
0.18.6
0.18.7
0.19.0
0.19.1
0.19.2
0.19.3
0.19.4
0.20.0
0.20.1
0.20.3
0.20.4
0.20.5
0.21.0
0.21.1
0.22.0
0.23.0
0.23.1

3. 0.23.0をインストール。

% crenv install 0.23.0
Resolving Crystal download URL by Remote Cache ... ok
Downloading Crystal binary tarball ...
https://github.com/crystal-lang/crystal/releases/download/0.23.0/crystal-0.23.0-1-linux-x86_64.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 625 0 625 0 0 1093 0 --:--:-- --:--:-- --:--:-- 1092
100 17.8M 100 17.8M 0 0 2287k 0 0:00:07 0:00:07 --:--:-- 3586k
ok
Moving the Crystal directory ...ok
Checking if Shards already exists ... ng
Resolving Shards download URL ... ok
Downloading Shards tarball ...
https://github.com/crystal-lang/shards/archive/v0.7.1.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 127 0 127 0 0 217 0 --:--:-- --:--:-- --:--:-- 217
100 29722 100 29722 0 0 7738 0 0:00:03 0:00:03 --:--:-- 10819
ok
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/\G { <-- HERE (.*?) } (?^x:\}\})/ at /home/username/.anyenv/envs/crenv/plugins/crystal-build/bin/../vendor/lib/Text/Caml.pm line 78, <DATA> line 1.
Building Shards ... ok
Copying Shards binary ... ok
Install successful

4. インストールされたバージョンを確認。

% crenv versions
* 0.20.0 (set by /home/username/.anyenv/envs/crenv/version)
0.23.0

5. 0.23.0を使うので有効になるように設定。

% crenv global 0.23.0

※もし、ローカル環境のみに適応したい場合は、global の代わりに

 local と入力して実行。

6. バージョンが0.23.0になったことを確認。

% crystal -v
Crystal 0.23.0 [3c3d3e2] (2017-06-28) LLVM 3.8.1 

 

リモートのリポジトリにdevelopブランチを作成(gitおさらい)

暫くgitで作業してなくてリモートのdevelopブランチ

にローカルからmergeしようとして、masterブランチ

しかねーじゃんって時のおさらい。

他の興味に集中してると咄嗟に思い出せないので

自分用のメモ。

[手順]

1. ローカルのmasterブランチからdevelopブランチ作成

$ git checkout -b develop

2. 必要なファイルをcommitしてリモートにpush

$ git push origin develop

※これと同じ方法でfeatureブランチも適宜。

※不要になったブランチを削除する場合は以下。

 (ex) ローカルのfeatureブランチを削除する

$ git checkout develop

$ git branch -d feature-xxx

[参考サイト]

Gitのリポジトリを新規に作成する手順

sessan.hatenablog.com

ファイルのrequireでつまづいた件についてリベンジ用メモ

去年のAdvent Calendarではギリギリでファイルのrequire

のところがよく分からずに頓挫したけど、PHPと比べると

Ruby syntaxは目に優しいのが気に入ってる理由の一つ

なのでリベンジ用にメモ。

しかし公式ドキュメントに書いてあるということは大きな

見落とし過ぎるな・・・

[参考サイト]

blog.kaneshin.co

ファイルの require | プログラミング言語 Crystal

github.com

github.com