MoreRSS

site iconShinChvenModify

A full-stack TypeScript/JavaScript web developer, and also build mobile apps.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of ShinChven

How to Buy Kingdom of Heaven Director's Cut in 4K on iTunes

2025-06-22 07:27:35

Kingdom of Heaven Director's Cut 4K on iTunes

Buying Ridley Scott's definitive version of Kingdom of Heaven in 4K on iTunes isn't as obvious as it should be. The storefront shows the standard theatrical cut in HD by default, and there's no separate listing labeled "Director's Cut 4K." Here's the quick path to the version you actually want.

Why This Matters

The Director's Cut restores nearly 45 minutes of material and is the only 4K rendition currently available on iTunes. If you simply hit "Buy" on the main page, you'll end up with the shorter HD theatrical cut. Follow the steps below to unlock the full‑length 4K edition.

Step‑by‑Step Guide

  1. Open the Apple TV app (or iTunes on Windows) and make sure you're signed in with the Apple ID you'll use for the purchase.
  2. Search for "Kingdom of Heaven." Select the movie result featuring Orlando Bloom in the teal‑blue poster art.
  3. On the movie's detail page, you'll notice the runtime listed as ~144 minutes (the theatrical cut) and the format as HD—nothing about 4K yet. Don't worry.
  4. Scroll down until you find the "How to Watch" section. It usually sits below the cast list and related movies.
  5. In that section, you'll see a line that says something like "2 Versions." Tap to expand it.
  6. Now you'll see two choices:
  • Kingdom of Heaven (Theatrical)
  • Kingdom of Heaven (Director's Cut)
  1. Select the Director's Cut entry and then hit Buy.
  2. After purchase, the 4K Director's Cut will appear in your library. Your Apple TV devices will automatically stream or download the 4K Director's Cut when you play it, provided you have a 4K‑capable display and bandwidth.

Extra Tips

  • Check your region. Availability can vary; if you don't see the 4K label, the Director's Cut may not be licensed in your country yet.
  • Hardware matters. An Apple TV 4K box or a recent 4K‑capable iPhone/iPad/Mac is required to view 4K HDR and Dolby Atmos streams on compatible displays.
  • Storage hint. Downloading the film to an iPhone or iPad saves the HD version; iOS still streams 4K only. For true 4K offline viewing, use the Apple TV app on macOS and transfer via AirPlay.
  • iTunes Extras available. iTunes Extras is available for this title after you purchased it, providing additional behind-the-scenes content and special features.

Final Word

Apple's storefront doesn't shout about it, but the Director's Cut tucked under "How to Watch" is the version to own—both for its richer cut and for its gorgeous 4K transfer with HDR and Atmos. Follow the steps above and you'll be crossing swords in high resolution in no time. Enjoy the journey to Jerusalem!

Fixing 403 Errors When Accessing Archive Packages via CI JOB TOKEN in GitLab 18

2025-06-17 22:32:11

If your GitLab CI pipeline started throwing 403 Forbidden errors when trying to access archive packages using the CI_JOB_TOKEN, you're likely running into a security change that became enforced by default in GitLab 18.

This isn’t a brand-new feature—but now, you’re required to explicitly configure access permissions, or your jobs will fail.

📍 What Changed in GitLab 18?

GitLab has supported the concept of scoped job token permissions since GitLab 15.9. This feature allowed project maintainers to restrict which other projects or groups could access their resources using CI_JOB_TOKEN.

For a while, this behavior was optional or hidden behind feature flags. But as of GitLab 18, the old implicit access is gone. You must now explicitly authorize projects or groups—otherwise, your job token will be denied access by default.

❗ The Symptom

If you're seeing something like this in your CI logs:

error: failed to download package: 403 Forbidden

You're likely trying to fetch a package or archive from another project without having the correct permissions set up under GitLab's updated security model.

✅ How to Fix It

To allow a CI job from one project to access another project’s archive packages using CI_JOB_TOKEN:

  1. Go to the target project (the one hosting the archive).
  2. Navigate to Settings → CI/CD.
  3. Expand the "Job token permissions" section.
  4. Under Authorized groups and projects, add the source group or project that needs access.
  5. Save changes.

That’s it — this will grant the necessary access for your pipelines to function as expected under GitLab 18.

💡 Tip for DevOps Teams

Review your existing pipelines before upgrading to GitLab 18. If your workflows rely on cross-project access via CI_JOB_TOKEN, make sure those permissions are configured ahead of time to avoid unexpected pipeline failures.

🔁 Summary

  • This isn’t a new feature in GitLab 18 — it’s now mandatory.
  • You must explicitly authorize job token access in the target project’s settings.
  • Failing to do so will result in 403 Forbidden errors when accessing packages.

By updating your project permissions, your CI/CD pipelines will be back on track—and more secure than before.

📚 Sources

V2Ray, Clash & Clash Meta Protocol Support and Configuration Guide

2025-06-16 06:12:55

Introduction

This document introduces and compares the proxy protocols used by V2Ray, Clash, and Clash Meta. It provides standard configuration examples for different protocols to show their differences and help users set them up correctly.

I. Platform and Protocol Support Comparison

V2Ray, Clash, and Clash Meta support different protocols. V2Ray provides the basic protocol support. Clash focuses on rules and user-friendliness. Clash Meta is an extension of Clash that supports newer, high-performance protocols.

Protocol Support Matrix

Protocol V2Ray Clash Clash Meta
VMess
VLESS
Trojan
Shadowsocks (SS)
ShadowsocksR (SSR)
SOCKS / SOCKS5
HTTP(S)
Snell
MTProto
Hysteria / Hysteria2
TUIC

Core Differences Summary

  • V2Ray is a core V2Fly project that supports many protocols and is highly customizable, especially for VMess and VLESS. Its configuration is very flexible because it includes several inbound and outbound protocols.
  • Clash is known for its powerful rule system and its use of a single YAML file for configuration. It combines many common protocols, but its original core is no longer updated, meaning it does not support newer protocols like VLESS.
  • Clash Meta, now called mihomo, is an active and updated version of the original Clash. It is fully compatible with Clash's features while also adding support for new protocols such as VLESS, Hysteria2, and TUIC, making it the most complete version currently available.

II. Protocol Configuration Examples

Below are standard configuration snippets for each protocol on different platforms. Please note that all placeholders like server.com, your-uuid, your-password, etc., in the examples need to be replaced with your own node information.

1. Shadowsocks (SS)

  • Features: Classic, lightweight, and efficient.

  • Clash / Clash Meta (YAML)

    - name: "SS-Server"
      type: ss
      server: server.com
      port: 8388
      cipher: aes-256-gcm
      password: "your-password"
      udp: true
    
  • V2Ray (JSON) json { "protocol": "shadowsocks", "settings": { "servers": [ { "address": "server.com", "port": 8388, "method": "aes-256-gcm", "password": "your-password" } ] } }

2. Trojan

  • Features: Mimics HTTPS traffic, providing good obfuscation.

  • Clash / Clash Meta (YAML)

    - name: "Trojan-Server"
      type: trojan
      server: server.com
      port: 443
      password: "your-password"
      sni: "your-domain.com"
      udp: true
    
  • V2Ray (JSON) json { "protocol": "trojan", "settings": { "servers": [ { "address": "server.com", "port": 443, "password": "your-password" } ] }, "streamSettings": { "security": "tls", "tlsSettings": { "serverName": "your-domain.com" } } }

3. VMess

  • Features: V2Ray's core protocol, powerful with many configurable options.

  • Clash / Clash Meta (YAML)

    - name: "VMess-Server"
      type: vmess
      server: server.com
      port: 10086
      uuid: "your-uuid"
      alterId: 0
      cipher: auto
      network: "ws"
      tls: true
      servername: "your-domain.com"
      ws-opts:
        path: "/your-path"
        headers:
          Host: your-domain.com
    
  • V2Ray (JSON) json { "protocol": "vmess", "settings": { "vnext": [ { "address": "server.com", "port": 10086, "users": [ { "id": "your-uuid", "alterId": 0, "security": "auto" } ] } ] }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "your-domain.com" }, "wsSettings": { "path": "/your-path", "headers": { "Host": "your-domain.com" } } } }

