Skip to content

Zeroplex 生活隨筆

軟體開發、伺服器和生活瑣事

小 縮小字型大小。 中 重設字型大小。 大 放大字型大小。

作者: 日落

GIF 動畫轉 webp 的效果不差

Posted on 2022 年 2 月 3 日2022 年 2 月 3 日 By 日落 在〈GIF 動畫轉 webp 的效果不差〉中尚無留言

嘗試將網路上的長篇 GIF 動畫轉成 webp 效果還不錯,轉成 webp 以後大小剩下 10%,但是視覺上看不出明顯差異。縮短圖片載入時間,但在小螢幕上看不出差別,這應該就是 webp 的初衷吧。

由於 webp 程式一個還在發展當中的技術,所以前些時間使用 PHP 轉 webp 的作法,尚不支援 GIF 動畫,必須去下載 webp latest build 改用 exec() 呼叫原生程式轉檔才會有用。

以下把顯示 GIF 和 webp 並列比較,二張圖中間增加一些空間避免眼花。

More “GIF 動畫轉 webp 的效果不差” »

Tags:網路架站

PostgreSQL 繁體中文文件

Posted on 2022 年 1 月 26 日2022 年 1 月 26 日 By 日落 在〈PostgreSQL 繁體中文文件〉中尚無留言

以前找資料的時候都是英文文件,現在意外發現已經有社群建立繁體中文的文件,這樣查資料速度會快一些。

文件連結:簡介 – PostgreSQL 正體中文使用手冊

Tags:PostgreSQL

Ubuntu 20.04 Failed to Change Password while Using cloud-init

Posted on 2022 年 1 月 22 日2022 年 2 月 22 日 By 日落 在〈Ubuntu 20.04 Failed to Change Password while Using cloud-init〉中尚無留言

Cloud-Init should allow you to modify password after first time login. But if SSH closed while changing password:

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for ubuntu.
Current password:
passwd: Authentication token manipulation error
passwd: password unchanged
Connection to 192.168.0.102 closed.

There might be Cloud-Init issue in older version.

There is a workaround to by-pass force passwd. Find /boot/firmware/user-data in the boot partition, then you will see options:

# On first boot, set the (default) ubuntu user's password to "ubuntu" and
# expire user passwords
chpasswd:
  expire: true
  list:
  - ubuntu:ubuntu

Update expire to false if you do not want to change password in first login. Or create your own username/password in list if expire is not work.

Please notice that device is not safe using default user name and password. Change it after you connect to the device.

Tags:Linux, Raspberry Pi, Ubuntu

Google Chrome 大量使用 CPU 運算資源

Posted on 2022 年 1 月 16 日2022 年 1 月 16 日 By 日落 在〈Google Chrome 大量使用 CPU 運算資源〉中尚無留言

近期注意到 Google Chrome 瀏覽器大量使用 CPU,但即使將分頁關閉也沒辦法降低 CPU 使用量。後來看到暗黑執行緒提到是 Chrome 在掃描惡意程式。開 monitor 確認有大量 disk I/O 且防毒軟體也跟著在跑,照著說明設定後問題確認解決。

先開啟瀏覽器「設定 => 重設與清理 => 清理電腦」(或輸入網址 chrome://settings/cleanup 開啟設定頁面),會看到 Google Chrome 支援「尋找有害軟體」的功能,此功能會掃描電腦上潛在的惡意程式,因此會造成電腦很卡:

取消勾選此功能,再重新啟動 Google Chrome 應可改善問題。

若上面步驟仍無法解決問題,則需手動修改 Google Chrome 掃描工具坔執行檔名稱 (建議備份)。使用檔案總管開啟路徑:

C:\Users\{{使用者名稱}}\AppData\Local\Google\Chrome\User Data\SwReporter\{{版本號碼}}\

開啟資料夾後會看到執行檔 software_reporter_tool.exe,更改檔案名稱即可。

備註:不管使用上述掃描工具、防毒軟體或 Windows 內建的惡意程式掃描工具,請確保最少有一項工具執行偵測,以免造成更大損失。

Tags:瀏覽器

SSH 發送指令至遠端主機發生 terminal error

Posted on 2022 年 1 月 14 日2022 年 1 月 14 日 By 日落 在〈SSH 發送指令至遠端主機發生 terminal error〉中尚無留言

若不想開啟 teminal 而只想透過 SSH 擷取 remote server 的指令執行結果,可以直接這樣做:

ssh user@your.domain \
    ls /var/run/reboot*

不過有些指令會使用 TTY 繪製圖形、顯示特定格式,這時就會出現錯誤訊息:

Error opening terminal: unknown.

例如我在 remote server 執行 watch 指令就會遇到這個錯誤。

已知可以透過參數 -t 來解決這個問題:

ssh -t user@your.domain \
    watch -n 2 tail /var/log/kern.log
Tags:Linux

文章分頁

上一頁 1 ... 44 45 46 ... 318 下一頁

其他

關於我  (About me)

  文章 RSS Feed

  留言 RSS Feed

Apache AWS Bash C/C++ Docker FreeBSD GCP Git Google Java JavaScript Laravel Linux Microsoft MSSQL MySQL Nginx PHP PHPUnit PostgreSQL Python Qt Ubuntu Unix Vim Web Windows WordPress XD 作業系統 分享 好站推薦 專題 攝影 新奇搞笑 新聞 旅遊 生活雜記 程式設計 網路架站 網頁設計 資訊學習 資訊安全 遊戲 音樂


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款授權.