2023.06.19

Personal

I wanted to generate revenue through WordPress, so I signed up for the premium plan, which was advertised to allow earnings from ads. It’s been a point of curiosity for a while, so i decided to try it out for a year. Considering the cost of running cloud resources on the smallest scale, which would come to at leat 10,000 KRW per month, I figured I cloud afford to give it a shot. However, once I signed up, it didn’t seem like there was any obvious way to make money. I tried attaching Google AdSense, but I wondered if it would really work…

There was something called an ad block, so I added it between posts. I wonder what will change?

2. Family

My wife made kimchi stew and rice for breakfast today. She had been in so much pain the night before that I was very worried. I was a bit angry because she seemed to be pushing her self too hard, but I was also grateful that she could still move. I cloud feel her determination to recover before starting cancer treatment.
At lunchtime, a home care nurse from Serverance Hospital came to visit. She carefully redressed the wounds. For dinner, we had cold white radish noodle and spicy mixed noodles, which were delicious. Even though I felt full, the meal was very low in calories.

I’m so happy to be with my wife.
I hope this happiness continues.


Advertisements

개인

워드프레스로 수익을 창출하고 싶어서 premium plan으로 가입하면, 광고 수익을 얻을 수 있는 것 처럼 쓰여있었다. 예전부터 궁금했던 부분이라 이번에 1년치를 가입해봤다. 최소단위로 클라우드 자원을 직접 운영해도 월 만원 이상은 나오는지라 속는 셈치고 가입해봤다. 근데 막상 가입해도 딱히 돈을 벌 수 있어보이진 않았다. 구글 애드센스를 달아봤는데 과연…

post 사이에 ad 블록이란게 있어서 추가해봤다. 뭐가 바뀌는 거지?

가족

아내가 오늘 아침밥으로 김치찌개와 밥을 해주었다. 전날 밤에 무척 아파했던 지라 걱정을 많이 했었다. 무리하는 것 같아 약간 화가 났지만 그래도 움직 일 수 있는게 어디인가. 너무 감사할 따름이다. 항암전에 몸을 회복하려는 아내의 의지가 느껴졌다.
점심때는 세브란스 병원에서 가정간호 방문을 해주었다. 꼼꼼히 드레싱을 해주셨다. 저녁때는 동치미 국수와 비빔국수를 해먹었는데 너무 맛있었다. 배는 부른데 칼로리가 매우 낮았다.

아내와 함께 지내는게 너무 즐겁다.
이 행복이 계속 되었으면 좋겠다.

2023.06.18


After I decided to write every day, I failed to achieve my goal on the third day, It was a three days of passion. I also failed to achieve my goal of following and typing Python code every day. But what does it matter? Let’s try every day.

Since a week ago, I have been recording my blood pressure, weight, and body temperature every day. I’m also keeping a daily record of my food intake and Nutraceuticals. As I turned 40, I started to feel that my body is not the same as before. I realized that in order to take care of my wife, I need to take good care of my own body. I have been pointed out for fatty liver and hypertension in yearly health check-up. I am taking one capsule each of vitamins B, C, D, omega-3 and magnesium. Let’s aim to see improved results in this year’s health check-up

Today, my wife was in better condition than yesterday. In the evening, she went outside for a walk twice. She took her walker, but it was a big improvement. After returning home, she fell asleep on the sofa, clutching her stomach as if in pain. She says she hurts like every night, and I’m worried if that’s okay.

On June 23rd (Friday), a clinical trial for liposarcoma cancer treatment begins. I sincerely pray that the medicine will work well to overcome cancer and that I can live happily ever after with my wife


매일 글쓰기로 마음먹은 이후 3일차가 되는날 목표를 달성하지 못했다.
작심삼일이다. 파이썬 코드를 매일 따라 치기만 하기로 한 것 도 달성하지 못했다.
아무렴 어떤가 매일 시도를 해보자.

