2021年7月30日 星期五

[think] 如果你不知道它存在,就不能證明你“需要知道”它

 

can't prove you "need to know" it  if you don't know it exists
如果你不知道它存在,就不能證明你“需要知道”它

370 https://goomics.net/370/



2021年7月29日 星期四

[mac] always on top 置頂視窗 AfloatX

 有在使用 Linux 的 X windows 都會使用的 always on top 把視窗置頂的功能。
Mac的 X windows的使用哲學下,沒有提供相對應功能。除了,使用 Chrome 可以在播放影片的時候,使用 Picture in Picture的功能。

在 mac 中,除了可以使用 

rwu823/afloat: Always on top solution, quickly install Afloat in macOS https://github.com/rwu823/afloat

但是新的版本可能會有相容性問題,
還有另外一個方案可以使用 AfloatX (搭配MacForge使用)

jslegendre/AfloatX: An alternative to Afloat that lives in the dock icon menu https://github.com/jslegendre/AfloatX
"An alternative to Afloat that lives in the dock icon menu"
MacEnhance/MacForge: 📦 Plugin, App, and Theme store which includes plugin injection for macOS https://github.com/MacEnhance/MacForge
"📦 Plugin, App, and Theme store which includes plugin injection for macOS"
安裝 MacForge 步驟如下,要注意到  recovery mode 去 Disable System Integrity Protection
Open MacForge and allow it to install helper tools
Disable System Integrity Protection
Open Terminal.app and run the command
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool true
Boot to recovery mode by rebooting and holding down ⌘ + R
Open the Terminal from the menubar and run the command
csrutil enable --without debug --without fs
Reboot



除了可以置頂以外還可以設置透明度



2021年7月28日 星期三

使用 Google Outline VPN 建立 VPN

使用 Google Outline VPN 建立 VPN

Outline VPN - 存取自由開放的網際網路 https://getoutline.org/zh-TW/
"Outline 可讓任何人建立和執行自己專屬的 VPN,以及分享 VPN 的存取權。由於經過特殊設計,Outline 可防禦封鎖機制,並讓你控制自己的伺服器設定,包含伺服器的所在位置。Outline 採用公開透明的技術及完整開放原始碼,而且經由兩家安全性機構進行稽核,可確保這款軟體採用最新技術且安全無虞。"

Google Outline VPN是爲了讓新聞從業人員使用的一個開放原始計劃,透過他可以方便管理與安裝 VPN。

如果有台 server可以提供安裝 outline-server

sudo bash -c "$(wget -qO- https://raw.githubusercontent.com/Jigsaw-Code/outline-server/master/src/server_manager/install_scripts/install_server.sh)"

> Verifying that Docker is installed .......... NOT INSTALLED
> Would you like to install Docker? This will run 'curl https://get.docker.com/ | sh'. [Y/n]
> Installing Docker ........................... OK
> Verifying Docker installation OK
............... > Verifying that Docker daemon is running ..... OK
> Setting PUBLIC_HOSTNAME to external IP ...... OK
> Creating persistent state dir ............... OK
> Generating secret key ....................... OK
> Generating TLS certificate .................. OK
> Generating SHA-256 certificate fingerprint .. OK
> Writing config .............................. OK
> Starting Shadowbox .......................... OK
> Starting Watchtower ......................... OK
> Waiting for Outline server to be healthy .... OK
> Creating first user ......................... OK
> Adding API URL to config .................... OK
> Checking host firewall ...................... BLOCKED
CONGRATULATIONS! Your Outline server is up and running.

To manage your Outline server, please copy the following line (including curly
brackets) into Step 2 of the Outline Manager interface:

{"apiUrl":"https://111111:39299/DAJsfdfaf33A","certSha256":""}

You won’t be able to access it externally, despite your server being correctly
set up, because there's a firewall (in this machine, your router or cloud
provider) that is preventing incoming connections to ports 59299 and 26780.