4. SOCKS5

  • Features: A general-purpose network transport protocol that can be used for proxy chaining.

  • Clash / Clash Meta (YAML)

    - name: "SOCKS5-Upstream"
      type: socks5
      server: proxy.server.com
      port: 1080
      # username: "user"      # optional
      # password: "password"  # optional
      # udp: true             # optional
    
  • V2Ray (JSON) json { "protocol": "socks", "settings": { "servers": [ { "address": "proxy.server.com", "port": 1080, "users": [ { "user": "user", "pass": "password" } ] } ] } }

5. HTTP(S)

  • Features: A general-purpose HTTP proxy that supports TLS encryption.

  • Clash / Clash Meta (YAML)

    - name: "HTTP-Upstream"
      type: http
      server: proxy.server.com
      port: 8080
      # username: "user"  # optional
      # password: "password" # optional
      # tls: true           # if it is an HTTPS proxy
    
  • V2Ray (JSON) json { "protocol": "http", "settings": { "servers": [ { "address": "proxy.server.com", "port": 8080, "users": [ { "user": "user", "pass": "password" } ] } ] } }

6. VLESS

  • Features: The lightweight successor to VMess, offering better performance, often used with XTLS.

  • Clash Meta (YAML)

    - name: "VLESS-Server"
      type: vless
      server: server.com
      port: 443
      uuid: "your-uuid"
      network: "ws"
      tls: true
      servername: "your-domain.com"
      client-fingerprint: "chrome"
      ws-opts:
        path: "/your-path"
    
  • V2Ray (JSON) json { "protocol": "vless", "settings": { "vnext": [ { "address": "server.com", "port": 443, "users": [ { "id": "your-uuid", "flow": "xtls-rprx-vision", "encryption": "none" } ] } ] }, "streamSettings": { "security": "xtls", "xtlsSettings": { "serverName": "your-domain.com" } } }

