環境
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
環境
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
in_txt = '13 5 4 + 3 / 4 * -'.split(' ') | |
symbols = ('+', '-', '*', '/') | |
stack = [] | |
print("input::", ' '.join(in_txt)) | |
for i,_ in enumerate(in_txt): | |
# FOUND NUM | |
if in_txt[i] not in symbols: | |
stack.append(int(in_txt[i])) | |
continue |
#!/bin/bash | |
user="${1}" | |
host="ldap://example.com" | |
base="dc=example,dc=com" | |
filter1="(& (objectClass=posixAccount) (uid=${user}))" | |
filter2="sshPublicKey" | |
id "$user" >/dev/null 2>&1 | |
RESULT=$(ldapsearch -x -LLL -H "$host" -b "$base" "$filter1" "$filter2" \ |
ZabbixからSlackへ通知
#!/usr/bin/env python3.6 | |
def parse_file(file_name: str): | |
import re | |
with open(file_name, "r") as file: | |
file_content = file.read() | |
file_content = re.sub(r"#.*\n(\n)?|server-duid.+;\n", r'', file_content) | |
lease_logs = [fc for fc in re.split(r"\n}\n*", file_content)] |
VM_LIST=`vim-cmd vmsvc/getallvms | awk '{print $1"/"$2}'` | |
# filter: using `grep` | |
for vm in $VM_LIST | |
do | |
vm_id=`echo $vm | cut -f1 -d'/'` | |
ip_addr=`vim-cmd vmsvc/get.summary $vm_id | grep ipAddress | grep -o "10.1.1.[0-9]\+"` | |
vm_name=`echo $vm | cut -f2 -d'/'` | |
echo $vm_name $ip_addr | |
done |
#!/bin/bash | |
host_list=`cat <<EOF | |
bootcamp-vm-25 | |
bootcamp-vm-49 | |
bootcamp-vm-5 | |
bootcamp-vm-8 | |
bootcamp-vm-62 | |
bootcamp-vm-10 | |
bootcamp-vm-15 |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-deployment | |
labels: | |
app: nginx | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: |