본문 바로가기 메뉴 바로가기

fendys

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

fendys

검색하기 폼
  • ALL fendys write (151)
    • AWS (21)
    • linux (93)
    • security (0)
    • ansible (13)
    • monitoring (2)
    • VM (0)
    • DB (4)
    • windows (4)
    • it (12)
    • 가상화폐 (0)
  • 방명록

ALL fendys write (151)
aws update iam policy python (boto3)

import boto3from botocore.exceptions import ClientErrorimport jsondef get_policy_document(iam_client, policy_arn): """ IAM 정책의 문서를 가져옵니다. :param iam_client: Boto3 IAM 클라이언트 :param policy_arn: 조회할 IAM 정책의 ARN :return: 정책 문서 (JSON 형식) """ try: response = iam_client.get_policy(PolicyArn=policy_arn) policy_version_id = response['Policy']['DefaultVersionId'] ..

AWS 2024. 9. 2. 20:12
aws multi account attach iam role & policy python (boto3)

import boto3from botocore.exceptions import ClientErrordef attach_policy_to_role(profile_name, role_name, policy_arn): """ IAM 역할에 정책을 연결합니다. :param profile_name: AWS CLI 프로파일 이름 :param role_name: 정책을 연결할 IAM 역할의 이름 :param policy_arn: 연결할 IAM 정책의 ARN """ # 지정된 프로파일을 사용하는 세션 생성 session = boto3.Session(profile_name=profile_name) # 세션에서 IAM 클라이언트 생성 iam_client = sessio..

AWS 2024. 9. 2. 20:08
aws multi account create iam policy python (boto3)

import boto3import json# 프로파일 이름과 관련된 정보를 리스트로 관리profiles = ['fendys-prodn','fendys-dev']# IAM 정책 문서 정의policy_document = { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ec2:*" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "network-firewall:*..

AWS 2024. 9. 2. 20:05
aws multi account create iam role python (boto3)

import boto3import json# IAM 역할을 생성하고 태그를 추가하는 함수def create_role_and_add_tags(profile_name, role_name, trust_policy, tags): # 세션 생성 session = boto3.Session(profile_name=profile_name) iam_client = session.client('iam') # IAM 역할 생성 print(f"Creating role {role_name} in profile {profile_name}...") response = iam_client.create_role( RoleName=role_name, AssumeRolePo..

AWS 2024. 9. 2. 20:00
packer ami update

request - version check!!!#yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo#yum install terraform#yum install ansible#pip install --upgrade awscli#packer plugins install github.com/hashicorp/amazon#packer plugins install github.com/hashicorp/ansible ###### ami-update.json#### use packer build ami-update.json{ "_comment": "AMI using Amazon Linux2", "va..

linux 2024. 8. 2. 00:27
"grubby" 커널 변경 명령어

oracle linux8 버전에서 검증 되었습니다.grubby --info=ALL #변경 가능한 전체 커널 버전을 보여준다.[root@fendys ~]# grubby --info=ALL index=0kernel="/boot/vmlinuz-5.4.17-2136.300.7.el8uek.x86_64"args="ro crashkernel=auto LANG=en_US.UTF-8 console=tty0 console=ttyS0,115200n8 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 net.ifnames=1 nvme_core.shutdown_timeout=10 nvme_core.io_timeout=4294967295 ipmi_si.tryacpi=0 ipmi_si.trydmi=0 ipmi_si...

linux 2024. 7. 10. 16:14
cisco ansible config

nxis, ios 구분을 인벤토리에서 구분하여 when조건으로 실행 한다. hosts - inventory [network:children] nxos ios [nxos] nxos01 ansible_host=10.60.50.13 [nxos:vars] ansible_connection=network_cli ansible_network_os=nxos ansible_user=fendys ansible_password=password1! [ios] ios01 ansible_host=10.6.99.176 ios01 ansible_host=10.3.99.145 [ios:vars] ansible_connection=network_cli ansible_network_os=ios ansible_user=fendys ans..

ansible 2024. 4. 5. 20:59
sed 활용

sed command를 통해서 아래 포함할문구1 또는 포함할문구2 가 있는 라인은 삭제 하고 /data/result/filename명으로 저장한다. #!/bin/bash for file in ls * do if [ -f $file ] then tmpfile="$file" mkdir -p /data/result wc -l $file >> /data/result/result.log sed -e '/{포함할문구1}\|{포함할문구2}/d' $file > /data/result/$tmpfile wc -l /data/result/$file >> /data/result/result.log fi done sed command를 통해서 아래 {team\\\":{\\\"number\\\":\\\"[0-9]\{16\}} 을..

linux 2024. 4. 5. 20:36
이전 1 2 3 4 ··· 19 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • [여행] warmfree
  • [재미] wowns
TAG
  • shell connmad log
  • ansible network
  • oracle linux8 kernel
  • windows.old 강제삭제
  • ILO
  • ansible ios
  • dl20 g9 centos7 설치
  • ISCSI 볼륨 RAC
  • 특정 라인삭제
  • vm rac
  • 특정 문구 치환
  • nutanix rac
  • nxos ansible
  • DL20 GEN9 장비에 CentOS 7
  • dl20 centos7
  • cgroup
  • cmd로 계정 생성
  • linux command log
  • cisco ansible
  • kernel 변경
  • dl20
  • 리눅스 커맨드 로그남기기
  • 윈도우 cmd 계정 관리
  • ipmi
  • chrony
  • ios ansible
  • centos7 ntp
  • 윈도우서버 계정 관려
  • cmd로 윈도우 계정 관리
  • CentOS 7 GUI
more
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바