7. ShadowsocksR (SSR)

  • Features: An early fork of SS that added protocol obfuscation features.
  • Clash / Clash Meta (YAML) ```yaml
    • name: "SSR-Server" type: ssr server: server.com port: 12345 cipher: aes-256-cfb password: "your-password" protocol: "authaes128md5" protocol-param: "1234:abcd" obfs: "tls1.2ticketauth" obfs-param: "your-domain.com" ```

8. Snell

  • Features: A lightweight protocol developed by Surge.
  • Clash / Clash Meta (YAML) ```yaml
    • name: "Snell-Server" type: snell server: server.com port: 23456 psk: "your-pre-shared-key" obfs-opts: mode: tls host: www.bing.com ```

9. MTProto

  • Features: Telegram's proprietary protocol; V2Ray can be used to proxy Telegram traffic.
  • V2Ray (JSON) json { "protocol": "mtproto", "settings": { "servers": [ { "address": "proxy.server.com", "port": 443, "users": [ { "secret": "dd000102030405060708090a0b0c0d0e0f" } ] } ] } }

10. Hysteria2

  • Features: Based on QUIC, performs excellently on unstable networks with strong resistance to packet loss.
  • Clash Meta (YAML) ```yaml
    • name: "Hysteria2-Server" type: hysteria2 server: server.com port: 34567 auth: "your-password" sni: your-domain.com ```

