最近Stable diffusion、AI繪圖很紅,所以我也稍微玩了一下
以下收集了一些prompt詞,以後需要的時候回來查比較快
最近Firefox 升級到 108 之後發現
自訂的游標圖示會顯示錯誤,甚至有時後會直接消失
檢查Log發現是Firefox無法讀取到我的自訂游標
firefox-bin[2959]: Unable to load hand2 from the cursor theme
firefox-bin[2959]: Unable to load left_ptr from the cursor theme
firefox-bin[2959]: Unable to load xterm from the cursor theme
而且是放在~/.icons下的游標才會有這個問題
所以目前有一個Workaround方式就是將目前使用的游標放到
mv ~/.icons/* /usr/share/icons/
目前已經有人發了 Issue 給 Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1802877
最近想用 su - user 對修改 user 的 systemd Unit 的時候發現
systemctl --user
的所有操作都會回報
Failed to connect to bus: No medium found
後來找到了這篇文章
只要將 su - user
改為使用machinectl shell user@.host
就可以正常使用 systemctl --user 了
有些服務 的 web UI 需要執行在網頁的根路徑或特定路徑上
例如 transmission 就需要路徑 /transmission/web/
而 Syncthing 就必須是 / 才能正確打開Web UI
如果直接反向代理的話就會發現有許多圖片或restful api會找不到
我們需要在代理時將多餘的子路徑去除才會正確找到檔案
在Caddy2下可以這麼做
http://myhost.org {
handle_path /syncthing/* {
reverse_proxy http://localhost:8384 {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
}
其中handle_path就會在轉送要求時將 syncthing/ 這個前綴移除
這樣有需要的話還可以在同一個host上代理多個syncthing
例如
http://myhost.org {
handle_path /syncthing/* {
reverse_proxy http://localhost:8384 {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
handle_path /syncthing2/* {
reverse_proxy http://localhost:8385 {
header_up Host {http.reverse_proxy.upstream.hostport}
}
}
}
webView.getSettings().setJavaScriptEnabled(true);
class JsObject { @JavascriptInterface public void alert(String ss) { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle("TestAlert"); builder.setMessage(ss); builder.show(); } }
webView.addJavascriptInterface(new JsObject(), "myjs");
<script> window.myjs.alert("GG"); </script>
openssl genrsa -out ca.key 2048產生配對的公鑰 檔名 ca.crt
openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
Country Name (2 letter code) [AU]:TW //國碼臺灣是 TW State or Province Name (full name) [Some-State]:Taiwan R.O.C //國名臺灣填 Taiwan Locality Name (eg, city) []:Taipei //地名 Organization Name (eg, company) [Internet Widgits Pty Ltd]:FreeBSD Personal Reserach //組織單位名稱 Organizational Unit Name (eg, section) []:FreeBSD Personal Reserach //部門名稱 Common Name (eg, YOUR name) []:www.weithenn.org //憑證的名稱 (通常為伺服器 FQDN) Email Address []:weithenn@weithenn.org //申請單位的聯絡信箱 Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: 按 Enter 直接跳過 //申請書的密碼 An optional company name []: 按 Enter 直接跳過 //憑證代辦公司的名稱
cannot fork: Cannot allocate memory
09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete