2022年9月12日星期一

linux grep output group capture

grep can't output all group captures after one grep action.

so. each grep a time. 

ex.

input_string= "Caused by: java.io.FileNotFoundException: /tmp/storage/imart/public/storage/default/im_workflow/data/default/transaction/202107/21/16/ma_8g2mm9ovekgierj/result/ep_8g2mo7z76kgrmrj/flow.xml (No such file or directory)"

#I want to get
#[1]=/tmp/storage/imart/public/storage/default/im_workflow/data/default/transaction
#[2]=202107/21/16/
#[3]=ma_8g2mm9ovekgierj
#[4]=ep_8g2mo7z76kgrmrj

#cmd:
a1=$(echo $input_string | grep -ioE  "/tmp/.+/transaction")
echo $a1
:/tmp/storage/imart/public/storage/default/im_workflow/data/default/transaction

a2=$(echo $input_string | grep -ioE "[0-9]{6}/[0-9]{2}/[0-9]{2}")
echo $a2
=> 202107/21/16

a3=$(echo $input_string | grep -ioE "[0-9]{6}/[0-9]{2}/[0-9]{2}/\w+" | grep -ioE "\w+$")
echo $a3
:ma_8g2mm9ovekgierj

a4=$(echo $input_string | grep -ioE "\w+/flow" | grep -ioE "^\w+")
echo $a4
:ep_8g2mo7z76kgrmrj

$ echo $input_string | grep -ioE  "/tmp/.+/transaction"


log=webapps/imart/WEB-INF/log/platform/
found=$(find $log -type f -name "*.log"  | xargs grep -ionE "Caused by: java.io.FileNotFoundException:.+" )
for input_string in $(find $log -type f -name "*.log" | xargs grep -ionE "Caused by: java.io.FileNotFoundException:.+" )
do
  a1=$(echo $input_string | grep -ioE  "/tmp/.+/transaction")
  a2=$(echo $input_string | grep -ioE "[0-9]{6}/[0-9]{2}/[0-9]{2}")
  a3=$(echo $input_string | grep -ioE "[0-9]{6}/[0-9]{2}/[0-9]{2}/\w+" | grep -ioE "\w+$")
  a4=$(echo $input_string | grep -ioE "\w+/flow" | grep -ioE "^\w+")
  echo a1=$a1,a2=$a2,a3=$a3,a4=$a4
done 


2022年9月9日星期五

Linux ifconfig

#change network info 

#first reset a IP
ifconfig eth0 192.168.1.123 
#second reset netmask and broadcast for IP. 
ifconfig eth0 192.168.1.123 netmask 255.255.0.0 broadcast 192.168.1.255

#before change MAC, stop the network-adapter ethX.  
ifconfig eth0 down 

#third reset ether MAC for eth0
ifconfig eth0 hw ether 00:11:22:33:44:55
ifconfig eth0 up    #restart eth0

#request DHCP server for new IP
dhclient eth0 

#linux dns conf
more /etc/resolv.conf

 



linux cmd sed example

 1. sed s/mysql/MySQL/g test.conf >test2.conf 
     # replace all mysql to MySQL

 2. sed s/mysql/MySQL/ test.conf >test2.conf 
     # replace first mysql to MySQL

 3. sed s/mysql/MySQL/2 test.conf >test2.conf 
     # replace the second found mysql only to MySQL.



kali linux japanese keyboard layout setting

1. open setting/setting manager/keyboard.

2. tab to layout

3. add japanese and delete english

4. confirm keyboard layout = Generic 105-key PC (intl.)  

5. close window. setting completed.

2022年9月7日星期三

AI の初級考え方1:お菓子を買う

背景:

  こどもが300円までのお菓子を買うこと

条件:

  好きなお菓子の種類:
   1番はチョコレート   価格¥120 満足度:5
   2番はラムネ            価格¥80   満足度:4 
   3番はじゃがりこ      価格¥90     満足度:3

