Let it be

Thursday, October 22, 2026

研究院路二段漏水

 漏水追蹤:

11/6:

      





11/1: 7:00AM




10/30, 6:42 PM

                      


10/29, 8:04 AM

                    


10/27, 8:52 AM

         


10/26, 10:46 AM

   


10/25: 8:54 AM



10/24: 下午 2:57 PM



10/23: 早上觀察



10/21 施工:


10/20 之前:

滴水造成地上積水

















Thursday, April 09, 2026

 ftp a cl program to AS/400 via data transfer to IBM i

1. 

2.

Saturday, January 20, 2024

 

Python Collections (Arrays)


List:  list =["mango", "strawberry", "orange","apple", "banana"]
 

Array a = arr.array('i', [1, 2, 3])

tuple = ("orange","apple","banana")

set : thisset = {"apple", "orange", "banana"}

dictionary : thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964  }


Python Collections (Arrays)

There are four collection data types in the Python programming language:

  • List is a collection which is ordered and changeable. Allows duplicate members.
  • Tuple is a collection which is ordered and unchangeable. Allows duplicate members.
  • Set is a collection which is unordered, unchangeable*, and unindexed. No duplicate members.
  • Dictionary is a collection which is ordered** and changeable. No duplicate members.


Friday, January 12, 2024

Run cron schedule job on Github Actions



1. Create a project at Github

2. Create your all python programs at this project, or import your python programs

3. Creaet a new .github folder(P.S. there's a "." period prefix )

4. At .github folder, create a yaml file

5. After press "Commit Change", the cron job will run on your schedule.

(P.S. the time is based on UTC time zone)


yaml sample file

name: Github crontab action demo

on:

  schedule:

    - cron: '0 6,21 * * *'

jobs: 

  Explorer-Github-Actions:

    runs-on: ubuntu-latest

    steps:

      - name: Checkout

        uses: actions/checkout@v4

      - name: Setup Python Version

        uses: actions/setup-python@v2

        with:

          python-version: 3.11 # Install the python version needed


      - name: Install Python dependencies

        run: pip install -r requirements.txt

      - name: get stock price

        run:

          python3 dyudaily.py

      - name: List files on the folder 002

        run:

          ls ${{ github.workspace }}




Wednesday, December 27, 2023

Use Python to send daily stock price to you

使用 python 每天早上送 股價 email 給你

https://github.com/davidyuibm/dailystock.git

Labels:

Thursday, February 23, 2023

 Linux: https://www.freecodecamp.org/news/introduction-to-linux/

Monday, February 20, 2023

Kubernetes

1. https://minikube.sigs.k8s.io/docs/start/: install minikube

2. Need to download & install docker desktop for Mac : https://docs.docker.com/desktop/install/mac-install/

3. To start minikube : minikube start

4.  kubectl exec -ti $POD_NAME -- bash

5. kubectl exec -it hello-node-57c8dd9df8-pvtj8 curl localhost:8080

6.apt-get update

apt-get install net-tools



curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/k8s.gpg


curl https://download.webmin.com/jcameron-key.asc | gpg --dearmor | sudo tee /usr/share/keyrings/jcameron-key.gpg > /dev/null 2>&1 


 apt install -y curl gnupg2 software-properties-common apt-transport-https ca-certificates 

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 


https://upcloud.com/resources/tutorials/install-kubernetes-cluster-centos-8


To connect external internet: kubectl proxy

 curl http://localhost:8001/version


export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')

curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/     


kubectl run hello-world --image us.icr.io/$MY_NAMESPACE/hello-world:1 --overrides='{"spec":{"template":{"spec":{"imagePullSecrets":[{"name":"icr"}]}}}}'


kubectl config get-contexts



Minikube:

Docker Desktop networking doesn't support ports. You will have to use minikube tunnel


minikube start --driver=docker --extra-config=apiserver.service-node-port-range=32760-32767 --ports=127.0.0.1:32760-32767:32760-32767


minikube start --ports=port-target:node-port

for eg; minikube start --ports=30390:30390



Enter container : kubectl exec -it $POD_NAME -- bash


System namespace pods:

kubectl get po -n kube-system


minikube start --driver=docker


export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.49.0/24,192.168.39.0/24



Question: how to setup service

  1. Kubectl proxy
  2. kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
  3. kubectl   port-forward.  kubernetes-demo-pod 3000:3000


$ minikube service my-deployment-service --url

http://192.168.99.100:30390


Test curl working or not:

$ kubectl run -i --tty alpine --image=alpine --restart=Never -- sh



To start using your cluster, you need to run the following as a regular user:


  mkdir -p $HOME/.kube

  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

  sudo chown $(id -u):$(id -g) $HOME/.kube/config


Alternatively, if you are the root user, you can run:


  export KUBECONFIG=/etc/kubernetes/admin.conf


kubectl expose deployment hello-world --type=LoadBalancer --name=my-service


kubectl port-forward kubernetes-dashboard-7798c48646-ctrtl 8443:8443 --namespace=kube-system


Dashboard setup:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml


Kubectl proxy


http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/



https://securitybank.atlassian.net/wiki/spaces/ODP/overview

kubectl port-forward pod/foo 8080:8080


kubectl apply -f pod.yaml,service.yaml

kubectl  delete  -f pod.yaml,service.yaml


kubectl run -i --tty alpine --image=alpine --restart=Never -- sh



kubectl create -f pod.yaml 


curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"

Https://dl.k8s.io/release/$(v1.26.3)/bin/darwin/arm64/kubectl



db.createUser({ user:'admin',pwd:'123456',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},"readWriteAnyDatabase"]});




