[java][mysql] com.mysql.cj.exceptions.DataReadException: Zero date value prohibited


讀取資料庫裡的 timestamp 欄位有 '0000-00-00 00-00-00'

改成不是 '0000-00-00 00-00-00' 後就正常了

[ubuntu] set timezone


sudo dpkg-reconfigure tzdata

[let's encrypt] apply cert


sudo apt-get install nginx


sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx


sudo mkdir /var/www/www.test.com


設定 domain 底下的 .well-known 目錄以讓 certbot 可以順利申請憑證
sudo vi /etc/nginx/sites-available/www.test.com
server {
    listen 80;
    listen [::]:80;
    server_name www.test.com;

    location /.well-known {
        alias /var/www/www.test.com/.well-known;
    }
}
sudo ln -s /etc/nginx/sites-available/www.test.com /etc/nginx/sites-enabled/www.test.com


sudo service nginx restart


須確保 80 443 port 有開,確認防火牆容許這些 port 開放 


sudo certbot --nginx -d www.test.com


依據不同的選項就會自動更改 nginx 設定


憑證鍊會產生在以下位置
/etc/letsencrypt/live/www.test.com/fullchain.pem


額外設定,可以讓 SSL 安全性通過評價網站變成 A 級安全網站
Updating Diffie-Hellman Parameters


sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048


sudo vi /etc/nginx/sites-available/www.test.com


ssl_dhparam /etc/ssl/certs/dhparam.pem;


sudo nginx -t
sudo service nginx reload


設定憑證自動更新
sudo crontab -e


15 3 * * * /usr/bin/certbot renew --quiet --renew-hook "service nginx reload"


參考:


安全性檢查:


[sqlalchemy] code gen


pip install sqlacodegen

sqlacodegen mysql://{USERNAME}:{PASSWORD}@{IP}/{SCHEMA}

[ip] Finding external IP using external services


curl ifconfig.me

[wsl] The Windows Subsystem for Linux optional component is not enabled. Please enable it and try again.


Your Windows Subsystem for Linux (WSL) is not turned on. To turn on open PowerShell as Administrator and run the following command:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

[netbeans] Compile on Save


At latest NB 10 and 11 you may see the warning It is recommended to install nb-javac Library to improve Java editing experience and enable compile on save at Notifications section:

[spring boot] exec class main in spring boot jar file


java -cp app.jar -Dloader.main=com.test.util.service.adsensehost.ClientService org.springframework.boot.loader.PropertiesLauncher

[docker] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project automation: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect -> [Help 1]


Open docker Settings

check "Expose daemon on tcp://localhost:2375 without TLS"

[docker] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project automation: Exception caught: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) -> [Help 1]


Open docker Settings

Network
DNS Server
set "Fixed"



[airflow] Tasks using non-existent pool 'default_pool' will not be scheduled


export AIRFLOW_HOME="$(pwd)"

airflow pool -s default_pool 128 'default pool'