Posts

Showing posts from 2024

Enabling Cloudflare Proxy for AWS Lambda

Image
Integrating Cloudflare with AWS Lambda can enhance security and performance. Here's a concise guide for technically proficient users to set up Cloudflare proxy for AWS Lambda. Step 1: Deploy Your Lambda Function Create and Deploy Lambda: Start by creating your Lambda function and deploying it to AWS. Step 2: Configure API Gateway Add API Gateway Trigger: Attach an API Gateway trigger to your Lambda function. This will manage HTTP requests to your function. Step 3: DNS Configuration Add CNAME Record: In your Cloudflare DNS settings, create a CNAME record. For instance, api.mydomain.com should point to your API Gateway URL, such as aaabbbccc.execute-api.ap-southeast-2.amazonaws.com. Step 4: SSL/TLS Encryption Enable Full Encryption Mode: Navigate to SSL/TLS settings on Cloudflare and select "Full" encryption mode. This ensures end-to-end encryption, necessary because Cloudflare requires SSL to communicate with AWS. Step 5: Proxy Configuration Ensure CNAME is Proxied: Verify...

Brother HL-L2445DW on Raspberry Pi (ARM) and CUPS

The official Brother HL-L2445DW drivers only support x86 architecture, so even if force installed on an ARM linux, such as the Raspberry Pi, it will not work. During installation, it will show an error message like this: bash linux-brprinter-installer-2.2.3-1 ... dpkg: warning: package architecture (i386) does not match system (armhf) The files are on the system but they will not work. Installing the ARM Raspberry Pi compatible Brother drivers The brlaser project is an open source driver for Brother laser printers. While it does not officially support the HL-L2445DW, there is a workaround. Step 1 - install brlaser  sudo apt-get install printer-driver-brlaser Step 2 - select a different but compatible driver In CUPS, select  Brother HL-L2300D, using brlaser v4 , which is fully compatible with the newer L2445DW.  Done, the printer is not fully operational, including double-sided printing

Convert animated WEBP to MP4

 Animated WebP, similar to animated GIF, is not the best video format to work with, but this is what the usual SVD (image or text to video) and ComfyUI will generate. Unfortunately, FFMPEG does not support WebP to MP4 conversion yet, so this simple frame-by-frame conversation had to be done. As it's generating a PNG for each frame, it's rather slow, so it's only suitable for short animations. The below simple python code converts the animated WebP into MP4, using the predefined FPS. Don't forget to  pip3 install pillow   moviepy import os import shutil import tempfile import argparse from moviepy.video.io.ImageSequenceClip import ImageSequenceClip import PIL.Image def analyse_image (path): im = PIL . Image . open(path) results = { 'size' : im . size, 'mode' : 'full' , } try : while True : if im . tile: tile = im . tile[ 0 ] update_region = t...