1주일 전부터 매일 일어나서 혈압, 체중, 체온을 기록하고 있다. 식사량과 영양제 섭취도 매일 기록하고 있다. 40세가 되면서부터 몸이 전과 같지 않음을 느낀다. 아내를 잘 돌보려면 내 몸은 내가 잘 챙겨야겠다는 생각을 하였다. 지방간과 고혈압이 건강검진 때마다 지적된다. 영양제는 비타민 B, C , D, 오메가 3, 마그네슘 캡슐 1개씩 챙겨먹고 있다. 올해 건강검진 때는 부디 개선되는 결과를 볼 수 있도록 해보자

오늘 아내는 어제보다는 상태가 좋아졌다. 저녁때는 집밖에 나가 2바퀴 산책을 했다. 워커를 끌고 갔지만, 큰 발전이다. 다녀온 후로 몸이 아픈지 소파에서 배를 끙끙 붙잡으며 잠에 빠졌다. 밤마다 이렇게 아팠다고 하는데 괜찮은 건지 걱정이 된다.

6/23 (금) 지방육종 항암 임상실험이 시작된다. 부디 약이 잘들어 암을 극복하고 아내와 평생 행복하게 지낼 수 있기를 간절히 기도한다.

2023.06.13

전일 응급실을 다녀온 후 몸 컨디션이 기준치 이하로 떨어진 것 같았다

아내에게 집근처 경락마사지 예약을 부탁하였다

11:00 ~ 13:00 간 등, 얼굴 경략 마사지를 받았다

아팠지만 혈액 순환이 되는 것 같아 몸 컨디션이 좋아졌다. 영양제와 운동을 챙겨야겠다. 이젠 몸을 챙겨야할 때인 것 같다.

머리 두통은 계속 발생중이다

저녁이 되니 두통이 느껴지지 않는다

뭐든 기록을 남겨본다. 뭐든 되겠지…

2023.06.12

원래는 기술 블로그로 시작했으나 굳이 기술내용만 쓸필요가 있나 싶어 삶에 대한 기록을 남겨보려 한다. 뭐든 꾸준히 하는게 제일 좋으니 먼가 해보려 한다

2023.06.12 (월) 항암 치료중인 아내를 데리고 응급실에 다녀왔다. 신촌세브란스병원 응급실 15:30 쯤 도착하여 접수는 금방 하였다. 코로나 검사 때문에 4시간정도 격리공간에서 하염없이 대기하였다.
19:00 진료실로 불려 들어갔지만 방치…
혈액검사, 소변검사, 가래검사, 심전도검사, 복부엑스레이를 촬영하였다
항생제 수액을 놔주었다 (타조페란)

혈액내 염증수치가 퇴원시 20 정도였던 것이 60 정도 올라갔다. 항생제 약을 처방받고 퇴원했다. 퇴원시간 6.13 02:00

아보카도 오일 등급

아보카도 오일은 여러 가지 등급으로 나뉘며, 이는 품질과 가공 방식에 따라 다릅니다. 여기에는 주로 세 가지 등급이 포함됩니다:

  1. 엑스트라 버진 아보카도 오일: 이는 최고 품질의 아보카도 오일이며, 첫 번째 압착 과정에서 추출됩니다. 이 오일은 가장 부드럽고 미묘한 맛을 가지며, 높은 온도에서는 사용하지 않는 것이 좋습니다.
  2. 버진 아보카도 오일: 이는 엑스트라 버진 오일과 매우 유사하며, 첫 번째 압착에서 얻어집니다. 그러나 이 오일은 엑스트라 버진 오일보다 약간 더 강한 맛을 가지고 있을 수 있습니다.
  3. 순수한 아보카도 오일: 이 오일은 더 많은 가공을 거칩니다. 이로 인해 오일이 높은 온도에 잘 견딜 수 있게 되므로, 요리에 더 넓게 사용될 수 있습니다.

Olive oil (작성중)

집에 델리노 올리브 오일을 사놓은 것이 있다

정제 90% + 착유 10% 라고 한다

대체 정체가 무엇인지 궁금하여 정리를 해본다


