2023年9月5日 星期二

CRONTAB file

 in /var/spool/cron 

2023年8月8日 星期二

python star symbol is unpacking

# explain

This PEP proposes extended usages of the * iterable unpacking operator and ** dictionary unpacking operators to allow unpacking in more positions, an arbitrary number of times, and in additional circumstances. Specifically, in function calls, in comprehensions and generator expressions, and in displays.


https://www.geeksforgeeks.org/packing-and-unpacking-arguments-in-python/

https://peps.python.org/pep-0448/#id6

 

# example 

print( [i for i in [*[1,2], 1]] )

# [1, 2, 1]

print( [i for i in [[1,2], 1]] )

# [[1, 2], 1]


def hello(*attrs):

    for s in attrs:

        print(s)

        

        

hello([1,2,3])

#[1, 2, 3]


hello(*[1,2,3])

#1

#2

#3

hello(1,2,3)

#1

#2

#3

2023年7月17日 星期一

Rabbitmq REST API

 1. https://rawcdn.githack.com/rabbitmq/rabbitmq-server/v3.12.1/deps/rabbitmq_management/priv/www/api/index.html



2. https://www.rabbitmq.com/vhosts.html

2023年7月11日 星期二

airflow api

 # seting the 

airflow_api_auth_backends: 'airflow.api.auth.backend.basick_auth'




# Test

curl -X GET  --user "airflow:1qaz2WSX" "https://airflow-dev.armor.hinet.net/api/v1/pools"


curl -X PATCH 'https://airflow-dev.armor.hinet.net/api/v1/dags/report_backup?update_mask=is_paused' \

-H 'Content-Type: application/json' \

--user "airflow:1qaz2WSX" \

-d '{

    "is_paused": true

}'


# ref setting airflow.cfg

airflow_api_auth_backends: 'airflow.api.auth.backend.basick_auth


# https://stackoverflow.com/questions/61329923/apache-airflow-rest-api-authentication

# https://airflow.apache.org/docs/apache-airflow/1.10.12/howto/set-config.html'

#https://airflow-dev.armor.hinet.net/redoc

2023年7月4日 星期二

cenos7 selinux close

 

setenforce 0



# good

https://wiki.gentoo.org/wiki/SELinux/Tutorials/Where_to_find_SELinux_permission_denial_details


#

https://www.ltsplus.com/linux/disable-selinux

2023年7月3日 星期一

centos7 epel

sudo yum install epel-release

 sudo yum provides iperf


2023年7月2日 星期日

centos7 open the firewall

 #network tools

sudo yum install telnet


# fireall stop

systemctl stop firewalld

systemctl status firewalld


#

# add the port

sudo firewall-cmd --zone=public --add-port=10050/tcp --permanent

sudo firewall-cmd --reload

sudo iptables-save | grep 10050



#ref

https://www.thegeekdiary.com/how-to-open-a-ports-in-centos-rhel-7/