git fetch

pull = fetch + merge origin/master

What is “git fetch”?
For git, there are two repositories: remote and local. Fetch is a command that brings the latest information from the remote repository to the local repository. Fetching does not mean that the file is updated like pull. Only the local repository is updated.

[vagrant@localhost test]$ git –version
git version 1.7.1
[vagrant@localhost test]$ git clone https://github.com/githubix/test.git
Initialized empty Git repository in /home/vagrant/local/app/test/test/test/.git/
remote: Enumerating objects: 45, done.
remote: Total 45 (delta 0), reused 0 (delta 0), pack-reused 45
Unpacking objects: 100% (45/45), done.
[vagrant@localhost test]$ ls
test

[vagrant@localhost test]$ git log origin/master
commit e4c42320159a32a377eb60249f9d5277f809c1bd
Author: githubix <@hotmail.com>
Date: Mon Jul 1 23:16:01 2019 +0900

Update test.php

commit 180cf3fcce48d905ede71a57ed0bd3973e1f90c8
Author: githubix <@hotmail.com>
Date: Mon Jan 28 08:45:42 2019 +0900

Update test.php

commit 812d49e3beb82bafe3699787ade3de5bf5d2f48f
Author: githubix <@hotmail.com>
Date: Fri Jan 25 09:09:15 2019 +0900

Update test.php

commit 5b3c59d4795b3a73e8723b35ffa58b2a6c262974

[vagrant@localhost test]$ git fetch –all
Fetching origin

なんか理解が足りんな。。

curl command

What is curl command?
-> A command to transfer data from or to a server.

It supports many protocols such as FTP, SFTP, LDAP, TELNET.
The most basic usage is to use HTTP request and standard output.

curl [options] [url]

# Make an HTTP request and put the result on the standard output
$ curl http://target URL

# You can also specify the range using commas and []
$ curl 'http://{one, two, three}.example.com'
$ curl 'http://[1-3].example.com'

# Output execution result to file
$ curl http://Target URL > Output Destination
$ curl -o output destination PATH http://target URL

# Hide progress on file output(error is also hidden)
$curl -s -o output destionation Path http://target URL

# if you want to display the error above
$curl -sS -o output destination PATH http://target URL

# Display progress rate in progress bar
$curl -# -O http://Target URL

# Skip certificate error on SSL connection
$ curl -k https://target URL

# Download with URL filename(The following is saved as index.html)
$ curl -O http://target URL /index.html

# Access via proxy
$ curl -x proxy server: port number --proxy-user username:password http://target URL

# Enable redirection
$ curl -L http://Target URL

# When you resume the download again when you interrupt the download
$ curl -C -http://target URL

# Specification of HTTP method (-X)
$ curl -X PUT http://Target URL

curl -sS -Hは、エラー標示かつhttpヘッダにheader追加?

[vagrant@localhost ~]$ curl --version
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

[vagrant@localhost ~]$ curl -s -w '%{http_code}\n' http://www.amazon.co.jp/dp/B00JEYPPOE/ -o /dev/null
301
[vagrant@localhost ~]$ curl -s -w '%{http_code}\n' http://www.amazon.co.jp/dp/B00JEYPPOE/ -o /dev/null -A ''
301

ん?

書評: カリスマ上下(オラクル ラリーエリソン)

オラクルの本を勧められて、ラリーエリソンのカリスマ上下巻を読了。上巻282ページ、下巻582ページ。
分量が多かったので、気分転換に甲府に行って、その車中で読んだ。

リレーショナルデータベースをIBMからぱくって、RDBの創成期から強力な営業力で推進した経緯が記載されている。
特筆すべきは、oracleを作る前に、幾つかの会社でプログラマーとして働いていたことだ。
本書ではセールスやエリソンのプライベートに関する記述が多いが、彼はプログラマーである。
だから、経営においても、エンジニアを大事にしていることが随所にわかる。
また、優秀な人材を採用し続けた、という点では、Googleに似ている。
彼が作った会社の最初の顧客がCIAというのは驚きである。スケールが違う。
また、アプリケーションの下請けではなく、パッケージソフトの販売という点でもプログラマーっぽい視点だ。
それがRDBだからこんなにシェアを取れたのだろう。
これから伸びそうなところに集中投資、というのは真似したい。

nesting query

You can combine multiple queries to control the output of other queries with th output generated by one query. To put it a bit plainly, nesting queries so that the inner query generates a value that the outer query’s predicate evaluates to determine if it is true.

