Skip to content

Instantly share code, notes, and snippets.

View shandytepe's full-sized avatar

Shandy shandytepe

  • Jakarta
  • 07:14 (UTC +07:00)
View GitHub Profile
@shandytepe
shandytepe / docker-compose.yml
Created October 7, 2024 14:06
docker compose untuk live class week 4 case 2 devops pacmann
services:
postgres-responder:
image: postgres:16
container_name: postgres-responder-container
environment:
POSTGRES_DB: credit_score
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
ports:
- 5434:5432
@shandytepe
shandytepe / Dockerfile
Created September 23, 2024 12:59
run postgres basic local
FROM postgres:16
ENV POSTGRES_USER="postgres"
ENV POSTGRES_PASSWORD="secretpass"
ENV POSTGRES_DB="flask_db"
COPY init.sql /docker-entrypoint-initdb.d/
EXPOSE 5432
@shandytepe
shandytepe / system-info.sh
Created September 18, 2024 11:49
untuk praktek live class DevOps week 1
#!/bin/bash
echo -e "Hostname: "`hostname`
echo -e "Manufacturer: "`cat /sys/class/dmi/id/chassis_vendor`
echo -e "System Main IP: "`hostname -I`
services:
postgres_bank:
hostname: postgres_bank
container_name: postgres_bank_container
image: 'postgres:latest'
restart: on-failure
environment:
- POSTGRES_DB=bank
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=cobapassword
# kita akan membuat function data validation
def data_validation(data: pd.DataFrame):
# 1. check data shape
n_rows = data.shape[0]
n_cols = data.shape[1]
print(f"Sales data yang memiliki {n_rows} baris dan {n_cols} kolom!")
print("")
# kita akan membuat function data validation
def data_validation(data: pd.DataFrame):
# 1. check data shape
n_rows = data.shape[0]
n_cols = data.shape[1]
print(f"Sales data yang memiliki {n_rows} baris dan {n_cols} kolom!")
print("")
@shandytepe
shandytepe / bangun_ruang.py
Created May 21, 2024 14:49
kunci jawaban case 4 materi 4 python pacmann
bangun_ruang = "lingkaran"
rusuk = 6
panjang = 6
lebar = 5
tinggi = 9
jari_jari = 14
tinggi_tabung = 8
PI = 3.14
@shandytepe
shandytepe / docker-compose.yml
Created May 7, 2024 05:01
Docker Compose untuk kebutuhan Thread Twitter Pacmann
services:
# database postgres warehouse
db_sales:
hostname: db_sales
container_name: db_sales_container
image: 'postgres:latest'
restart: on-failure
environment:
- POSTGRES_DB=db_sales
- POSTGRES_USER=postgres
@shandytepe
shandytepe / fct_reservations.sql
Created March 7, 2024 05:08
SQL script to create fct_reservations
with dim_dates as (
select *
from {{ ref("dim_dates") }}
),
dim_customers as (
select *
from {{ ref("dim_customers") }}
),
@shandytepe
shandytepe / run_etl.sh
Created January 15, 2024 06:17
Shell Script untuk menjalankan Luigi Pipeline
#!/bin/bash
# Virtual Environment Path
VENV_PATH="/home/shandytp/learn-luigi/pertemuan-14/video-learning/venv/bin/activate"
# Activate venv
source "$VENV_PATH"
# set python script
PYTHON_SCRIPT="/home/shandytp/learn-luigi/pertemuan-14/video-learning/etl_process.py"