2017年6月30日金曜日

ImageMagick コマンドまとめ

ImageMagick コマンドリファレンス | 画像変換ソフトの定番、ImageMagickのコマンドをサンプル付きで解説しています。
http://image-magick.com/

2017年6月26日月曜日

参考: WordPressから静的HTML生成

サーバーレスアーキテクチャのパターン別ユースケース - yoshidashingo
http://yoshidashingo.hatenablog.com/entry/serverlss-usecases-2017

CMSのコンテンツ管理と配信を分離する ex. Serverless CMS

<script async class="speakerdeck-embed" data-slide="22" data-id="ff75a08fb26f448aae0a88ab1b4ff7d3" data-ratio="1.77777777777778" src="//speakerdeck.com/assets/embed.js"></script>


オンプレからAWS環境にデータベース移行するのに役立つ情報まとめ | Developers.IO

JavaScriptのメモリリーク等々

Improve SPA Performance with Angular App // Speaker Deck
https://speakerdeck.com/manakuro/improve-spa-performance-with-angular-app

PythonでWebスクレイピングする時の知見をまとめておく - Stimulator

2017年6月24日土曜日

Ubuntu 16.04 サービス自動起動の設定

サービス自動起動の設定 sysv-rc-conf のインストール sysv-rc-conf は chkconfig の代わりとなるもの $ sudo apt-get install sysv-rc-conf sysv-rc-conf で ntp サービス自動起動の設定 $ sudo sysv-rc-conf ntp on 確認 $ sudo sysv-rc-conf --list ntp ntp 1:off 2:on 3:on 4:on 5:on OS の再起動 $ sudo reboot

2017年6月23日金曜日

Linux ディレクトリ内のすべてのグループを変更するには

chgrp ファイルやディレクトリのグループを変更するコマンド


FLODERディレクトリ内のすべて(ファイルとディレクトリ)を、wheelグループにする
$ chgrp -R wheel FOLDER


FILEファイルのグループをwheelグループにする
$ chgrp wheel FILE

2017年6月22日木曜日

Ubuntu 16.04: SambaでLinuxとWindows間のファイル共有

Ubuntu 16.04: sambaをインストールしてWindows 10とファイル共有する - Narrow Escape

以上を参考にしてできましたが、少しつまずいたので補足です。


1.sambaのインストール
$ sudo apt-get install -y samba

2.pdbeditでsambaへアクセスできるユーザを追加します。
$ sudo pdbedit -a EXAMPLEUSER
new password:
retype new password:

※注意:すでに存在してるユーザー名EXAMPLEUSERを指定します。

3. /etc/samba/smb.confの設定

設定1.ホームディレクトリ共有
以下の設定では、pdbeditで作成したユーザのホームディレクトリにアクセスできるようになります。

/etc/samba/smb.conf 内で以下部分のコメントを外す

;[homes]
;   comment = Home Directories
;   browseable = no
 ↓
[homes]
   comment = Home Directories
   browseable = no

そして

 # By default, the home directories are exported read-only. Change the
 # next parameter to 'no' if you want to be able to write to them.
;   read only = yes
 ↓
   read only = no

そして

 # This might need tweaking when using external authentication schemes
;   valid users = %S
 ↓
   valid users = %S


あるいは、次の設定もできます。

設定2: 全ユーザ共有ディレクトリ
以下の設定では、pdbeditで追加したユーザでディレクトリを共有できます。
以下の設定では、shareという名前のディレクトリが共有されるようになる。ユーザー名とパスワードが要求される。

/etc/samba/smb.conf 内

 #======================= Share Definitions =======================

[share] 
   comment = Share directory
   path = /var/lib/share  #特定のディレクトリを指定します
   read only = no
   guest only = no
   guest ok = no
   share modes = yes

 # Un-comment the following (and tweak the other settings below to
 # suit)
 # to enable the default home directory shares. This will share each
 # user's home directory as \\server\username


4.設定完了後、systemctlでsmbdとnmbdを再起動します。
$ sudo systemctl restart smbd nmbd

5.共有ディレクトリのアクセス権は0777にします。
$ sudo mkdir /var/lib/share
$ sudo chmod 0777 /var/lib/share


2017年6月20日火曜日

2017年6月17日土曜日

写真ファイルの撮影日時を変更したいとき

ツールのダウンロード
ExifTool by Phil Harvey


使い方
写真ファイルの撮影日時を変更する – sgryjp.log
http://sgry.jp/blog/2017/01/01/4002/

コマンドの使い方:

$ exiftool -alldates[+-]=DATETIME FILENAME [FILENAME..]  

例:

$ exiftool -alldates="2016-12-31 11:34:04" *.jpg  # 特定の日時に変更  $ exiftool -alldates+=1                    *.jpg  # 1時間だけ進める  $ exiftool -alldates-=1:2:3                *.jpg  # 1時間2分3秒だけ昔に戻す  $ exiftool -alldates+="1:2:3 4:5:6"        *.jpg  # 1年2ヶ月3日と4時間5分6秒だけ進める

2017年6月16日金曜日

ownCloud | Gateway Time-out が出るときの対処方法

おおよそ以下の方法で。

phpMyAdmin で 504 Gateway Time-out が出たときの対処法 | 株式会社ビヨンド
http://beyondjapan.com/blog/2016/03/phpmyadmin-504-gateway-time-out


AWSのELBを使用しているときは以下にも注意。

504 Gateway Time-out が出た際は Elastic Load Balancing の設定にも注意しよう - Qiita

WordPressを静的サイトにする StaticPressとS3

StaticPressとS3で爆速で激安な静的サイトを作ろう
http://webfood.info/staticpress-s3/#basic

PDFを見た目そのままにHTML化する pdf2htmlEX

PDFをほとんどそのままHTML化できる pdf2htmlEX というものがありました。

Convert PDF to HTML without losing text or format.
*ただし、更新はストップしているようです。

例としてMTI Press Book の Deep Learning をみるととても美しく変換されています。 
http://www.deeplearningbook.org/

2017年6月6日火曜日

WordPressのブログをAWS S3で公開する

WordPressのブログをAWS S3で公開する
http://eikatou.net/blog/3247.html

ownCloud 時間の設定

ownCloud から送られてくる、アクティビティ通知の時間帯が違っているようだったので、以下のように変更しました。

/owncloud/config/config.php 内

変更前 'logtimezone' => 'UTC', 

変更後 'logtimezone' => 'Asia/Tokyo',

バージョン ownCloud 9.1.4.2

※すみません、これではアクティビティのメール通知時間は、直っていませんでした。
こちらを参照ください。
→ownCloud アクティビティのメール通知時間がずれる件
http://webtipsplus.blogspot.jp/2017/11/owncloud.html

AWS CloudFrontでルート以外のディレクトリにもデフォルトオブジェクト(index.html)を設定する

CloudFront に S3 bucket のサブディレクトリパスのコンテンツを参照させる - Qiita
http://qiita.com/naoiwata/items/3c6626cbeacbb44d4aa8



解決策
CloudFront のオリジンを設定する際に S3 bucket の URL ではなく Static Website Hosting の URL を指定することでサブディレクトリパスの index.html を参照させる.