Make sure to open the following ports on your firewall, router or cloud provider:
- Management port 39290, for TCP
- Access key port 22780, for TCP and UDP

記得設定firewall開放必須要開放的port

sudo iptables -I INPUT -p tcp -m tcp --dport 26780 -j ACCEPT
sudo iptables -I INPUT -p udp -m udp --dport 22780 -j ACCEPT
sudo iptables -I INPUT -p tcp -m tcp --dport 39299 -j ACCEPT
sudo netfilter-persistent save
sudo netfilter-persistent reload

安裝完後把獲得的設置貼到manager上
{"apiUrl":"https://111111:39299/DAJsfdfaf33A","certSha256":""}

把code從管理界面分享過去相對應的client裝上軟體後,就可以使用了,還可以設定流量。
  



[mind] 少獲得的困擾

 

面對少獲得的痛苦,或許是比好不容易獲得比較少還要糾結。
舉股票交易來說,如果成本在52,然後高點曾經出現在60,後來,再回回去 53,雖然賬面上是有獲利的,但是惋惜的是,(60-52=8) 的躊躇。

為何對運動選手來說,得銅牌的感覺可能比得銀牌還爽 - PanSci 泛科學 https://pansci.asia/archives/23805

"2006年舊金山州立大學的心理學家 David Matsumoto 與世界柔道雜誌的 Bob Willingham 也針對了2004年希臘雅典奧運的柔道比賽進行類似的研究,共蒐集了來自35個國家的84名運動員在以下3個時刻的資料:比賽一結束、獲授獎牌時、還有站上頒獎台上時。有趣的調查結果是,他們發現14位金牌得主中,13位在決賽結束後馬上露出笑容,26位銅牌得主中也有18位在確定勝出後展開笑顏,但沒有一個銀牌得主在輸掉決賽之後還笑得出來(這也蠻合理的)。

儘管不久後的頒獎典禮上,大部份(96.4%)的人站上了頒獎台還是都露出了微笑,但仔細分析他們的笑容,還是發現銀牌得主的笑容比較不真誠,有點勉強。"

《交易心態原理》:「原賦效應」與「損失趨避」是本能,不會因為經驗增長而減少 - The News Lens 關鍵評論網 https://www.thenewslens.com/article/124087


2021年7月27日 星期二

github Your account has been flagged.


Your account has been flagged.

Because of that, your profile is hidden from the public. If you believe this is a mistake, contact support to have your account status reviewed. 

GitHub Terms of Service - GitHub Docs https://docs.github.com/en/github/site-policy/github-terms-of-service#3-account-requirements"One person or legal entity may maintain no more than one free Account (if you choose to control a machine account as well, that's fine, but it can only be used for running a machine)."

Types of GitHub accounts - GitHub Docs https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts

如果使用同一個email ,也就只能有一個public的 github account

2021年7月16日 星期五

ValueError: I/O operation python diskcache

 
ValueError: I/O operation on closed file · Issue #139 · grantjenks/python-diskcache https://github.com/grantjenks/python-diskcache/issues/139

"I have not had a chance to run it myself but it looks like it errors on pickle. Pickle is Python’s built-in serialization library. DiskCache isn’t doing any IO on the line that throws the exception. So my guess is that the data returned by feedparser has a file handle reference (perhaps through lxml). File handles cannot be serialized, therefore it errors."


2021年7月12日 星期一

Google drive docs Sheets api limits


Google drive docs Sheets  api limits

Google Drive API

Queries per 100 seconds 10,000

Queries per 100 seconds per user 10,000

Queries per day 1,000,000,000


Google Docs API

Quota group for read operations per minute 3000

Quota group for read operations per minute per user 300

Quota group for write operations per minute 600

Quota group for write operations per minute per user 60


Google Sheets API

Write requests per minute 300

Write requests per minute per user 60

Read requests per minute 300

Read requests per minute per user 60