# docker save image to tar file
docker save image:version -o imagename.tar
docker load < imagename.tar #create image:latest
# docker export container to tar file
# docker save image to tar file
docker save image:version -o imagename.tar
3Q4: https://step-learn.com/article/javascript/124-diff-match-exec.html
JavaScript では、正規表現にマッチした文字列を取得するメソッドとして、 match() メソッドと exec() メソッドがあります。
まず、「どのオブジェクトのメソッドか」という違いがあります。 match() メソッドは String オブジェクトのメソッドで、 exec() メソッドは RedExp オブジェクトのメソッドです。
ですから、書式はそれぞれ次のようになります。
// match()
文字列.match(正規表現)
// exec()
正規表現.exec(文字列)
// 文字列
var str = "cat map cut bat cute cap";
// 正規表現
var ex = /c.t/g;
var arr = str.match(ex);
for (var i = 0, len = arr.length; i < len; i++){
console.log(arr[i]);
}
// 実行結果
cat
cut
cut
// 文字列
var str = "〒 135-0064\n〒 105-7444";
// 正規表現
var ex = /(\d{3})-(\d{4})/g;
var arr = [];
while((arr = ex.exec(str)) != null){
console.log(arr);
console.log('マッチ文字列:', arr[0]);
console.log('lastIndex:', ex.lastIndex);
}
// 実行結果
Array [ "135-0064", "135", "0064" ]
マッチ文字列: 135-0064
lastIndex: 10
Array [ "105-7444", "105", "7444" ]
マッチ文字列: 105-7444
lastIndex: 21
set str=abcdefg
set key=abc
echo "%str%" | find "%key%" >NUL
if not ERRORLEVEL 1 goto OK_FOUND
:NOT_FOUND
echo "NOT FOUND %key% in %str%. "
pause
exit /b
:OK_FOUND
echo "GOOD! FOUND %key% in %str%. "
pause
REF:https://qiita.com/Targityen/items/3d2e0b5b0b7b04963750
現象:
実行ポリシー | 署名あり | 署名なし/ローカル | 署名なし/非ローカル | 説明 |
---|---|---|---|---|
Restricted | x | x | x | すべてのスクリプトの実行を制限 (初期設定) |
AllSigned | o | x | x | 署名のあるスクリプトのみ実行可能 |
RemoteSigned | o | o | x | ローカル上のスクリプトと非ローカル上の署名のあるスクリプトのみ実行可能 |
Unrestricted | o | o | △ | すべてのスクリプトが実行可能だが非ローカル上のスクリプトは実行時に許可が必要 |
Bypass | o | o | o | すべてのスクリプトが実行可能 |
1. alias lla='ls -la'
[root@ip-xxx ~]$ lla
git branch --set-upstream-to remotename/branchname
git branch -u remotename # same branch name
# delete upstream between remote andd local
git branch -d -r origin/<remote branch name>
======git history: ======
commit: comment1
commit: comment2
commit: comment3
commit: comment4
commit: comment5
commit: comment6
commit: comment7
commit: comment8
commit: comment9
commit: comment10
commit: comment11
目標:
comment1 ~comment5: commit => project1
comment6 ~comment10: commit => project2
方法:
git rebase -i HEAD~10
--edit commit: comment1
--edit commit: comment2
--edit commit: comment3
--edit commit: comment4
--edit commit: comment5
--edit commit: comment6
--edit commit: comment7
--edit commit: comment8
--edit commit: comment9
--edit commit: comment10
git commit --amend
commit: comment1 -> project1: comment1
git rebase --continue
git commit --amend
commit: comment2 -> project1: comment2
git rebase --continue
git commit --amend
...
git rebase --continue
git commit --amend
commit: comment10 -> project2: comment10
Successfully rebased and updated refs/heads/$branchname
=================
pick -そのまま保留
edit -コメント編集へ
squash - 前のcommitにマージする,コメント変更可
fixup - 前のcommitにマージする,コメントも前のコメントに従う
drop -該当commitを削除