docker run --name=mk-mysql -p3306:3306 -v mysql-volume:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql/mysql-server:8.0.20


GRANT ALL PRIVILEGES ON database_name.* TO ‘root’@’172.17.0.2’;


docker run \

  --name jenkins-docker \

  --detach \

  --privileged \

  --network jenkins \

  --network-alias docker \

  --env DOCKER_TLS_CERTDIR=/certs \

  --volume jenkins-docker-certs:/certs/client \

  --volume jenkins-data:/var/jenkins_home \

  --publish 2376:2376 \

  --publish 3000:3000 --publish 5000:5000 \

  --restart=on-failure \

  docker:dind \

  --storage-driver overlay2 




docker run \

  --name jenkins-blueocean \

  --detach \

  --network jenkins \

  --env DOCKER_HOST=tcp://docker:2376 \

  --env DOCKER_CERT_PATH=/certs/client \

  --env DOCKER_TLS_VERIFY=1 \

  --publish 8080:8080 \

  --publish 50000:50000 \

  --volume jenkins-data:/var/jenkins_home \

  --volume jenkins-docker-certs:/certs/client:ro \

  --volume "$HOME":/home \

  --volume /var/run/docker.sock:/var/run/docker.sock \

  --restart=on-failure \

  --env JAVA_OPTS="-Dhudson.plugins.git.GitSCM.ALLOW_LOCAL_CHECKOUT=true" \

  myjenkins-blueocean:2.375.2-1 









OpenShift

To login : oc login -u admin -p admin https://api.crc.testing:6443 --insecure-skip-tls-verify=true


export POD_NAMe=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')




How to setup Kubernetes cluster in Ubuntu 20.04

1. For my machine, i need to add 3 lines to my .bashrc

export KUBECONFIG=/etc/kubernetes/admin.conf

swapoff -a

ufw disable

P.S. otherwise will always receive : kubectl connection refused, did you specify the right host or port


 Learn Kubernetes: https://kubernetes.io/docs/tutorials/kubernetes-basics/

Minikube: https://minikube.sigs.k8s.io/docs/

Docker playground: https://labs.play-with-docker.com/

Youtube kubernetes: https://www.youtube.com/watch?v=X48VuDVv0do&t=2273s

Docker images repository: https://hub.docker.com/search?q=

Lab for Kubernetes : https://collabnix.github.io/kubelabs/kube101.html

                                  https://killercoda.com/playgrounds/scenario/kubernetes

Kubernetes classroom : https://training.play-with-kubernetes.com/kubernetes-workshop/