Linux環境下,安裝instaloader,出現error: externally-managed-environment

Linux環境下,安裝instaloader,出現error: externally-managed-environment

為了要省電,抓圖改用Linux平台執行,所以需在Linux VM中安裝python使用的instaloader,但是安裝時,出現下面的錯誤

sudo pip3 install instaloader
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.

See /usr/share/doc/python3.12/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing –break-system-packages.
hint: See PEP 668 for the detailed specification.

解法 如下
sudo apt install python3-requests
sudo apt install python3-venv
python3 -m venv .venv
source .venv/bin/activate

再執行一次安裝指令,就可以正常安裝了
sudo pip3 install instaloader

放棄PhotoPrism 改用 immich

放棄PhotoPrism 改用 immich

PhotoPrism相簿系統中,有一些功能沒有,而immich有,而且PhotoPrism操作,不如immich直接。所以,我就把PhotoPrism移掉,改用immich
一樣,是使用Docker Compose

name: immich

services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# extends:
#   file: hwaccel.transcoding.yml
#   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
– ${UPLOAD_LOCATION}:/usr/src/app/upload
– /etc/localtime:/etc/localtime:ro
env_file:
– .env
ports:
– ‘2283:2283’
depends_on:
– redis
– database
restart: always
healthcheck:
disable: false

immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# extends: # uncomment this section for hardware acceleration – see https://immich.app/docs/features/ml-hardware-acceleration
#   file: hwaccel.ml.yml
#   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference – use the `-wsl` version for WSL2 where applicable
volumes:
– model-cache:/cache
env_file:
– .env
restart: always
healthcheck:
disable: false

redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
healthcheck:
test: redis-cli ping || exit 1
restart: always