11. TUIC

  • Features: Also based on QUIC, designed to maximize throughput and reduce latency.
  • Clash Meta (YAML) ```yaml
    • name: "TUIC-Server" type: tuic server: server.com port: 45678 uuid: "your-uuid" password: "your-password" sni: your-domain.com udp-relay-mode: "native" congestion-controller: "bbr"

Concise Writing Pro

2025-05-21 03:24:27

Ever feel the article generated by ChatGPT just too "AI-ish"? Trust me, most people can tell if the article is written by AI or human. AI uses too many fancy words and complicated sentences. Humans don't do that. It's hard to write and hard to read.

So here comes the prompt that can help you rewrite the article in a more human way. It can help you make the article more concise and easier to read.

Concise Writing Pro
====
Help the user rewrite his content using a straightforward tone. Avoid fancy words and opt for simple yet professional language. Present the information in paragraph form without bullet points.

The user prefers paragraph writing and wants to maintain the citation commands, \cite{}.

Keep the format as provided by the user.

Do not engage in conversation with the user; simply output the required content.

There is no need to write out full names for presented abbreviations.

Deploy ComfyUI with Flux Models Easily on Google Colab

2025-05-06 21:04:00

Running powerful AI image generation tools like ComfyUI, especially with cutting-edge models like Flux, often requires significant local setup and powerful hardware. Google Colab offers a fantastic alternative, providing free access to GPUs in the cloud.

This post will guide you through using a prepared Google Colab notebook to quickly set up ComfyUI and download the necessary Flux models (FP8, Schnell, and Regular FP16) along with their dependencies. The full code for the notebook is included below.

What the Colab Notebook Does

The provided Colab notebook code automates the entire setup process:

  • Clones the latest ComfyUI repository.
  • Installs all required Python packages.
  • Downloads the different Flux model variants (Single-file FP8, Schnell FP8, Regular FP16) using wget.
  • Downloads the specific CLIP and VAE models needed for each Flux variant using wget.
  • Organizes all downloaded files into the correct ComfyUI/models/ subdirectories (checkpoints, unet, clip, vae).

Colab Notebook Code

You can copy and paste the code below into separate cells in a Google Colab notebook.

# -*- coding: utf-8 -*-
"""
Colab Notebook for Setting Up ComfyUI with Flux Models using wget and %cd

This notebook automates the following steps:
1. Clones the ComfyUI repository.
2. Installs necessary dependencies.
3. Navigates into the models directory.
4. Downloads the different Flux model variants (Single-file FP8, Schnell FP8, Regular FP16) into relative subdirectories.
5. Downloads the required CLIP models and VAEs into relative subdirectories.
6. Places all downloaded files into their correct relative directories within the ComfyUI installation.

Instructions:
1. Create a new Google Colab notebook.
2. Ensure the runtime type is set to GPU (Runtime > Change runtime type).
3. Copy the code sections below into separate cells in your notebook.
4. Run each cell sequentially.
5. After the setup is complete, run the final cell to start ComfyUI (it navigates back to the ComfyUI root first).
6. A link (usually ending with `trycloudflare.com` or `gradio.live`) will be generated. Click this link to access the ComfyUI interface in your browser.
7. Once in the ComfyUI interface, you can manually load the workflow JSON files provided in the original tutorial.
"""

# Cell 1: Clone ComfyUI Repository and Install Dependencies
!git clone https://github.com/comfyanonymous/ComfyUI.git
%cd ComfyUI
!pip install -r requirements.txt

# Install xformers for potential performance improvements (optional but recommended)
!pip install xformers

# Cell 2: Navigate to Models Dir, Create Subdirs, and Download Files using wget
import os

# Navigate into the models directory
%cd models

# --- Create Subdirectories ---
# Create directories relative to the current 'models' directory
os.makedirs("checkpoints", exist_ok=True)
os.makedirs("unet", exist_ok=True)
os.makedirs("clip", exist_ok=True)
os.makedirs("vae", exist_ok=True)

# --- Download Files using wget directly into relative paths ---

print("\n--- Downloading Single-file FP8 Model ---")
# Download directly into the 'checkpoints' subdirectory
!wget -c -O checkpoints/flux1-dev-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-dev/resolve/main/flux1-dev-fp8.safetensors

print("\n--- Downloading Schnell FP8 Models & Dependencies ---")
# Download directly into respective subdirectories
!wget -c -O unet/flux1-schnell-fp8.safetensors https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell-fp8.safetensors
!wget -c -O vae/flux_schnell_ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-schnell/resolve/main/ae.safetensors
!wget -c -O clip/clip_l.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
!wget -c -O clip/t5xxl_fp8_e4m3fn.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors

print("\n--- Downloading Regular FP16 Models & Dependencies ---")
# Note: You might need to agree to terms on Hugging Face for this one first manually in a browser if wget fails.
# If you encounter issues, download manually and upload to Colab's ComfyUI/models/unet directory.
!wget -c -O unet/flux1-dev.safetensors https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors
!wget -c -O vae/flux_regular_ae.safetensors https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors
# clip_l.safetensors is already downloaded (or attempted above)
!wget -c -O clip/t5xxl_fp16.safetensors https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors

print("\n--- All Downloads Attempted ---")
print("Please check the output for any download errors.")
print(f"Files should be in the respective subdirectories within the current 'models' folder.")

# Navigate back to the ComfyUI root directory before starting the server
%cd ..


# Cell 3: Run ComfyUI
# This will start the ComfyUI server from the root directory and provide a public link (usually cloudflare)
# If you get an error about port 8188 being in use, you might need to restart the Colab runtime.
!python main.py --listen --port 8188 --enable-cors --preview-method auto

# Note: The first time running might take a while as it sets things up.
# Once you see output like "To see the GUI go to: https://...", click the link.
# You will need to manually load the workflow JSON files into the ComfyUI interface.

Where to Find Flux Workflow JSON Files

After setting up ComfyUI using the Colab notebook, you'll need workflow files (.json) to load into the interface. Here are some places where you can find examples based on recent searches:

Remember to download the .json file and use the "Load" button in the ComfyUI interface running in your Colab instance.

How to Use the Notebook Code

  1. Create Notebook: Open Google Colab and create a new notebook.
  2. Set Runtime: Ensure your Colab notebook is using a GPU runtime (Runtime > Change runtime type > Hardware accelerator > GPU).
  3. Copy & Paste Cells: Copy the code sections marked # Cell 1, # Cell 2, and # Cell 3 into separate code cells in your Colab notebook.
  4. Run Cell 1 (Setup): Execute the first code cell. This installs ComfyUI and dependencies.
  5. Run Cell 2 (Download Models): Execute the second code cell. This downloads all the models using wget. Monitor the output for errors.
  6. Run Cell 3 (Start ComfyUI): Execute the third code cell. This starts the server.
  7. Access ComfyUI: Look for a URL in the output of the third cell (e.g., https://....trycloudflare.com). Click this link to open the ComfyUI web interface.
  8. Load Workflows: Your ComfyUI instance is running! Use the "Load" button in the interface to load the Flux workflow .json files from the original tutorial.

Important Notes

  • GPU Runtime: T4 GPU (often free tier) is usually sufficient for the FP8 models. You might need a higher-tier GPU (like A100 from paid plans) for the Regular FP16 model due to VRAM requirements (24GB+).
  • Download Errors: If wget fails for the regular flux1-dev.safetensors model, visit the Hugging Face page in your browser, accept the terms, then rerun the download cell. Alternatively, download it manually and upload it to the ComfyUI/models/unet/ directory in Colab using the file browser on the left.
  • Workflow Files: This notebook sets up the environment and models. You still need the workflow .json files to tell ComfyUI how to connect the nodes.

Downloading Login-Required Civitai Models in Google Colab

2025-05-06 08:33:00

Google Colab provides a fantastic environment for experimenting with AI models like Stable Diffusion. Civitai is a popular hub for sharing and discovering these models. This post explains how to download models from Civitai that require login, directly within your Colab notebook, using an API token managed by Colab's Secrets feature.

Download Example: Using Colab Secrets

To manage your API token properly, use Google Colab's built-in Secrets manager.

  1. Add Your Token to Colab Secrets:

    • In your Colab notebook, click the key icon (🔑) in the left sidebar.
    • Click "+ Add a new secret".
    • Enter a Name for the secret, for example, CIVITAI_API_TOKEN.
    • Paste your actual Civitai API token into the Value field.
    • Make sure the "Notebook access" toggle is enabled.
    • Close the Secrets panel.
  2. Access the Secret and Download: Run the following code block in Colab. It will access your stored token and use it for the download.

    # 1. Import the secrets module and access your stored token
    from google.colab import userdata
    try:
        CIVITAI_TOKEN = userdata.get('CIVITAI_API_TOKEN')
        if not CIVITAI_TOKEN:
            raise ValueError("Civitai token not found or empty in Colab Secrets. Please add it.")
    except userdata.SecretNotFoundError:
        print("Secret 'CIVITAI_API_TOKEN' not found. Please add it to Colab Secrets (key icon 🔑).")
        raise # Stop execution if the secret isn't found
    except ValueError as e:
        print(e)
        raise # Stop execution if the secret is empty
    
    # 2. Construct and run the wget command using the retrieved token
    # Example URL - replace with the actual model URL and desired filename
    # Ensure the URL includes the necessary parameters (type, format, etc.) for your desired file
    # Note: The URL is enclosed in double quotes for the shell command.
    !wget "https://civitai.com/api/download/models/351306?type=Model&format=SafeTensor&size=full&fp=fp16&token=$CIVITAI_TOKEN" -O dreamshaperXL_v21TurboDPMSDE.safetensors
    
    print("Download command executed.")
    

(See "Getting Your Civitai API Token" below if you don't have a token yet, and "Important Considerations" for details on finding the correct URL and parameters).

The Problem (Why Direct Download Fails)

When you try to download certain models using tools like wget directly in Colab without authentication, the download might fail if the model requires a user account for access. Civitai restricts some downloads to registered users.

The Solution: Civitai API Token via Colab Secrets

The solution is to authenticate your download request using a personal API token generated from your Civitai account, managed via Colab Secrets.

Getting Your Civitai API Token

If you don't have an API token yet, follow these steps to obtain one:

  1. Access Account Settings:
    • Go to the Civitai website.
    • Click on your profile icon (usually in the top right corner).
    • Select "Account Settings" from the dropdown menu.
  2. Generate API Key:
    • Within "Account Settings," look for a section named "API Keys" (or similar).
    • Click on "Add API Key".
    • Give your key a descriptive name (e.g., "Colab Downloads") and click "Save".
  3. Save Your Key:
    • Civitai will generate and display your API key. Copy this key immediately. You will paste this key into the Colab Secrets manager (as described in the "Download Example" section). Treat it like a password – don't share it publicly.

Important Considerations

  • Token Management (Use Colab Secrets):
    • It's recommended to use the Colab Secrets manager (key icon 🔑) to store sensitive information like API keys. This keeps your token separate from your code. The example code shows how to access it.
  • Finding Download URLs/Parameters: The most challenging part can still be finding the exact API download URL and the correct parameters (type, format, size, fp, etc.) for the specific model file you need. You might need to:
    • Start a download in your browser while logged in and use the browser's developer tools (Network tab) to inspect the actual URL being requested.
    • Look for API information or download links provided by the model creator on the Civitai page. The parameters in the example (?type=Model&format=SafeTensor&size=full&fp=fp16) are specific to that model file and will likely be different for others.
  • Rate Limits: Be mindful of potential API rate limits Civitai might enforce. Avoid excessively frequent downloads.

By using your Civitai API token via Colab Secrets, you can seamlessly download login-required models directly into your Google Colab environment.