This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import logging | |
import requests | |
import azure.functions as func | |
def main(req: func.HttpRequest) -> func.HttpResponse: | |
# get event data from acr | |
logging.info('Python HTTP trigger function processed a request.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import requests | |
from bs4 import BeautifulSoup | |
def weather_info(): | |
data = requests.get("https://weather.naver.com/") | |
soup = BeautifulSoup(data.content, 'html.parser') | |
weather = dict() | |
for i in range(1,3): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import requests | |
from bs4 import BeautifulSoup | |
def ranking_news(category): | |
data = requests.get(f"https://sports.naver.com/{category}/index") | |
soup = BeautifulSoup(data.content, 'html.parser') | |
rankings = soup.select('ol.news_list li') | |
news = dict() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# host_key_checking: 호스트 머신의 known_hosts 파일에 등록된 매니지드 노드인지 체크하는것 무시 | |
[defaults] | |
inventory = ./inventory.ini | |
host_key_checking=false | |
# ansible user는 sudo를 사용해 root권한을 가지고 역할을 수행 | |
# become_ask_pass: sudo명령시 비밀번호 물어보지 않음 | |
[privilege_escalation] | |
become = True | |
become_method = sudo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ubuntu, centos | |
[target] | |
# Ubuntu | |
<UBUBTU_PRIVATE_IP> ansible_user="" ansible_password="" | |
# CentOS | |
<CENTOS_PRIVATE_IP> ansible_user="" ansible_password="" ansible_become_password="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Telegraf Linux | |
hosts: target | |
become: yes | |
tasks: | |
- name: check distro | |
debug: | |
var: ansible_distribution | |
# Ubuntu | |
- block: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
azurerm = { | |
source = "hashicorp/azurerm" | |
version = " ~> 3.0" | |
} | |
} | |
} | |
provider "azurerm" { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === Required === | |
# App info | |
variable "client_id" { | |
type = string | |
description = "Applicaion ID" | |
sensitive = true | |
} | |
variable "client_secret" { | |
type = string | |
description = "Applicaion Secret" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Input Variable from packer variable | |
DATABASE=$1 | |
DB_USERNAME=$2 | |
DB_PASSWORD=$3 | |
echo "Scripti Start at $(date '+%Y-%m-%d %H:%M:%S')" | |
echo | |
echo "Check input variables" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "azure-arm" "monitor" { | |
# App info | |
client_id = "${var.client_id}" | |
client_secret = "${var.client_secret}" | |
subscription_id = "${var.subscription_id}" | |
tenant_id = "${var.tenant_id}" | |
# Managed Image info | |
managed_image_resource_group_name = "${var.managed_image_resource_group_name}" | |
managed_image_name = "${var.managed_image_name}" |
NewerOlder