Reading list 01

https://substack.com/home/post/p-155303485?selection=3a0aba38-05c7-463b-8544-28a9a45b52a7 This post is imported from: https://thebrownbox.hashnode.dev/reading-list-01

February 2, 2025 · 1 min

Make sure setup new redirect url for new domain

To able to use existing setup for google login, make sure you update this setting for the new domain This post is imported from: https://thebrownbox.hashnode.dev/make-sure-setup-new-redirect-url-for-new-domain

January 24, 2025 · 1 min

How to install packages for service in Railway (NixPacks)

NixPacks is like docker file for setup your service. I have 2 packages need to be installed to able to use a library convert pdf to images: 'graphicsmagick', 'ghostscript' In Railway, to modify nixpacks, just need to create nixpacks.toml file in the root folder. Below is a simple nixpacks file just to install above packages into my service: # https://nixpacks.com/docs/configuration/file [dependencies] # List any additional dependencies if needed nodejs = "18....

October 30, 2024 · 1 min

react-pdf with SizeMe

Currently I’m using react-pdf to display a pdf file. But it’s not quite easy to control how it displayed. This is how I make the file fit the width of the parent component (ref from the internet) import { SizeMe } from "react-sizeme"; //... <SizeMe> {({ size }) => ( <Document file={pdfUrl} onLoadSuccess={onDocumentLoadSuccess}> {numPages && Array.from({ length: numPages }, (_, index) => ( <Page renderAnnotationLayer={false} key={`page_${index + 1}`} pageNumber={index + 1} width={size....

October 30, 2024 · 1 min

Setting CORS for AWS S3 (to view signed docs)

To be able to view a file from s3, you have to generate a presigned document URL. And to able to view this URL you need to be allowed in s3, otherwise you gonna get CORS issue. [ { "AllowedHeaders": [], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "http://localhost:3000" ], "ExposeHeaders": [] } ] This post is imported from: https://thebrownbox.hashnode.dev/setting-cors-for-aws-s3-to-view-signed-docs

October 22, 2024 · 1 min

How to learn FEEL in Camunda

Desc: My job requires working with Camunda to develop workflows for automation and implementation. FEEL is the language that is used mainly in Camunda. Below are some resource that help you quickly adapt this language: Docs: https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-expressions-introduction/ Playground: https://camunda.github.io/feel-scala/docs/playground/ This post is imported from: https://thebrownbox.hashnode.dev/how-to-learn-feel-in-camunda

August 20, 2024 · 1 min

Settings Memory and CPU for container

Desc: Basic setting for memory and CPU in container How basic knowledge is very important Measurement Unit The most important thing is that we have to know the unit of each one: CPU: is measure by CPU unit Memory: Mebibyte, Gibibyte,… How to setting them With CPU: It’s a float: cpu: "0.5" or cpu: "1" "0.5" can represent like "500m" With Memory: Mebibyte: Mi Gibibyte: Gi apiVersion: v1 kind: Pod metadata: name: example-pod spec: containers: - name: example-container image: example-image resources: requests: memory: "512Mi" # Memory request cpu: "250m" # CPU request (0....

August 19, 2024 · 1 min

How I log and alert

Logs should be long enough to have all the needed information and short enough not to cause any effect on the system (large log files, etc.). They should also be in a good format for easy traceability and alertness. Below is my current strategy for log and alerting. My current project use Splunk for logs, it supports alert to Slack! How I log NOTE: If you want to log the output/result of a function, log it inside the function, so you don’t have to duplicate that log, also you don’t forgot to add it outside whenever the function is called/used....

August 14, 2024 · 2 min

How I sync my Hashnode with my Hugo blog

Hashnode provide a visual editor easy to use and create blog. Hashnode also provide auto backup into github in markdown format. So I gonna create blog in hashnode and sync it to my hugo blog Step 1: make a script to convert from hashnode format to hugo format Even they’re both markdown, but both has a special properties to format the blog. So here we have to convert mostly those properties, for the body don’t need to to touch much....

August 13, 2024 · 5 min

Merge 2 branches with Github Actions

Story I plan to auto push blog from hashnode to hugo. So this is the first step. My repo has 2 branch: main: is the branch that hashnode gonna backup the posts there in md format. Hugo: is the branch that contains Hugo blog Step 1: Make sure your Actions has permission to write to the repo. Check it here: https://github.com/thebrownbox/blogs/settings/actions Step 2: Create the github actions ref: https://github.com/devmasx/merge-branch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 name: Merge main to Hugo on: push: branches: - main jobs: merge-branch: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Merge main -> Hugo uses: devmasx/merge-branch@master with: type: now target_branch: Hugo github_token: ${{ secrets....

August 13, 2024 · 1 min