- 補完用シェルスクリプトを任意の場所に置く
/Users/mika/.git-completion.sh
- 起動時に読み込む
- スクリプトをコピーしてくる
| # このコードをcmd.exeで実行する | |
| cscript "%programfiles%\Microsoft Office\Office14\ospp.vbs" /dstatus | |
| # 出力される YYYYY に書いてある | |
| # Microsoft (R) Windows Script Host Version 5.8 | |
| # Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. | |
| # | |
| # ---Processing-------------------------- | |
| # --------------------------------------- | |
| # SKU ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
| # SSL更新で証明書と鍵のペアの正当性を確認 | |
| # | |
| # 証明書 | |
| openssl x509 -noout -modulus -in /path/to/crt.crt | openssl md5 | |
| # => XXXXYYYYZZZZ(32桁の文字列など) | |
| # | |
| # 鍵 | |
| openssl rsa -noout -modulus -in /path/to/key.key | openssl md5 | |
| # => XXXXYYYYZZZZ(32桁の文字列など) |
| find . -type f -mmin -86400 | |
| # 1日以内なら 24*60*60 で 86400を指定 |
| def up | |
| change_column :reports, :file_size, 'integer USING CAST(file_size AS integer)' | |
| end | |
| def down | |
| change_column :reports, :file_size, :string | |
| end |
| ## to install | |
| cd /usr/local/src/ | |
| wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs923/ghostscript-9.23.tar.gz | |
| tar -zxvf ghostscript-9.23.tar.gz | |
| cd ghostscript-9.23 | |
| ./configure --disable-compile-inits --with-x --with-drivers=ALL --without-luratech --with-libiconv=gnu --prefix=/usr/local | |
| make | |
| make install |
| # get whole page size from sample.pdf | |
| # 総ページ数を取得 | |
| $ gs -q -dNODISPLAY -c '(sample.pdf) (r) file runpdfbegin pdfpagecount = quit' | |
| # take perticular page from sample.pdf with sequential file name like printed_0001.pdf, printed_0002.pdf | |
| # 特定範囲のページを取り出す | |
| # 総ページ数でループすれば、分割にも応用可 | |
| $ gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dFirstPage=1 -dLastPage=1 -sOutputFile=printed_%04d.pdf sample.pdf |
開発環境は以下のような準備をしていただけるとスムーズかも。
docker未導入なので、モダンでなく、たいへん申し訳ございません 🙇
環境の作成でなにか詰まったり困ったら、当gistにコメントいただるといいかもしれません (が、勤務時間外だと返信が遅くなるかもしれません)
| version | install example | |
|---|---|---|
| ruby | ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-darwin17] | rbenv install -v 2.3.7 && rbenv rehash |
| postgres | 9.5.13 | brew install [email protected] && brew switch [email protected] 9.5.13 && postgres -D /usr/local/var/[email protected] |
| # companies テーブルの id を 2001 から始める | |
| $ psql -d database_name | |
| $ database_name=# SELECT setval(pg_get_serial_sequence('companies', 'id'), 2001); | |
| setval | |
| -------- | |
| 2001 | |
| (1 row) |
| # git-completion | |
| $ curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.sh | |
| $ chmod a+x ~/.git-completion.sh | |
| # git-prompt | |
| $ curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh | |
| $ chmod a+x ~/.git-prompt.sh | |
| $ vi ~/.bash_profile | |
| ``` |