Skip to content

Instantly share code, notes, and snippets.

View developer-sdk's full-sized avatar
Finding...

hs_seo developer-sdk

Finding...
View GitHub Profile
@developer-sdk
developer-sdk / superset_install.sh
Created November 13, 2023 10:53
superset 설치
# 설치전 필요한 라이브러리 추가. python 가상 환경 설치를 위한 라이브러리 추가
sudo apt update
sudo apt install build-essential libssl-dev libffi-dev python3-dev python-pip libsasl2-dev libldap2-dev default-libmysqlclient-dev pkg-config -y
sudo apt install python3.10-venv -y
# 가상환경 설정
python3 -m venv superset-venv
source superset-venv/bin/activate
# requirement 정리 필요
#################################
# curl
#################################
# 2분간 재시도 횟수 5회
curl --retry 5 --retry-max-time 120 http://127.0.0.1
# connection refused 오류도 재작업
curl --retry-connrefused http://127.0.0.1
############################
# ssh 배너 설정
# Banner에 파일 위치 설정
sudo vi /etc/ssh/sshd_config
# 위에 설정한 위치에 배너 파일 생성
sudo vi /etc/ssh/banner
# sshd 재시작
sudo systemctl restart sshd.service
@developer-sdk
developer-sdk / pyhive_kerberos.py
Created August 18, 2023 23:48
pyhive 커버로스 예제
from pyhive import hive
from TCLIService.ttypes import TOperationState
conn = hive.connect(host='test.com',
port=10000,
database='default',
auth='KERBEROS',
username='hive_user',
kerberos_service_name='hive').cursor()
<!--
Copyright 2022 The Apache Software Foundation
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@developer-sdk
developer-sdk / ansi_color_escape.py
Created August 13, 2023 00:49
ansi color code 제외
def escape_ansi_color_pattern(ansi_text: str) -> str:
# 7-bit C1 ANSI sequences
ansi_escape = re.compile(r'''
\x1B # ESC
(?: # 7-bit C1 Fe (except CSI)
[@-Z\\-_]
| # or [ for CSI, followed by a control sequence
\[
[0-?]* # Parameter bytes
[ -/]* # Intermediate bytes
def op_test0(a, b, c, d):
print(a, b, c, d)
def op_test1(val1, *op_args):
print(val1)
print(op_args)
from airflow.models import DAG
from airflow.operators.python_operator import PythonOperator
import datetime
dag_args = {'owner': 'deploy',
'start_date': datetime.datetime(2022, 7, 10),
'catchup': False}
apiVersion: v1
kind: Pod
metadata:
name: node-shell
namespace: test-namespace
spec:
volumes:
- name: kube-api-access-l47gj
projected:
sources:
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-mysql
spec:
capacity:
storage: 50Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain