星期三, 10月 25, 2023

WAS - pmt.sh 沒有任何回應

WAS pmt.sh 執行後無任何反應

ENV:

Centos Stream 9 
WAS v8.5.5.18

Problem:

pmt.sh 執行後無任何反應, 並未如預期起動


Solution:


星期五, 2月 26, 2021

How to get the last column by Linux command

 A.txt

+++ begin A.txt +++ 

ABC/123/xyz

DEF/456/uvw

+++ end A.txt +++

Would like to get the last column: ( / as the delimiter)

expect output:

xyz

uvw


Method 1: 

awk -F"/" '{print $NF} A.txt


Method 2:

rev A.txt|cut -d '/' -f 1|rev


Method 3:

grep -o '[^/]*$' A.txt


Method 4:

perl -pe 's/(.*)\/(.*)$/$2/' A.txt


ref:

https://stackoverflow.com/questions/22727107/how-to-find-the-last-field-using-cut


星期三, 8月 12, 2020

鹹粥

  • 材料﹕
    • 白米一杯
    • 香菇 2 ~3 朵
    • 青蔥 - 切蔥花(綠色)和小段(白色)
    • 豬肉少許切絲

  •  作法﹕
    • 1. 白米一杯加入7杯水(量米杯), 加入鍋中煮, 要攪拌避免白米在鍋底燒焦
    • 2. 香菇
      • 泡水15分鐘至軟
      • 擠乾水
      • 加少許塩
      • 切細絲
    • 3. 爆香:
      • 先放入油
      • 加入香菇
      • 加入白色小段蔥
      • 將香菇和蔥放鍋邊
      • 再加入肉絲, 炒至變白色
      • 加入醬油
      • 全部一起拌炒
      • 加入少許水炒均勻
    • 4. 將爆香完的料加入白飯中, 一起煮, 約25分左右
    • 5. 上桌前2分鐘加入蔥花後,即可完成

星期二, 2月 11, 2020

how to make such video

Now, I get it!!  


complete:

https://www.youtube.com/watch?v=kBF6Bvth0zw


how to make it:
https://www.youtube.com/post/Ugzf5SL_yh9NglCJzgF4AaABCQ




IBM Cloud
6 個月前
Since the launch of the New Builders light board video series, we've received a lot of questions about exactly how we did it.

We decided to pull back the curtain and answer your questions about this successful series.

1. No, the speaker doesn’t write backwards. We flip the video horizontally in post-production.(see the photo of our set below)

