發表文章

捐血被拒絕

圖片
今天去捐血結果被拒絕,因為今年五月底才從印度回台,被捐血中心的人說:印度回來的人一年內不能捐血,,,因為印度是瘧疾疫區. 雖然不能捐血,但想想捐血中心這樣管控也是正確的,畢竟捐血是為了救人而不是傳染疾病. 常出國又有捐血習慣的人可以加入捐血中心的line帳號“ 愛捐血 ”, 它會回答你有關捐血的問題

It is required that your private key files are NOT accessible by others. This private key will be ignored.

mac os 最近連接aws發生了這個錯誤: It is required that your private key files are NOT accessible by others. This private key will be ignored. 後來下了這指令解決 sudo chmod 600 xxx.pem 參考

佛教聖地參訪

圖片
闊別11年再臨印度, 上次到印度是2006年的時候, 想不到再次來竟然過了11年了 菩提迦耶 大菩提寺 王舍城 靈鳩山 說法台                                                           那爛陀寺 博物館佛像 本次旅行法喜充滿喔!

ssl憑證nginx 設定

首先建一個目錄 sudo mkdir /etc/nginx/ssl 進入目錄 cd /etc/nginx/ssl 產生 myserver.key和 server.csr sudo openssl req -nodes -newkey rsa:2048 -sha256 -keyout myserver.key -out server.csr 產生後上傳到有簽發ssl憑證的域名商 上傳後等待域名商 安全憑證簽發 簽發後下載 xxx.pem 和 yyy.crt 到  /etc/nginx/ssl xxx 或 yyy名稱可以看自己喜歡取名, 只要記得設定   nginx 時名稱路徑要對上 然後設定 nginx sudo vi /etc/nginx/sites-enabled/nginxsetupfile server {     listen   80; ## listen for ipv4; this line is default and implied     #listen   [::]:80 default ipv6only=on; ## listen for ipv6     rewrite ^(.*) https://$host$1 permanent; }      server {     listen 443 ssl;     server_name cclin.xyz;     access_log /var/log/nginx/mysite-access.log ;     error_log /var/log/nginx/mysite-error.log ;          location /static {         alias /home/for/static/path/static;     } ...

javascript regex

regex這東西不常用, 每次用都要google老半天. 這次是因為輸入的文字會變成url slug, 所以必須使javascript做出如果是非文字都不能輸入(包括標點或空格) <h1>Create a Thing</h1> <form role="form" action="" method="post" enctype="multipart/form-data"> <input type='hidden' name='csrfmiddlewaretoken' value='CiTMjJgFuTMRatFsQRBUT6z8JuyRhe2g' /> <p><label for="id_name">Name:</label> <input id="id_name" maxlength="255" name="name" type="text" /></p> <p><label for="id_image">Image:</label> <input id="id_image" name="image" type="file" /></p> <p><label for="id_description">Description:</label> <textarea cols="40" id="id_description" name="description" rows="10"> </textarea></p>  <input type="submit"  value="Sub...

line 1: Bad configuration option: useroaming

最近要用ssh連接aws ubuntu server突然發現一個問題 $ ssh -i "xxx.pem" ubuntu@xxx.xxx.xxx.com /Users/korekyourin/.ssh/config: line 1: Bad configuration option: useroaming /Users/korekyourin/.ssh/config: terminating, 1 bad configuration options 這時必須進入/Users/korekyourin/.ssh/config 把useroaming註解掉 vi /Users/korekyourin/.ssh/config UseRoaming no 註解掉,變成 #UseRoaming no 這樣ssh到server 才能成功 參考

python3 的lambda

bank.py class Account:     def __init__(self, name, number, balance):         self.__name = name         self.__number = number         self.__balance = balance     @property     def name(self):         return self.__name     @property     def number(self):         return self.__number     @property     def balance(self):         return self.__balance     def deposit(self, amount):         if amount <= 0:             print('存款金額不得為負')         else:             self.__balance += amount     def withdraw(self, amount):         if amount > self.__balance:             print('餘額不足')       ...