Skip to content

Instantly share code, notes, and snippets.

View kentarosasaki's full-sized avatar

Kentaro Sasaki kentarosasaki

View GitHub Profile
@kentarosasaki
kentarosasaki / .rpmmacros
Last active September 19, 2018 03:18
Proxy 環境下で rpm コマンドを使う際の設定ファイルの書き方 ref: https://qiita.com/kentarosasaki/items/84bd59c0314dd263a80e
%_httpport 12345
%_httpproxy http://your.proxy.url
@kentarosasaki
kentarosasaki / file0.txt
Created June 11, 2018 00:40
(macOS限定) CLIの出力結果をクリップボードにコピーする ref: https://qiita.com/kentarosasaki/items/22ecf583774561ac239d
$ echo "aaa"
aaa
$ echo "aaa" | pbcopy
$
@kentarosasaki
kentarosasaki / file0.txt
Created April 4, 2018 01:24
Yum で特定のバージョンを指定してソフトウェアをインストールする方法 ref: https://qiita.com/kentarosasaki/items/c3a007b78f46a0f7a267
$ sudo yum --showduplicates search docker-ce
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* epel: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
========================================================== N/S matched: docker-ce ===========================================================
docker-ce-17.03.0.ce-1.el7.centos.x86_64 : The open-source application container engine
docker-ce-17.03.1.ce-1.el7.centos.x86_64 : The open-source application container engine
@kentarosasaki
kentarosasaki / file1.txt
Created March 27, 2018 01:56
tmux で ssh した時に新規ウィンドウで起動してウィンドウをホスト名に変更する方法 ref: https://qiita.com/kentarosasaki/items/44611f1a10594de2fa1f
$ chmod +x s.sh
@kentarosasaki
kentarosasaki / file0.txt
Created October 23, 2017 07:55
pyenv を使って CentOS 5 に Python 3 をインストールする方法 ref: http://qiita.com/kentarosasaki/items/d7c492a38329f1b0f948
$ sudo yum -y install gcc make readline readline-devel zlib zlib-devel bzip2 bzip2-devel sqlite sqlite-devel openssl openssl-devel git
@kentarosasaki
kentarosasaki / file0.txt
Last active October 18, 2017 04:54
PythonワンライナーでJSONの要素を出力する ref: http://qiita.com/kentarosasaki/items/e84d6b7f273472674531
{
"title": "Person",
"type": "object",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
}
defaults delete com.googlecode.iterm2
@kentarosasaki
kentarosasaki / file0.txt
Created September 7, 2017 08:43
Bash で月初と月末を表示する方法 ref: http://qiita.com/kentarosasaki/items/afa19808758737d3ce17
# 今月初め
$ echo $(date +"%Y%m%d" -d"`date +"%Y%m01"`")
20170901
# 先月初め
$ echo $(date +"%Y%m%d" -d"`date +"%Y%m01"` 1 month ago")
20170801
# 来月初め
$ echo $(date +"%Y%m%d" -d"`date +"%Y%m01"` + 1 month")
@kentarosasaki
kentarosasaki / file0.txt
Last active October 1, 2017 12:37
HomebrewをHomeディレクトリにインストールする ref: http://qiita.com/kentarosasaki/items/4dd493b95cd4caaaf167
cd ~/
mkdir homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
@kentarosasaki
kentarosasaki / file0.txt
Last active August 17, 2017 06:39
ディレクトリ階層の役割を調べる最短ルート ref: http://qiita.com/kentarosasaki/items/7cddf11aac46f20ee61b
$ man hier