2. No, there are no mirrors involved - it does look backwards, but ... (see #1)

3. We just use standard fluorescent markers. No lasers or light-up pens, sorry.

4. The light comes from LEDs in a strip around the edge of the glass within the frame.

Below is a behind-the-scenes photo of one of our speakers, Sai Vennam, on set in our  Austin, TX studio. 

We hope this answers your questions. If you have more, please comment below.

To check out the entire New Builders video playlist, visit: https://ibm.co/2Z5XKLb



星期三, 7月 24, 2019

How to check and modify pids.max of user

1. find out the cgroup of the user

#echo $$|xargs -I '$' cat '/proc/$/cgroup'


/user.slice/user-1000.slice is the cgroup of the user

2. check the pids.max (TasksMax) setting for the user
(1) method 1:
#cgget -a /user.slice/user-1000.slice


(2) method 2:
#cat /sys/fs/cgroup/pids/user.slice/user-1000.slice/pids*

3. modify the pids.max
# systemctl set-property user-1000.slice TasksMax=512

4. verify (using python script)

import time
import threading

def worker():
    while True:
        time.sleep(1000)
        

threads = []
num_worker_threads = 19000
for i in range(num_worker_threads):
    t = threading.Thread(target=worker)
    try:
        t.start()
        threads.append(t)
        print(i)
    except:
        print("EX")
        time.sleep(2000)

for t in threads:
    t.join()
python script:
https://zhuanlan.zhihu.com/p/29192624

cgroup information:
https://access.redhat.com/documentation/zh-tw/red_hat_enterprise_linux/6/html/resource_management_guide/sec-obtaining_information_about_control_groups

xargs:
https://superuser.com/questions/401614/inserting-string-from-xargs-into-another-string




星期六, 6月 29, 2019

Access control for the multiple cluster transmission queue

https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.con.doc/q017170_.htm

Choose between three modes of checking when an application puts messages to remote cluster queues. The modes are checking remotely against the cluster queue, checking locally against SYSTEM.CLUSTER.TRANSMIT.QUEUE, or checking against local profiles for the cluster queue, or cluster queue manager.

IBM® WebSphere® MQ gives you the choice of checking locally, or locally and remotely, that a user has permission to put a message to a remote queue. A typical IBM WebSphere MQ application uses local checking only, and relies on the remote queue manager trusting the access checks made on the local queue manager. If remote checking is not used, the message is put to the target queue with the authority of the remote message channel process. To use remote checking you must set the put authority of the receiving channel to context security.

The local checks are made against the queue that the application opens. In distributed queueing, the application usually opens a remote queue definition, and access checks are made against the remote queue definition. If the message is put with a full routing header, the checks are made against the transmission queue. If an application opens a cluster queue that is not on the local queue manager, there is no local object to check. The access control checks are made against the cluster transmission queue, SYSTEM.CLUSTER.TRANSMIT.QUEUE. Even with multiple cluster transmission queues, from Version 7.5, local access control checks for remote cluster queues are made against SYSTEM.CLUSTER.TRANSMIT.QUEUE.

The choice of local or remote checking is a choice between two extremes. Checking remotely is fine-grained. Every user must have an access control profile on every queue manager in the cluster to put to any cluster queue. Checking locally is coarse-grained. Every user needs only one access control profile for the cluster transmission queue on the queue manager they are connected to. With that profile, they can put a message to any cluster queue on any queue manager in any cluster.

Since Version 7.1, administrators have another way to set up access control for cluster queues. You can create a security profile for a cluster queue on any queue manager in the cluster using the setmqaut command. The profile takes affect if you open a remote cluster queue locally, specifying only the queue name. You can also set up a profile for a remote queue manager. If you do so, the queue manager can check the profile of a user that opens a cluster queue by providing a fully qualified name.

The new profiles work only if you change the queue manager stanza, ClusterQueueAccessControl to RQMName. The default is Xmitq. You must create profiles for all the cluster queues existing applications use cluster queues. If you change the stanza to RQMName without creating profiles the applications are likely to fail.

ClusterQueueAccessControl usage and its implications


From MQ 7.1 onwards, there is a new option made available for the users who can access cluster queue even though they do not have access to SYSTEM.CLUSTER.TRANSMIT.QUEUE. This is made possible with the introduction of ClusterQueueAccessControl attribute in the Security stanza of the qm.ini file.

The ClusterQueueAccessControl attribute takes two values, Xmitq or RQMName. The default value is Xmitq and the behavior is same as seen in previous versions where the access to remote cluster queues gets resolved to the access of the SYSTEM.CLUSTER.TRANSMIT.QUEUE. By setting the ClusterQueueAccessControl to RQMName, the profiles of remote cluster queues will be resolved to locally defined profiles of named queues or named queue manager.

Consider two Qmgrs QM1 & QM2 are part of cluster CLUS1
Create a queue on QM2 and make it part of cluster CLUS1.
  DEFINE QL(MYQ) CLUSTER(CLUS1)

A user who is part of a group called dev_group connects to Qmgr QM1 and wants to put a message to the cluster queue MYQ. By either creating a local named queue profile and giving the user put access on it or by creating a local named queue manager profile and then giving it the required access, the user will be able to put message to the remote cluster queue even though he does not have access over SYSTEM.CLUSTER.TRANSMIT.QUEUE.

1. By creating queue profile :
setmqaut -m QM1 -t queue -n MYQ -g dev_group +putamqsput MYQ QM1

2. By creating queue manager profile :
setmqaut -m QM1 -t rqmname -n QM2 -g dev_group +putamqsput MYQ QM1 8208 0 QM2

qm.ini:

Security:      ClusterQueueAccessControl=RQMName





星期一, 5月 06, 2019

disable firewall and selinux in CentOS 7

Linux init configuration for test MQ

1. disable selinux
vi /etc/selinux/config
SELINUX=disabled

=> reboot

2. disable firewall
systemctl stop firewalld.service (one time)
systemctl disable firewalld.service (all time)



https://www.opencli.com/linux/centos-7-disable-firewalld-selinux