SELET 受注番号 FROM 受注表
 WHERE 商品コード = 
    (SELECT 商品コード FROM 商品表
    WHERE 商品名 = 'JUIICE');

入れ子になっていますね。

書評:ザッポスの奇跡

ザッポス伝説に続き、ザッポスの奇跡を読みました。

ザッポス伝説はトニーシェイ自身が書いているのに比べ、こちらは石塚さんというジャーナリストがインタビューしたのをまとめているため、歯切れが薄く、記事っぽい本の為、あまり面白くはありません。

ああ、最近本ばっかり読んでるなー
あと2冊読まないといけない。。

ブラウザキック

>プログラムで処理中に別のプログラムを起動することを「キックする」という

ん?つまり、ブラウザを起動するという理解でOK?
ブラウザアプリを起動するときに使われているだが、あってる?

sar -P all? (system admin reporter)

[vagrant@localhost ~]$ sar -q
-bash: sar: コマンドが見つかりません

あれ?インストールされてない?
インストールします。
[vagrant@localhost ~]$ sudo yum install -y sysstat
[vagrant@localhost ~]$ sudo vi /etc/cron.d/sysstat
# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
え、デフォルトでOK?

[vagrant@localhost ~]$ sudo service sysstat start
Calling the system activity data collector (sadc)…

[vagrant@localhost ~]$ sar
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時42分13秒 LINUX RESTART
[vagrant@localhost ~]$ sar -q
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時42分13秒 LINUX RESTART
おお、なんか来た。

[vagrant@localhost ~]$ sar -P ALL
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時42分13秒 LINUX RESTART
[vagrant@localhost ~]$ sar 1 1 -u -P ALL
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時43分53秒 CPU %user %nice %system %iowait %steal %idle
23時43分54秒 all 0.00 0.00 0.00 0.00 0.00 100.00
23時43分54秒 0 0.00 0.00 0.00 0.00 0.00 100.00

平均値: CPU %user %nice %system %iowait %steal %idle
平均値: all 0.00 0.00 0.00 0.00 0.00 100.00
平均値: 0 0.00 0.00 0.00 0.00 0.00 100.00

お、なんかCPU使用率が見えるっぽいですな。
[vagrant@localhost ~]$ sar 1 1 -q
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時44分46秒 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
23時44分47秒 0 227 0.04 0.16 0.09
平均値: 0 227 0.04 0.16 0.09

[vagrant@localhost ~]$ sar 1 1 -q
Linux 2.6.32-754.14.2.el6.x86_64 (localhost.localdomain) 2019年06月25日 _x86_64_ (1 CPU)

23時45分04秒 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15
23時45分05秒 0 227 0.03 0.15 0.09
平均値: 0 227 0.03 0.15 0.09
すご。

vmstat

“vmstat” is a command to display statistics of virtual memory, CPU, and disk I/O.

By default, the average value from startup(result) is displayed. You can display the value in real time by specifying the update interval like “vmstat 1”.

[vagrant@localhost ~]$ vmstat
procs ———–memory———- —swap– —–io—- –system– —–cpu—–
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 1 584880 46328 36088 82136 20 21 94 28 46 97 0 0 97 3 0

procs -> process
 r -> 実行中と実行待ち中のプロセス数
 b -> 割り込み不可能なスリープ状態にあるプロセス数
memory -> memory
 swpd -> 仕様中の仮想メモリの量
 free -> 空きメモリの量
 buff -> バッファとして使用しているメモリの量
 cache -> キャッシュに使用している量
swap -> swap
 si -> ディスクからスワップインしているメモリの量
 so -> スワップアウトしている量
io -> input out
 bi -> HDDのようなブロック型デバイスから受けっとたブロック数
 bo -> ブロック型デバイスに送ったブロック数
system -> system
 in -> 1秒あたりの割り込み回数
 cs -> コンテクストスイッチの回数
CPU -> CPU
 us -> カーネルコード以外の実行に使用した時間
 sy -> カーネルコードの実行に使用した時間(システム時間)
 id -> 空転していたアイドル時間
 wa -> I/O待ち時間
 st -> 仮想マシンから盗まれた時間

メモリの単位ってなんだ?kバイト?

mailgun

Transactional Email API Service for Developersと書いてある。
APIベースのメール配信サービスとのこと。
Mailgunでは、毎月10,000通までのメール送信が無料で使えるとのこと。
Google Cloud PlatformのCompute Engineのサードパーティメールサービスとしても提供。

DNSを設定して、Laravelに導入するのね。
うむ、これはテストしないとあかんやつやね。