質問:

      300円まで、最善のお菓子組み合わせは何でしょう。

計算式:

      チョコレート:x 個
  ラムネ   :y 個
      ジャカリコ   : z 個

     前提条件式:       120x + 80y + 90z <=300
     求める式:          max(5x+4y+3z)
    

 

      


2022年8月31日星期三

intra-mart manul links

intra-mart Accel Platform IM-Workflow 仕様書 https://document.intra-mart.jp/library/iap/public/im_workflow/im_workflow_specification/index.html
intra-mart Accel Platform IM-Workflow 管理者操作ガイド https://document.intra-mart.jp/library/iap/public/im_workflow/im_workflow_administrator_guide/index.html
intra-mart Accel Platform IM-LogicDesigner ユーザ操作ガイド https://document.intra-mart.jp/library/iap/public/im_logic/im_logic_user_guide/index.html
intra-mart Accel Platform IM-LogicDesigner仕様書 https://document.intra-mart.jp/library/iap/public/im_logic/im_logic_specification/index.html
IM-BloomMaker チュートリアルガイド https://document.intra-mart.jp/library/bloommaker/public/im_bloommaker_tutorial_guide/index.html
IM-BloomMaker ユーザ操作ガイド https://document.intra-mart.jp/library/bloommaker/public/im_bloommaker_user_guide/index.html
IM-Repository ユーザ操作ガイド https://document.intra-mart.jp/library/iap/public/im_repository/im_repository_user_guide/index.html
IM-BloomMaker ユーザ操作ガイドCookBook https://document.intra-mart.jp/library/bloommaker/public/im_bloommaker_user_guide/texts/appendix/cookbook/index.html
IM-LogicDesigner仕様書 テンプレート https://document.intra-mart.jp/library/iap/public/im_logic/im_logic_specification/texts/function_specification/user_definition/template.html#id6
IM-LogicDesigner仕様書---タスク一覧 https://document.intra-mart.jp/library/iap/public/im_logic/im_logic_specification/texts/appendix/task_list.html
プログラミングガイド 入力チェックプログラム https://document.intra-mart.jp/library/forma/public/forma_programming_guide/texts/input_validation/index.html#common-programming-model-logicflow
IM-LogicDesigner仕様書  JavaScript https://document.intra-mart.jp/library/iap/public/im_logic/im_logic_specification/texts/function_specification/user_definition/javascript.html
IM-BIS 仕様書  暗黙的に連携するリクエストパラメータの仕様 https://document.intra-mart.jp/library/bis/public/bis_specification/texts/spec/external_linkage/external_linkage_request_spec.html
アクション処理¶ (logicdesigner 入出パラメータ) https://document.intra-mart.jp/library/iap/public/im_workflow/im_workflow_administrator_guide/texts/basic_guide/logic_flow/action_process.html
処理対象者プラグインに属するリソース全般 (logicdesigner 入出パラメータ) https://document.intra-mart.jp/library/iap/public/im_workflow/im_workflow_administrator_guide/texts/basic_guide/logic_flow/authority_plugin.html
intra-mart Accel Series ドキュメントライブラリ https://document.intra-mart.jp/library/index.html
Cookbook https://dev.intra-mart.jp/category/cookbook/
IM-Workflow CodeList https://api.intra-mart.jp/iap/javadoc/com/imwCodeList.html
申請処理Logic 前処理 https://document.intra-mart.jp/library/iap/public/im_workflow/im_workflow_specification/texts/appendix/bloommaker/permission.html

2022年8月22日星期一

git log --name-status

git log --name-status -n3
commit 482c51ab15
Author: wangxg
Date:   Mon Aug 22 13:15:09 2022 +0900
A       setting/database/ddl/BD0159.sql
A       setting/database/ddl/BD0160.sql
A       setting/database/ddl/BD0161.sql
A       setting/database/ddl/BD0162.sql
(END)