올리브 오일에는 “퓨어” (Pure), “버진” (Virgin), “엑스트라 버진” (Extra Virgin) 등 다양한 등급이 있습니다. 이들 간의 주요 차이점을 살펴보겠습니다:

  1. 퓨어 (Pure) 올리브 오일:
    • “퓨어” 올리브 오일은 오일브 오일과 다른 식물성 오일의 혼합물일 수도 있습니다.
    • 퓨어 올리브 오일은 일반적으로 신선한 올리브와 신선한 오일로만 제조되지 않으며, 오일의 품질과 특성은 다양할 수 있습니다.
  2. 버진 (Virgin) 올리브 오일:
    • 버진 올리브 오일은 엑스트라 버진 올리브 오일과 비교하면 품질 면에서 조금 낮은 등급입니다.
    • 기계적인 방법으로 추출되어 화학 처리나 라핀 과정을 거치지 않습니다.
    • 버진 올리브 오일은 엑스트라 버진에 비해 미묘한 차이가 있을 수 있지만, 여전히 맛과 향을 가지고 있습니다.
  3. 엑스트라 버진 (Extra Virgin) 올리브 오일:
    • 엑스트라 버진 올리브 오일은 가장 높은 품질을 가진 올리브 오일로 인정받는 등급입니다.
    • 첫 번째 착유로만 추출되며, 열 및 화학 처리가 없는 과정을 거칩니다.
    • 엑스트라 버진 올리브 오일은 과일 향과 맛이 풍부하며, 낮은 산성도를 가지고 있습니다.

요약하자면, 엑스트라 버진 올리브 오일은 가장 높은 품질과 맛을 가지며, 신선도와 자연스러운 특성을 강조합니다. 버진 올리브 오일은 엑스트라 버진에 비해 품질 면에서 조금 낮은 등급이지만, 여전히 좋은 품질을 가지고 있습니다. “퓨어” 올리브 오일은 다른 오일과 혼합될 수 있으므로 오일의 품질을 확인하는 것이 중요합니다.

Django 4.1 addtional configs

setting.py

if os.environ.get('DJANGO_CSRF_TRUSTED_ORIGINS'):
    CSRF_TRUSTED_ORIGINS = os.environ.get('DJANGO_CSRF_TRUSTED_ORIGINS').split(' ')
else:
    CSRF_TRUSTED_ORIGINS = []

if os.environ.get('DJANGO_ACCOUNT_DEFAULT_HTTP_PROTOCOL'):
    ACCOUNT_DEFAULT_HTTP_PROTOCOL = os.environ.get('DJANGO_ACCOUNT_DEFAULT_HTTP_PROTOCOL')
else:
    ACCOUNT_DEFAULT_HTTP_PROTOCOL = 'http'

.env.prod

DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 3.39.199.34 nalcoding.net www.nalcoding.net [::1]
DJANGO_CSRF_TRUSTED_ORIGINS=https://nalcoding.net https://www.nalcoding.net [::1]
DJANGO_ACCOUNT_DEFAULT_HTTP_PROTOCOL=https

nginx.conf

