ラベル 開発 の投稿を表示しています。 すべての投稿を表示
ラベル 開発 の投稿を表示しています。 すべての投稿を表示

2018/05/05

[aws] Elastic Beanstalk で DocumentRoot 配下に WinSCPでファイルを書き込めない

/var 配下に書き込み権がないたいため

# ec2-userでssh接続
sudo chmod -R 755 /var/www/html #フォルダのアクセス権限を変更
sudo chown -R ec2-user /var/www/html #一応オーナーも変更

# Elastic Beanstalk では
sudo chmod -R 755 /var/app/current
sudo chown -R ec2-user /var/app/current

CyberduckでEC2(Amazon Linux AMI)にファイルをアップロードできない
https://teratail.com/questions/22478

2018/05/04

[Apache] localhost で 400 Bad Request

ホスト名に_(アンダースコア)を使ったため。ハイフンに修正して解消

Xamppにおいて、Apacheのバーチャルホストの設定でBad Requestが出る
https://teratail.com/questions/80836

Apache ローカル環境 400 Bad Request になるとき
https://chaika.hatenablog.com/entry/2018/01/26/090000

2018/04/29

[Apache] 特定の URL を存在しないページ扱い(404)にする

.htaccess に Redirect 404 /path 設定

Redirect ディレクティブ
https://httpd.apache.org/docs/2.4/ja/mod/mod_alias.html#redirect

実際に path(対象ファイル or ディレクトリ)が存在する&削除可能であれば、削除 → 規定の 404 でよいが、
「当該 pathが存在するが削除できない/したくない」
場合は、mod_alias で、当該pathを明示的に 404 ステータスにリダイレクト

記述場所はどこでも(末尾でも)よい

2018/04/25

[Windows] Windowsのバッチファイル中で日付をファイル名に使用する

Windowsのバッチファイル中で日付をファイル名に使用する (1/2)
http://www.atmarkit.co.jp/ait/articles/0405/01/news002.html

date環境変数から日付の数字だけを抽出する
年月日 : %date:~0,4%%date:~5,2%%date:~8,2%

[Windows] robocopy、RichCopy によるフォルダのバックアップ/同期

CUI : 「robocopy」コマンドでフォルダをバックアップ/同期させる
http://www.atmarkit.co.jp/ait/articles/0704/20/news130.html

GUI : WindowsのRichCopyでフォルダをバックアップ/同期させる
http://www.atmarkit.co.jp/ait/articles/0904/17/news110.html

2018/04/24

[Python] 複数バージョンの扱い方(Windowsの場合)

https://gammasoft.jp/python/python-version-management/

・Pythonランチャー(py.exe)で複数バージョン切り替え可(Windows版のPython3.3からデフォルトでインストール)
・マイクロバージョンアップ → 上書き
・マイナーバージョンアップ → 別フォルダにインストール

2018/03/10

[Python] Git bash から Python インタプリタ起動

Git bash 上から Python インタプリタを起動する
https://qiita.com/cointoss1973/items/a0da81df10f8cc04c83e

alias を ~/.bashrc に追記
alias python='winpty python.exe'

[WSL] Ubuntu と python 導入

Ubuntu インストール

1. Windows Store から Ubuntu インストール
2. unix ユーザー名、パスワード設定
3. sudo apt-get update
4. sudo apt-get upgrade

初期インストールされているのは python3 のみ
$ which python3
/usr/bin/python3
$ python
The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>

python3 用 pip dev のみインストール
$ sudo apt install python3-pip python3-dev

$ which pip3
/usr/bin/pip3
$ pip3 --version
pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5)

venvインストール
$ sudo apt install python3-venv

そのままでは Python3.6のインストール失敗
$ sudo apt install python3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.6
E: Couldn't find any package by glob 'python3.6'
E: Couldn't find any package by regex 'python3.6'

当面、3.5 のまま運用

というか、当面 git bash から Windows 版の Python(3.6)の方を利用する方針

というか、当面 git CMD から Windows 版の Python(3.6)の方を利用する方針

[Ubuntu] インストールされている Ubuntu のバージョンを確認

WSL のターミナルで確認
$ cat /etc/os-release

NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

uname は
$ uname -a
Linux [machinename] 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

2018/03/06

[Visual Studio Code] タブキーで挿入される空白文字数を言語ごとに切り替える

Visual Studio Codeで言語ごとにインデントの設定をしたい
https://ja.stackoverflow.com/questions/34014/visual-studio-code%E3%81%A7%E8%A8%80%E8%AA%9E%E3%81%94%E3%81%A8%E3%81%AB%E3%82%A4%E3%83%B3%E3%83%87%E3%83%B3%E3%83%88%E3%81%AE%E8%A8%AD%E5%AE%9A%E3%82%92%E3%81%97%E3%81%9F%E3%81%84


Ctrl+Shift+Pで開くコマンドパレットにPreferences: Configure language specific settingsを入力/選択してユーザー用設定を開く。
編集対象の言語を入力/選択する。
{
    "[javascript]": {
        "editor.tabSize": 2
    },
    "[html]": {
        "editor.tabSize": 2,
    },
    "[css]": {
        "editor.tabSize": 2
    }
}
--

HTML, JavaScript, CSS は2タブ(2スペース)、その他は4タブ(4スペース)

2018/03/05

自動ページリローディングツール

LiveReload、LivePage ではなく、BrowserSync を npm から導入。

cd [websitebasedir]
browser-sync start --server --files *

で起動