database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: ‘–data-checksums’
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
– ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready –dbname=’${DB_DATABASE_NAME}’ –username=’${DB_USERNAME}’ || exit 1; Chksum=”$$(psql –dbname=’${DB_DATABASE_NAME}’ –username=’${DB_USERNAME}’ –tuples-only –no-align –command=’SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database’)”; echo “checksum failure count is $$Chksum”; [ “$$Chksum” = ‘0’ ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command:
[
‘postgres’,
‘-c’,
‘shared_preload_libraries=vectors.so’,
‘-c’,
‘search_path=”$$user”, public, vectors’,
‘-c’,
‘logging_collector=on’,
‘-c’,
‘max_wal_size=2GB’,
‘-c’,
‘shared_buffers=512MB’,
‘-c’,
‘wal_compression=on’,
]
restart: always

volumes:
model-cache:

—-
環境變數要加外建 .env
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like “v1.71.0”
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

inatagram 單篇 用 instaloader 抓不了

inatagram 單篇 用 instaloader 抓不了

這個官網上有說了,instagram API變更。

我查了新的API,有改寫方法,可以單篇抓照片了。
但是,人生中就是這麼多但是,IG一直回報是機器人行動。
我每抓一篇都等待30~45秒,跟instaloader官方建議的一樣了,還是時不是卡我一下

Read more
科賦 KLEVV SSD 送修 一整個爛掉

科賦 KLEVV SSD 送修 一整個爛掉

1.去科賦官網留言,超過4個工作天,沒有回。
2.去代理商富基電通留言,網站錯誤,信沒有發出去

只能打電話去,服務人員才跟你說處理方式
我是Pchome買的,我確定保內,所以,我才想說送修
KLEVV NEO N400災情有多嚴重我就不說了

聯絡方式如下,拿去不用謝。

台北市南港區南港路三段50巷6號4樓
富基電通收
附聯絡方式

20241025 已送去富基電通10個日曆天了,理論上2天去2天回,早就該回來了。所以我打電話去富基電通,確認有收到,回收去科賦原廠了,要我再耐心等。我是保內,沒有明顯外部損段,保固標籤也還在,不是應該快點出保給我RMA,呵呵,一試就再也不敢用科賦的產品。

20241028 接到富基電通電話 N400沒有了,要換其他型號,結果要換的是威剛的480G型號,查了一樣,這顆的災情和科賦的情況差不多,弄不好,根本就不知道是誰貼誰的牌。不想等了,接受拿回來操到壞掉丟垃圾桶,再把科科和微鋼放到黑名單中。

原來 批量管理 wordpress 比想像中的簡單

原來 批量管理 wordpress 比想像中的簡單

wordpress 更新的速度,真的快,畢竟全球麼多人在用,駭客也在盯這塊,光是我自己的wordpress,就被跑進來駭了好幾次。

wordpress 可以更新的東西很多,主體,插件,佈景和與言包等等。

之前都是土法煉鋼去更新一個wordpress,再用shell指令去更新 Read more

google 官方的 WordPress AMP會影響我的外掛運作

google 官方的 WordPress AMP會影響我的外掛運作

執行了AMP之後,我的佈景主題和我的外掛,無法通過AMP的測試。目前佈景主題用的是社群的版本。

其次,被說不相容的這個wordpress外掛是我寫的,功能很簡單,就是開網站時,會檢查有沒有指定Cookie,再檢查Cookie值
沒有這個值,就不給用網站。
中間有2個按鈕,一個按下產生Cookie和直,一個按下就離開
這個外掛其實就是18歲年紀限制

原本都正常,但是執行AMP之後,2個按鈕都失效了。
(關了AMP,按鈕就正常了)
我想找其他的plugin來試試,如果有進行消息,再更新

補充說明一下,知名的wordpress 編輯套 Elementor也被偵測到無法通過相容性。執行了AMP,有種自廢武功的即視感。

PhotoPrism + MariaDB Docker Compose

PhotoPrism + MariaDB Docker Compose

PhotoPrism使用Docker可以快速部署,我自已是用Openmediavault compose套件

PhotoPrism官方並沒有整合MariaDB或是MySQL,OMV為了要隔離OS與APP的關係,所以我做了下面這個整合的 PhotoPrism+MariaDB Compos

services:
  photoprism:
    image: photoprism/photoprism:latest
    stop_grace_period: 10s
    depends_on:
      – mariadb
    security_opt:
      – seccomp:unconfined
      – apparmor:unconfined
    ports:
      – “2342:2342”
    environment:
      PHOTOPRISM_ADMIN_USER: “admin”
      PHOTOPRISM_ADMIN_PASSWORD: “insecure”
      PHOTOPRISM_AUTH_MODE: “password”
      PHOTOPRISM_SITE_URL: “http://localhost:2342/”
      PHOTOPRISM_DISABLE_TLS: “false”
      PHOTOPRISM_DEFAULT_TLS: “true”
      PHOTOPRISM_ORIGINALS_LIMIT: 5000
      PHOTOPRISM_HTTP_COMPRESSION: “gzip”
      PHOTOPRISM_LOG_LEVEL: “info”
      PHOTOPRISM_DATABASE_DRIVER: “mysql”
      PHOTOPRISM_DATABASE_SERVER: “mariadb:3306”
      PHOTOPRISM_DATABASE_NAME: “photoprism”
      PHOTOPRISM_DATABASE_USER: “photoprism”
      PHOTOPRISM_DATABASE_PASSWORD: “insecure”
      PHOTOPRISM_SITE_CAPTION: “AI-Powered Photos App”
    working_dir: “/photoprism”
    volumes:
      – “~/Pictures:/photoprism/originals”
      – “./storage:/photoprism/storage”

  mariadb:
    image: mariadb:11
    restart: unless-stopped
    stop_grace_period: 5s
    security_opt:
      – seccomp:unconfined
      – apparmor:unconfined
    command: –innodb-buffer-pool-size=512M –transaction-isolation=READ-COMMITTED –character-set-server=utf8mb4 –collation-server=utf8mb4_unicode_ci –max-connections=512 –innodb-rollback-on-timeout=OFF –innodb-lock-wait-timeout=120
    volumes:
      – “./database:/var/lib/mysql”
    environment:
      MARIADB_AUTO_UPGRADE: “1”
      MARIADB_INITDB_SKIP_TZINFO: “1”
      MARIADB_DATABASE: “photoprism”
      MARIADB_USER: “photoprism”
      MARIADB_PASSWORD: “insecure”
      MARIADB_ROOT_PASSWORD: “insecure”

  watchtower:
    restart: unless-stopped
    image: containrrr/watchtower
    profiles: [“update”]
    environment:
      WATCHTOWER_CLEANUP: “true”
      WATCHTOWER_POLL_INTERVAL: 7200
    volumes:
      – “/var/run/docker.sock:/var/run/docker.sock”
      – “~/.docker/config.json:/config.json” # optional, for authentication if needed

需修改的部份
      PHOTOPRISM_ADMIN_PASSWORD: “insecure”
修改 photoprism web界面 admin 帳號的預設密碼

      PHOTOPRISM_DATABASE_NAME: “photoprism”
      PHOTOPRISM_DATABASE_USER: “photoprism”
      PHOTOPRISM_DATABASE_PASSWORD: “insecure”
修改 連接 Mariadb 的資料庫、使用者、密碼

    volumes:
      – “~/Pictures:/photoprism/originals”
修改 圖片存放的路徑
      – “./storage:/photoprism/storage”
修改 快取等資料的路徑

      MARIADB_DATABASE: “photoprism”
      MARIADB_USER: “photoprism”
      MARIADB_PASSWORD: “insecure”
      MARIADB_ROOT_PASSWORD: “insecure”
MariaDB的資料庫/使用者/密碼/Root的密碼


選擇性修改的部份
photoprism對外的連接port
    ports:
      – “2342:2342”