server {
    listen 443 ssl; #ssl 빼 먹으면 안됨
    server_name nalcoding.net;

    location / {
        proxy_pass http://do_it_django;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    }

    location /static/ {
        alias /usr/src/app/_static/;
    }

    location /media/ {
        alias /usr/src/app/_media/;
    }
    client_max_body_size 100m;
    ssl_certificate /etc/letsencrypt/live/nalcoding.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/nalcoding.net/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

Communicate github repository

Create Github token

User profile -> setting -> developer setting -> Personal access token -> classic -> generate (‘repo’, ‘read:org’, ‘workflow’) -> copy crediential token

Install github cli

(aws lightsail – ubuntu) ssh connect

link : https://github.com/cli/cli/blob/trunk/docs/install_linux.md

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y

Setup credential info

https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git

ubuntu@atoz:~$ gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'workflow'.
? Paste your authentication token: ****************************************
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as {github name}
ubuntu@atoz:~$

git clone

ubuntu@atoz:~/github$ git clone https://github.com/{github username}/{project name}.git

Cloning into 'do_it_django_a_to_z'...
remote: Enumerating objects: 622, done.
remote: Counting objects: 100% (622/622), done.
remote: Compressing objects: 100% (418/418), done.
remote: Total 622 (delta 298), reused 467 (delta 146), pack-reused 0
Receiving objects: 100% (622/622), 2.43 MiB | 16.49 MiB/s, done.
Resolving deltas: 100% (298/298), done.
ubuntu@atoz:~/github$ ls
do_it_django_a_to_z
ubuntu@atoz:~/github$

docker-compose exec web Superuser creation skipped due to not running in a TTY.

Error Message

docker-compose exec web python manage.py createsuperuser
Superuser creation skipped due to not running in a TTY. You can run manage.py createsuperuser in your project to create one manually

Solution #1

winpty docker-compose exec web python manage.py createsuperuser

Solution #2

docker exec -it ‘container name’ /bin/bash

(inside container)python manage.py createsuperuser

비공개 Kubernetes 클러스터 설정

GSP178

영역설정
gcloud config set compute/zone us-central1-a
gcloud compute zones list

비공개 클러스터 만들기
gcloud beta container clusters create private-cluster \
    --private-cluster \
    --master-ipv4-cidr 172.16.0.16/28 \
    --enable-ip-alias \
    --create-subnetwork ""

서브넷 및 보조 IP 주소 범위 확인
gcloud compute networks subnets list --network default

조회결과
gke-private-cluster-subnet-7aee73db

gcloud compute networks subnets describe gke-private-cluster-subnet-7aee73db \
--region us-central1

마스터 승인 네트워크 사용 설정

vm 인스턴스 만들기
gcloud compute instances create source-instance --zone us-central1-a --scopes 'https://www.googleapis.com/auth/cloud-platform'

nat ip 확인
gcloud compute instances describe source-instance --zone us-central1-a | grep natIP

natIP: 34.70.56.122

gcloud container clusters update private-cluster \
    --enable-master-authorized-networks \
    --master-authorized-networks 34.70.56.122/32


source-instance 에 SSH 접속
gcloud compute ssh source-instance --zone us-central1-a

kubectl 구성요소 설치
gcloud components install kubectl

(실패할 경우)
sudo apt-get install kubectl

SSH 쉘에서 Kubernetes 클러스터 액세스 권한 설정하기
gcloud container clusters get-credentials private-cluster --zone us-central1-a

클러스터 노드에 외부 IP 주소가 없는지 확인하기
kubectl get nodes --output yaml | grep -A4 addresses

  응답 메세지 중 type 값이 모두 InternalIP, InternalDNS 만 검색 됨

Kubernetes 클러스터 삭제
gcloud container clusters delete private-cluster --zone us-central1-a

사용자 지정 하위 네트워크를 사용하는 비공개 클러스터 만들기

1.하위 네트워크 및 보조 범위 만들기
gcloud compute networks subnets create my-subnet \
    --network default \
    --range 10.0.4.0/22 \
    --enable-private-ip-google-access \
    --region us-central1 \
    --secondary-range my-svc-range=10.0.32.0/20,my-pod-range=10.4.0.0/14


2. 하위 네트워크를 사용하는 비공개 클러스터 만들기
gcloud beta container clusters create private-cluster2 \
    --private-cluster \
    --enable-ip-alias \
    --master-ipv4-cidr 172.16.0.32/28 \
    --subnetwork my-subnet \
    --services-secondary-range-name my-svc-range \
    --cluster-secondary-range-name my-pod-range


3.외부 IP 주소 확인
gcloud compute instances describe source-instance --zone us-central1-a | grep natIP

4.외부IP 주소 적용
gcloud container clusters update private-cluster2 \
    --enable-master-authorized-networks \
    --master-authorized-networks 34.70.56.122/32

5.source-instance 에 SSH 접속
gcloud compute ssh source-instance --zone us-central1-a

6.SSH 쉘에서 Kubernetes 클러스터 액세스 권한 설정
gcloud container clusters get-credentials private-cluster2 --zone us-central1-a

7.클러스터 노드에 외부 IP 주소가 없는지 확인
kubectl get nodes --output yaml | grep -A4 addresses