<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by PanachaiNY on Medium]]></title>
        <description><![CDATA[Stories by PanachaiNY on Medium]]></description>
        <link>https://medium.com/@panachai-ny?source=rss-a8381aa83da7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*aysxmK2xxJwRchqBYZfuTQ.jpeg</url>
            <title>Stories by PanachaiNY on Medium</title>
            <link>https://medium.com/@panachai-ny?source=rss-a8381aa83da7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:22:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@panachai-ny/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Copy Markdown to confluence]]></title>
            <link>https://panachai-ny.medium.com/copy-markdown-to-confluence-6de0842bbb30?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6de0842bbb30</guid>
            <category><![CDATA[confluence]]></category>
            <category><![CDATA[markdown]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 08:28:27 GMT</pubDate>
            <atom:updated>2025-12-03T08:28:27.197Z</atom:updated>
            <content:encoded><![CDATA[<pre><br>| Error Code | HTTP Status | Error Message                     |<br>| ---------- | ----------- | --------------------------------- |<br>| 5000001    | 500         | something went wrong.             |</pre><ol><li>Copy from your source</li><li>Paste via command + shift + von confluence</li><li>After Paste text click follow image below</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cplKnZJAP9LpESFXvWtzVA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6de0842bbb30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jira card title+url to Notion]]></title>
            <link>https://panachai-ny.medium.com/jira-card-title-url-to-notion-17e81c66ae74?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/17e81c66ae74</guid>
            <category><![CDATA[jira]]></category>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Wed, 18 Jun 2025 17:44:31 GMT</pubDate>
            <atom:updated>2025-06-18T17:44:31.133Z</atom:updated>
            <content:encoded><![CDATA[<p>ผมใช้ Notion database สำหรับ track งานต่างๆ แต่ต้องมานั่งเขียนให้ง่ายต่อการเข้าใจของตัวเอง ก็ต้องมานั่งเขียน markdown แปะลิ้ง copy title jira มาใส่..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MN-H10pEFr_eb9GXqY-o7g.png" /></figure><h4>Objective</h4><p><strong>Input:</strong> jira url</p><p><strong>Output:</strong> Auto Copy ข้อความด้วย pattern [Jira-card-number-with-hyperlink] — Jira-title-card</p><h3><strong>Solutions: for MacOS &amp; Tested on Zsh shell</strong></h3><h4>1. ผมใช้ bash script ในการทำงาน</h4><p>นำไฟล์ไปวางที่ ~/dotfiles/bash-func.sh หรือจะวางไว้ตำแหน่งไหนก็ได้ แล้วปรับ script source ไปที่ตรงนั้น</p><pre># Usage: jirafmt https://company.atlassian.net/browse/TPLE-2641<br><br>jirafmt() {<br>  local input=&quot;${1:?Usage: jirafmt JIRA_URL}&quot;<br>  local key<br>  local base_url<br><br>  echo &quot;🔍 Processing Jira URL: $input&quot;<br><br>  # Extract key and base URL from Jira URL<br>  if [[ &quot;$input&quot; =~ ^(https://[^/]+)/browse/([A-Z]+[A-Z0-9]*-[0-9]+)$ ]]; then<br>    base_url=&quot;${input%%/browse*}&quot;<br>    key=&quot;${input##*/}&quot;<br>    echo &quot;✅ Extracted base URL: $base_url&quot;<br>    echo &quot;✅ Extracted issue key: $key&quot;<br>  else<br>    echo &quot;❌ Error: Please provide a valid Jira URL (e.g., https://company.atlassian.net/browse/ISSUE-123)&quot;<br>    return 1<br>  fi<br><br>  # Add validation to ensure key is not empty<br>  if [[ -z &quot;$key&quot; ]]; then<br>    echo &quot;❌ Error: Could not extract issue key from URL&quot;<br>    return 1<br>  fi<br><br>  # Validate base URL format<br>  if [[ ! &quot;$base_url&quot; =~ ^https://[^/]+$ ]]; then<br>    echo &quot;❌ Error: Invalid base URL format: $base_url&quot;<br>    return 1<br>  fi<br><br>  echo &quot;✅ Base URL validation passed&quot;<br><br>  local api_url=&quot;${base_url}/rest/api/2/issue/${key}&quot;<br>  local browse_url=&quot;${base_url}/browse/${key}&quot;<br><br>  echo &quot;🌐 API URL: $api_url&quot;<br>  echo &quot;🔗 Browse URL: $browse_url&quot;<br><br>  # Fetch from Jira API, extract key and summary, then print Markdown link and copy to clipboard<br>  echo &quot;📡 Fetching issue details from Jira API...&quot;<br>  local result<br>  result=$(curl -sSf -u &quot;$JIRA_USER:$JIRA_TOKEN&quot; \<br>    &quot;$api_url&quot; \<br>    -H &quot;Accept: application/json&quot; |<br>    jq -r --arg url &quot;$browse_url&quot; &#39;. as $r | &quot;[[\($r.key)]](\($url)) – \($r.fields.summary)&quot;&#39;)<br><br>  echo &quot;✅ Successfully fetched and formatted issue details&quot;<br><br>  echo &quot;$result&quot; | pbcopy<br>  # Print the result with beautiful formatting<br>  echo<br>  echo &quot;📋 Jira Issue Formatted:&quot;<br>  echo &quot;─────────────────────────&quot;<br>  echo &quot;$result&quot;<br>  echo &quot;─────────────────────────&quot;<br>  echo &quot;✅ Copied to clipboard!&quot;<br>  echo<br>}</pre><h4>2. Set Jira token</h4><p>Link: <a href="https://id.atlassian.com/manage-profile/security/api-tokens">https://id.atlassian.com/manage-profile/security/api-tokens</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywTkS4tC99iXQjEPs3lFUQ.png" /></figure><p>ทำการ copy token มาใส่ใน machine env และเพื่อให้รันทุกครั้ง สามารถใส่ในไฟล์ ~/.zprofile ก็ได้ครับ</p><pre># ====== Jira ======<br><br>export JIRA_USER=&quot;panachai.ny@gmail.com&quot;<br>export JIRA_TOKEN=&quot;thisisyourtokenthisisyourtokenthisisyourtokenthisisyourtokenthisisyourtokenthisisyourtokenthisisyourtokenthisisyourtokenthisisyourtoken&quot;</pre><h4>3. เพื่อการใช้งานที่ง่าย ผมทำการ source file ทุกครั้งที่เปิด Terminal</h4><p>โดยจะ source ที่ตำแหน่ง ~/dotfiles/bash-func.sh</p><p>เพิ่มที่ ~/.zprofile</p><pre># ====== Source bash functions ======<br><br>if [ -f &quot;$HOME/dotfiles/bash-func.sh&quot; ]; then<br>    source &quot;$HOME/dotfiles/bash-func.sh&quot;<br>else<br>    echo &quot;Warning: bash-func.sh not found&quot;<br>fi</pre><p>และทำการเติม alias เพื่อให้ง่ายต่อการใช้งาน</p><pre>alias jf=&#39;jirafmt&#39;</pre><h4>Example</h4><pre>jf https://company.atlassian.net/browse/ISSUE-123</pre><h4>Result:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-q6jtoUFZIYFJkbufmtOg.png" /></figure><p>ทีนี้เราก็จะได้ ชุด เลขการ์ด + hyperlink url ตามด้วย ชื่อ Card ใน clipboard เพื่อนำไปวางใน notion ได้แล้วครับ~</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17e81c66ae74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to pull AWS ECR private reposto local]]></title>
            <link>https://panachai-ny.medium.com/how-to-pull-aws-ecr-private-reposto-local-eb0fffe78165?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb0fffe78165</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[private]]></category>
            <category><![CDATA[ecr]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Thu, 29 Aug 2024 15:30:37 GMT</pubDate>
            <atom:updated>2024-08-29T15:30:37.007Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to pull AWS ECR private repository to local</h3><p>พอดีจะมีเคสที่ เรา build docker local แล้วมันผ่าน แต่พอ build from CI CD แล้ว push เข้า AWS ECR แล้วพัง เราเลยจำเป็นจะต้อง investigate โดยการ pull docker image ลงมาเช็คที่ด้านล่าง</p><p>0. Case IAM ทำการ generate aws key เพื่อ access เข้า AWS (ปกติผมจะทำผ่าน AWS Dashboard) <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/access.credentials.html">ref</a></p><pre>export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxx<br>export AWS_SECRET_ACCESS_KEY=vvvvvvvvvvvvvvvvvvvvvvv</pre><ol><li>Authentication ECR เพื่อ ให้สามารถ pull private repository ลงมา local ได้</li></ol><pre>aws ecr get-login-password \<br>    --region &lt;region&gt; \<br>| docker login \<br>    --username AWS \<br>    --password-stdin &lt;aws_account_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com</pre><p>2. ทำการ pull docker image</p><pre>docker pull &lt;aws_account_id&gt;.dkr.ecr.&lt;region&gt;.amazonaws.com/&lt;image-name&gt;:&lt;image-tag&gt;</pre><p>เท่านี้ก็เรียบร้อย ~</p><p>ref: <a href="https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html">get-login-password — AWS CLI 1.34.8 Command Reference (amazon.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb0fffe78165" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[AI Chat] How to install & run Ollama in windows + wsl2]]></title>
            <link>https://panachai-ny.medium.com/how-to-install-run-ollama-in-windows-wsl2-2a42bdcbc998?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a42bdcbc998</guid>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[wsl]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Wed, 28 Feb 2024 15:59:59 GMT</pubDate>
            <atom:updated>2024-02-28T16:00:54.543Z</atom:updated>
            <content:encoded><![CDATA[<p>ช่วงนี้ผมกำลังศึกษา LLM (Large language model) ในหลายๆ use case ก็มาเจอกับ Ollama ที่ค่อนข้างน่าสนใจ ติดตั้ง พร้อมใช้งาน demo ง่ายมากๆ ลองมาดูกันครับ</p><h3>Prerequisite</h3><ul><li>wsl 2 (Windows Subsystem for Linux)</li><li>Windows</li></ul><h3>Reason</h3><p>เหตุผลที่เลือกใช้ wsl2 + Windows เพราะว่าชอบ CLI ของ Linux มากกว่า (ใช้ mac มาตลอดตั้งแต่เริ่มทำงาน) และมัน compatibility กับบน server ซึ่งส่วนใหญ่ก็เป็น Linux เช่นกัน ส่วนตัวเลย prefer wsl2 ถ้าทำงานบน Windows</p><p>และการที่ย้ายมาใช้ windows ทำงานก็เพราะว่ามี GPU ให้ใช้ทำให้รัน model ต่างๆ ได้ไวกว่า MacBook มากๆ</p><p>แต่ในบทความนี้ไม่ได้มาสอนลง WSL นะครับบบ</p><h3>Install</h3><p>ง่ายๆ ตาม scripts เลยครับ <a href="https://ollama.com/download/linux">ref</a></p><pre># ติดตั้ง Ollama<br>curl -fsSL https://ollama.com/install.sh | sh</pre><p>ทีนี้ผมจะลองรัน model llama2 ของ meta <a href="https://ollama.com/library/llama2">ref</a></p><pre><br># CLI 1 serve ollama server<br>ollama serve<br># CLI 2 สั่งรัน llama2 (ถ้าไม่มี จะทำการ pull model อัตโนมัติ)<br>ollama run llama2</pre><p>ทีนี้ก็สามารถ แชทคุยผ่าน cli ได้เลยครับ~</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WakDWflr8k144L0aybft-w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a42bdcbc998" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[AI Image Generator] Install & How to use ComfyUI Manager]]></title>
            <link>https://panachai-ny.medium.com/ai-image-generator-install-how-to-use-comfyui-manager-af2f691b3a96?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/af2f691b3a96</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[comfy-ui]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 13:25:58 GMT</pubDate>
            <atom:updated>2024-02-26T13:25:58.564Z</atom:updated>
            <content:encoded><![CDATA[<p>จากการต้องการที่จะศึกษา workflow ของ ComfyUI จากตัวอย่างใน community ทำให้มาเจอกับเจ้า ComfyUI Manager โดยเจ้า Manager จะทำการโหลด Custom Nodes ที่เราไม่ได้ติดตั้งไว้มาให้ทันที ซึ่งสะดวกมากๆ ครับ</p><p><a href="https://github.com/ltdrdata/ComfyUI-Manager">GitHub - ltdrdata/ComfyUI-Manager: ComfyUI-Manager is an extension designed to enhance the usability of ComfyUI. It offers management functions to install, remove, disable, and enable various custom nodes of ComfyUI. Furthermore, this extension provides a hub feature and convenience functions to access a wide range of information within ComfyUI.</a></p><h3>Installation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*WqPKAvTi-QO1tcVr6LfG2Q.png" /></figure><h4>ทำการเข้าไปที่ folder ของ ComfyUI/custom_nodes</h4><pre>&lt;your location&gt;/ComfyUI_windows_portable/ComfyUI/custom_nodes</pre><h4>ทำการ clone git ตามตัวอย่าง</h4><pre>git clone https://github.com/ltdrdata/ComfyUI-Manager.git</pre><h4>Restart</h4><p>หลังจาก restart แล้วจะมีเมนูเพิ่มมาด้านล่าง</p><ul><li>Manager</li><li>Share</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*wZBEJLVHpidCSANDWELC8A.png" /></figure><p>note: เมื่อทำการติดตั้งเสร็จ อย่าลืม restart ComfyUI ด้วยครับ</p><h3>How to use?</h3><p><a href="https://github.com/ltdrdata/ComfyUI-Manager?tab=readme-ov-file#how-to-use">reference</a></p><p>ส่วนตรงนี้ยังไม่ได้ ใช้อะไรเท่าไหร่ เลยขอแปะเป็น reference link ต้นทางแทนนะครับ</p><h4>Support of missing nodes installation</h4><ul><li><a href="https://github.com/ltdrdata/ComfyUI-Manager?tab=readme-ov-file#support-of-missing-nodes-installation">Reference</a></li></ul><p>ตัวนี้จะเป็น feature ที่ผมใช้บ่อยมาก นั้นคือโหลด custom node ที่เราไม่มีนั้นเอง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEopdOaMO707mfRirBe_Sg.png" /></figure><p>note: เมื่อทำ install custom node เสร็จ อย่าลืม restart ComfyUI ด้วยครับ</p><p><strong>ตัวอย่าง</strong> <a href="https://github.com/ZHO-ZHO-ZHO/ComfyUI-PhotoMaker-ZHO/tree/main">ComfyUI-PhotoMaker-ZHO</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2U4a-0FoPUwjGl5XAfNdOA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af2f691b3a96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[AI Image Generator] ComfyUI in API Integration with HTTP Requests]]></title>
            <link>https://panachai-ny.medium.com/comfyui-in-api-integration-with-http-requests-0fc5a7d7dfe1?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fc5a7d7dfe1</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[stable-diffusion]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[comfy-ui]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 18:28:21 GMT</pubDate>
            <atom:updated>2024-02-26T10:57:15.330Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>This is short note</strong> for try to learn ComfyUI via API in local (Windows 11)</p><h3>Prerequisite<strong>:</strong></h3><ul><li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Stable Diffusion</a></li><li><a href="https://github.com/comfyanonymous/ComfyUI">ComfyUI</a></li><li>Basic knowledge of generative AI</li></ul><h3>เบื้องต้นเราจะต้องมี ComfyUI workflow ที่ต้องการจะใช้งานผ่าน API ก่อน</h3><p>ในที่นี้ผมจะใช้ Default <strong>checkpoints.model </strong>`v1–5-pruned-emaonly.ckpt` และใช้ default workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45dcWqMricVyA7JfqgsCUQ.png" /></figure><h3><strong>Enable Dev mode Options</strong></h3><p>สามารถ ทำตามภาพได้เลยครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*PgV7JuJ90HDmi3hYW-fhmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*tZ7lFYMumTigD4rcXAiuCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*PfrFt5ggycY4jOLFCQmDjA.png" /></figure><p>เราจะได้ไฟล์ <strong>workflow_api.json</strong></p><h3>ทำการสร้าง Request body พร้อมยิงเข้า API /prompt ผ่าน postman</h3><p>โดย structure ก็ง่ายมากคือ</p><pre># example req body<br>{<br>  &quot;prompt&quot;: {<br>    ... workflow_api.json...<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*O3C7egxn0jRQ005NGqQnYA.png" /></figure><p>curl</p><pre>curl --location &#39;http://127.0.0.1:8188/prompt&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>    &quot;prompt&quot;: {<br>        &quot;3&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;seed&quot;: 96228230156886,<br>                &quot;steps&quot;: 20,<br>                &quot;cfg&quot;: 8,<br>                &quot;sampler_name&quot;: &quot;euler&quot;,<br>                &quot;scheduler&quot;: &quot;normal&quot;,<br>                &quot;denoise&quot;: 1,<br>                &quot;model&quot;: [<br>                    &quot;4&quot;,<br>                    0<br>                ],<br>                &quot;positive&quot;: [<br>                    &quot;6&quot;,<br>                    0<br>                ],<br>                &quot;negative&quot;: [<br>                    &quot;7&quot;,<br>                    0<br>                ],<br>                &quot;latent_image&quot;: [<br>                    &quot;5&quot;,<br>                    0<br>                ]<br>            },<br>            &quot;class_type&quot;: &quot;KSampler&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;KSampler&quot;<br>            }<br>        },<br>        &quot;4&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;ckpt_name&quot;: &quot;v1-5-pruned-emaonly.ckpt&quot;<br>            },<br>            &quot;class_type&quot;: &quot;CheckpointLoaderSimple&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;Load Checkpoint&quot;<br>            }<br>        },<br>        &quot;5&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;width&quot;: 512,<br>                &quot;height&quot;: 512,<br>                &quot;batch_size&quot;: 1<br>            },<br>            &quot;class_type&quot;: &quot;EmptyLatentImage&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;Empty Latent Image&quot;<br>            }<br>        },<br>        &quot;6&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;text&quot;: &quot;beautiful scenery nature glass bottle landscape, , purple galaxy bottle,&quot;,<br>                &quot;clip&quot;: [<br>                    &quot;4&quot;,<br>                    1<br>                ]<br>            },<br>            &quot;class_type&quot;: &quot;CLIPTextEncode&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;CLIP Text Encode (Prompt)&quot;<br>            }<br>        },<br>        &quot;7&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;text&quot;: &quot;text, watermark&quot;,<br>                &quot;clip&quot;: [<br>                    &quot;4&quot;,<br>                    1<br>                ]<br>            },<br>            &quot;class_type&quot;: &quot;CLIPTextEncode&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;CLIP Text Encode (Prompt)&quot;<br>            }<br>        },<br>        &quot;8&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;samples&quot;: [<br>                    &quot;3&quot;,<br>                    0<br>                ],<br>                &quot;vae&quot;: [<br>                    &quot;4&quot;,<br>                    2<br>                ]<br>            },<br>            &quot;class_type&quot;: &quot;VAEDecode&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;VAE Decode&quot;<br>            }<br>        },<br>        &quot;9&quot;: {<br>            &quot;inputs&quot;: {<br>                &quot;filename_prefix&quot;: &quot;ComfyUI&quot;,<br>                &quot;images&quot;: [<br>                    &quot;8&quot;,<br>                    0<br>                ]<br>            },<br>            &quot;class_type&quot;: &quot;SaveImage&quot;,<br>            &quot;_meta&quot;: {<br>                &quot;title&quot;: &quot;Save Image&quot;<br>            }<br>        }<br>    }<br>}&#39;</pre><h3>Http จะทำการ trigger generate image ตาม workflow ที่เราส่งไปครับ</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*CiGKxhSIeY0hf6JvkSNbEw.png" /></figure><h3>ผลลัพท์ ตามนี้เลย~</h3><p>ซึ่งในตัว workflow ที่เขียนไว้จะทำการ generate image จาก prompt ที่ hardcode ไว้ในตัว workflow และสุดท้ายจะทำการ Save file ลง local (server)</p><p>เราสามารถ override พวกค่าต่างๆ ภายใน Json file ได้ ที่ client ครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*0i7qtEPLvwkK9mX2pcZFxg.png" /></figure><p><strong>ปล.</strong> ตัวนี้ทดลองที่ Http แบบ async และยังมีความเอ๋อๆ แปลกๆ เช่น ยิงไปแล้ว ตัว ComfyUI ได้รับ req แล้ว แต่ไม่ยอมทำ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sF1VRyl6SsP1QN59RLWgog.png" /><figcaption>บรรทัดที่ hight light ไว้คือไม่ยอมทำ</figcaption></figure><p>แต่เท่าที่ดูมีใช้ <strong>Web socket </strong>ด้วย ตัวนี้น่าจะเสถียรกว่า และสามารถ monitor progress ได้</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fc5a7d7dfe1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[AWS] how to mapping path params in Amazon API Gateway to AWS Lambda on Golang Part 2/2]]></title>
            <link>https://panachai-ny.medium.com/aws-how-to-mapping-path-params-in-amazon-api-gateway-to-aws-lambda-on-golang-part-2-2-cd274e13c183?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd274e13c183</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[gateway]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 15:13:26 GMT</pubDate>
            <atom:updated>2024-02-16T18:24:23.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prerequisite</h3><ul><li>AWS API Gateway knowledge</li><li>lambda knowledge</li></ul><p>เนื่องจากใช้ท่า <strong>[2] Non-Lambda proxy integration</strong> จาก blog part 1/2 ไปได้ อาทิตกว่าๆ รู้สึกว่า เหนื่อยกับการนั่ง mapping บน gateway พร้อมกับการ debug ไม่ได้ (หรือไม่เป็น) บน Gateway และไม่สามารถ control <strong>httpStatusCode</strong> ในจังหวะ response จึงเริ่มเข้าร่วมศาสตร์มืด เข้าเป็นหนึ่งเดียวกับ lambda..</p><p><strong>ปล.</strong> ด้วย structure project ปัจจุบัน แยก service(business logic) &amp; handler ออกอย่างชัดเจน จึงตัดสินใจว่า handler ให้เข้าร่วม lambda แบบเต็มๆ ไปเลย</p><p><strong>ปล. 2</strong> การที่รู้สึกเหนื่อย อาจจะด้วยว่ายังไม่มีเวลาไปทำเป็น Terraform IaC สักที manual คลิกจนเมื่อยมือ..</p><h4>ใครที่ยังไม่ได้อ่าน Part 1 กดด้านล่างได้เลย~</h4><p><a href="https://panachai-ny.medium.com/aws-how-to-mapping-path-params-in-amazon-api-gateway-to-aws-lambda-15ca9e26df1a">[AWS] how to mapping path params in Amazon API Gateway to AWS Lambda</a></p><h3>เริ่มจากการ config Gateway แบบเดิมในตัวอย่างก่อนหน้า (อันนี้เป็นเส้นใหม่นะ)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdEqImaF7n-IPCUtNFqDRQ.png" /></figure><p>ต่อมาทำการ Config โดยใช้ Lambda proxy integration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*UWq3lZtNDuXRYljBg32Ibg.png" /></figure><p><strong>เท่านี้เสร็จเลย แบบไวๆ บน Gateway</strong></p><h3>ต่อมาทำเข้าร่วมที่ฝั่ง Golang กันบ้าง</h3><pre>package main<br><br>import (<br> &quot;context&quot;<br> &quot;encoding/json&quot;<br> &quot;fmt&quot;<br><br> &quot;github.com/aws/aws-lambda-go/events&quot;<br> &quot;github.com/aws/aws-lambda-go/lambda&quot;<br>)<br><br>type Request struct {<br> UniqueKey string `json:&quot;unique_key&quot; validate:&quot;required&quot;`<br>}<br><br>type Response struct {<br> Message string `json:&quot;message&quot;`<br>}<br><br>func Handler(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {<br> uniqueKey := request.PathParameters[&quot;unique_key&quot;]<br> req := Request{<br>  UniqueKey: uniqueKey,<br> }<br><br> // do some process here<br><br> res := Response{Message: &quot;example response here&quot;}<br><br> // แปลง Struct to json string<br> jBytes, err := json.Marshal(res)<br> if err != nil {<br>  return events.APIGatewayProxyResponse{StatusCode: 500}, fmt.Errorf(&quot;error converting response to JSON: %w&quot;, err)<br> }<br> jsonStringResBody := string(jBytes)<br> return events.APIGatewayProxyResponse{Body: jsonStringResBody, StatusCode: 200}, nil<br>}<br><br>func main() {<br> lambda.Start(Handler)<br>}</pre><p>อย่างทื่เห็นใน code ตัวอย่าง เราจะแบ่งเป็นสองส่วนหลักๆ คือ Request / Response</p><h4>Request</h4><p>ในส่วนของ Request ยังคงใช้ Struct ปกติ แต่ทำการ Passing Data จาก AWS Gateway ด้วย <strong>events.APIGatewayProxyRequest</strong> แทน ซึ่งเจ้า ตัวนี้จะมีของให้หยิบใช้ตามนี้</p><p>ปล. ถ้าเกิดเป็นการส่งข้อมูลทาง Body จะต้องทำการ marshall ก่อน และนำเข้า struct Requeest อีกทีครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IO_duyHkCWDUWDZ1_ADqg.png" /></figure><h4>Response</h4><p>ส่วน Response ก็ใช้ Struct ปกติเช่นเดิม และเราเลือกที่จะใช้ <strong>events.APIGatewayProxyResponse</strong> Wrap ก่อน return ออกไป เพื่อทำให้เราสามารถควบคุม Http StatusCode ของ API ได้ เช่น 400 404 200 เป็นต้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Z3akad6S6UKxvu0bPXLjw.png" /></figure><p>แต่จะติดปัญหาในส่วน Body เช่นกัน ก็ทำตามตัวอย่างได้เลย (จริงๆ ผมเขียนเป็น util นะ)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*vBXj6EydjsLmfp37Z4M--g.png" /></figure><p>ทีนี้เราก็จะสามารถรับโดยที่ไม่ต้องเขียน Template mapping + ควบคุม Http Status Code ได้ครับ</p><p><strong>ก็จะจบเพียงเท่านี้ครับ</strong></p><p>ปล. อาจจะมี Part 3 เกี่ยวกับเรื่อง หยิบ sub from claim (we use Amazon Cognito) มาเพื่อใช้ userId ในการทำงาน เพราะมีน้องในทีมบอกว่า เหมือนท่า การ passing request ด้วย <strong>events.APIGatewayProxyRequest</strong> นี้จะไม่รอด.. อีกละ!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd274e13c183" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[AWS] how to mapping path params in Amazon API Gateway to AWS Lambda on Golang Part 1/2]]></title>
            <link>https://panachai-ny.medium.com/aws-how-to-mapping-path-params-in-amazon-api-gateway-to-aws-lambda-15ca9e26df1a?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/15ca9e26df1a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[gateway]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 08:16:01 GMT</pubDate>
            <atom:updated>2024-02-16T15:17:48.268Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>WARN: Blog นี้เป็น short note</strong></p><h3>Prerequisite</h3><ul><li>AWS API Gateway knowledge</li><li>lambda knowledge</li></ul><p>พอดีเจอปัญหาว่า จะใช้ path params ในการส่ง id เข้ามาผ่าน AWS API Gateway และให้ส่งต่อไปยัง lambda function แต่ดันไม่ยอมถึงสะนี้</p><h3>เริ่มโดยการ config ฝั่ง API Gateway ดังภาพ</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*Q2OJChyzwIEvuvOeZixRgg.png" /></figure><p>เนื่องจากถ้า config ไว้เท่านี้จะยังใช้ไม่ได้ lambda function จะคืน error กลับมาว่า ไม่มีได้ส่ง argument กลับมา</p><p>Code ดังภาพ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*RIuVrmpgBF-puZI2LXbIoA.png" /></figure><h3>How to fix?</h3><p>จริงๆ วิธีแก้ไขมี สองทางหลักๆ</p><h4>[1] Use Lambda proxy integration</h4><p>ทำการเปิด Lambda proxy integration -&gt; true</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*qXehc1z4BTwfxo-5hHOTcg.png" /></figure><p>แล้วทำการ แก้ ตัวขารับจาก struct ปกติไปเป็น</p><pre>func Handler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {<br>    ...<br>}</pre><p>ซึ่งส่วนตัวไม่ค่อยชอบท่านี้เพราะจะทำให้ code ของเราผูกติดกับ APIGateway ของ AWS ทันที รวมไปถึงการเทส local อาจจะทำได้ยาก</p><p><strong>Note:</strong> เนื่องจาก ในส่วน code production ได้ทำการ wrap via docker &amp; build to binary และใช้ `alpine:3.19` ในการรันบน production ทำให้ไม่มี dependency มากนักบน code จึงไม่อยากเพิ่มอีก</p><p>ทำให้เลือกท่าที่ 2 แทน</p><blockquote>Edit: ท่าที่ 1 มีเพิ่มเติมใน Part 2</blockquote><h4>[2] Non-Lambda proxy integration</h4><p>โดยการใช้ Mapping templates ในการ map ตามภาพ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*34AXCntROt2X_X-dhY6qzQ.png" /></figure><p>เท่านี้เราก็ map ข้อมูลจาก path params ไปเป็น event attribute เรียบร้อยยย</p><p>ต่อ Part 2</p><p><a href="https://panachai-ny.medium.com/aws-how-to-mapping-path-params-in-amazon-api-gateway-to-aws-lambda-on-golang-part-2-2-cd274e13c183">[AWS] how to mapping path params in Amazon API Gateway to AWS Lambda on Golang Part 2/2 — PanachaiNY — Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15ca9e26df1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to import AWS infrastructure to Terraform]]></title>
            <link>https://panachai-ny.medium.com/how-to-import-aws-infrastructure-to-terraform-a2a4db4511db?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2a4db4511db</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Mon, 29 Jan 2024 11:06:51 GMT</pubDate>
            <atom:updated>2024-01-29T11:12:29.788Z</atom:updated>
            <content:encoded><![CDATA[<p>เริ่มด้วยเหตุผลว่าทำไมเราต้อง import โดยปกติ AWS จะมีวิธีการ manage resource ค่อนข้างหลากหลาย เช่น manual (คลิกมือ), Infrastructure as Code (AWS CloudFormation, AWS Cloud Development Kit, Terraform)</p><p>ในที่นี้เราจะพูดถึงการ manage resource 2 ส่วน คือ manual และ Terraform</p><h3>Prerequisite</h3><ul><li>Terraform knowledge</li><li>AWS Knowledge</li><li>Deployment process</li></ul><h3>Intro</h3><p>เริ่มจากการที่ Project / Infrastructure อาจจะเริ่มด้วยการทำ manual เพราะเรื่องของ timeline ในการ go live หรืออะไรก็ตามแต่ พอเราทำงานไปเราก็จะพบปัญหาต่างๆ มากมาย เช่น การดีพลอย 2 env แล้วมีความแตกต่างกัน เช่น permission, service, etc. รวมไปถึงการ track versioning ของ infrastructure เราจึงจำเป็นต้องนำ tooling มาช่วย เช่น Infrastructure as Code (IaC) ในที่นี้เราเลือก Terraform เพราะสามารถ จัดการ multi cloud ได้</p><p>จริงๆ จะเรียกว่า import ก็ยังไงๆ อยู่ มันคือการ Map resources จาก AWS ไปยัง terraform state เพื่อให้ Terraform เห็นการเปลี่ยนแปลงจาก remote (ที่เราไปคลิกสร้างไว้ด้านบนก่อนหน้านี้) กับตัว Terraform เป็นตัวเดียวกัน สามารถ plan เห็นการเปลี่ยนแปลงได้</p><p><strong>ตัวอย่าง </strong>ที่ในบทความ จะเป็นการ manage <a href="https://aws.amazon.com/iam/">Amazon IAM</a> account</p><h4><strong>AWS Infrastructure</strong></h4><p>เราได้ทำการสร้าง `github-to-ecr` account ไว้บน IAM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*qlfnNIzgORXLePzJQ6kbKw.png" /></figure><h3>Writing time</h3><p><strong>Example</strong> main.tf</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket = &quot;bondbond-terraform&quot;<br>    key    = &quot;state&quot;<br>    region = &quot;ap-southeast-1&quot;<br>  }<br><br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 5.0&quot;<br>    }<br>  }<br>}<br><br># Configure the AWS Provider<br>provider &quot;aws&quot; {<br>  region = var.region<br>}</pre><h4>ในที่นี้เราจะ manage AWS IAM ด้วย module iam</h4><p>ทำการ สร้าง module ที่หน้า main</p><pre><br>...<br><br>module &quot;iam&quot; {<br>  source   = &quot;./modules/iam&quot;<br>}</pre><h4>ทำการสร้าง files ใน folder modules ตาม path ที่เรา ref ไว้ใน source</h4><pre># main.tf<br><br>resource &quot;aws_iam_user&quot; &quot;gh2ecr&quot; {<br>  name = &quot;github-to-ecr&quot;<br>}</pre><h4><strong>Project structure</strong></h4><pre>.<br>├── example.tfvars<br>├── main.tf<br>├── makefile<br>├── modules<br>│   └──── iam<br>│      └── main.tf<br>├── readme.md<br>└── variables.tf</pre><h4>หลังจากสร้าง module เสร็จให้ทำการ tf init เพื่ออัพเดท terraform state ให้เห็น module ใหม่</h4><pre>terraform init</pre><h4>จากนั้นทำการ import โดยจะระบุไปที่ module ที่เราสร้างไว้ใน main</h4><pre>terraform import module.iam.aws_iam_user.gh2ecr github-to-ecr</pre><p>จะได้</p><pre>Import successful!<br><br>The resources that were imported are shown above. These resources are now in<br>your Terraform state and will henceforth be managed by Terraform.</pre><h4>จากนั้นทำการ plan</h4><pre>terraform plan</pre><p>เมื่อเรา plan จะมี log ออกมาว่ามีอะไร create / update บ้างจาก configuration ปัจจุบันบน terraform diff กับบน remote (aws)</p><p>เราสามารถ ก็อป configuration ที่ออกมาใน log เพิ่มไปใน configuration และทำการ plan ใหม่ จนกว่าจะเหมือนกัน (ในกรณีที่ต้องการ configuration เดิมบน remote)</p><h4>เมื่อพอใจแล้ว ต่อไปทำการ apply</h4><pre>terraform apply</pre><p>เป็นอันเสร็จสิ้นนน</p><p><strong>Note:</strong> log หลายๆ ส่วนจะไม่ได้โชว์ให้ดูนะครับมีความ sensitive สูง</p><h3><strong>Conclusion</strong></h3><p>ซึ่งเราสามารถจะต่อยอดไปใส่ permission ต่างๆ ผ่าน Terraform ได้เลย และสามารถ Repeat deploy infrastructure ได้ง่าย เช่น การ Deploy dev, sit, uat, prod ให้มี Infrastructure เท่ากัน เป็นต้น</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_user">aws_iam_user | Resources | hashicorp/aws | Terraform | Terraform Registry</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2a4db4511db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[mason cli ที่จะช่วยให้การสร้าง feature, package ง่ายขึ้น]]></title>
            <link>https://panachai-ny.medium.com/mason-cli-%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B8%88%E0%B8%B0%E0%B8%8A%E0%B9%88%E0%B8%A7%E0%B8%A2%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-feature-package-%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B8%82%E0%B8%B6%E0%B9%89%E0%B8%99-82a03588fed9?source=rss-a8381aa83da7------2</link>
            <guid isPermaLink="false">https://medium.com/p/82a03588fed9</guid>
            <category><![CDATA[masons]]></category>
            <category><![CDATA[generator]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[PanachaiNY]]></dc:creator>
            <pubDate>Sat, 19 Aug 2023 10:40:14 GMT</pubDate>
            <atom:updated>2023-08-19T10:40:14.204Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is mason</h3><p>เป็น generator code ตัวนึงที่ ที่ให้คุณเรียกใช้ template บน community หรือจะ hand on ด้วยตัวเองก็ได้เช่นกัน เพื่อให้ง่ายต่อการทำงานที่ซ้ำซ้อน</p><p>โดยปกติจะใช้สำหรับ generate feature, package บน flutter</p><h3>Prerequisite</h3><ul><li>dart</li></ul><h3>Install mason</h3><p>ติดตั้ง mason ผ่าน `dart pub` or `brew`</p><pre># 🎯 Activate from https://pub.dev<br>dart pub global activate mason_cli</pre><pre># 🍺 Install from https://brew.sh<br>brew tap felangel/mason<br>brew install mason</pre><p>ref: <a href="https://docs.brickhub.dev/installing#-homebrew">https://docs.brickhub.dev/installing#-homebrew</a></p><h3>Init mason</h3><p>ก่อนจะเริ่มใช้งาน mason จะต้องทำการ init ก่อนครับ ไว้ที่ไหนก็ได้ที่ต้องการ</p><pre>mason init</pre><pre># Result<br>.<br>├── mason.yaml<br>└── readme.md</pre><p><a href="https://github.com/panachainy/mason_bricks_example/pull/1">mason init by panachainy · Pull Request #1 · panachainy/mason_bricks_example</a></p><h3>Brick คือ??</h3><p>brick เปรียบเสมือน template ของสิ่งที่เราอยากจะให้ mason generate ให้ เช่น package, application, model, etc.</p><h4><strong>Example:</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*pArGyApy5PvE98lgKv3BRA.png" /></figure><p>แต่อย่าเพิ่งตกใจไป เราสามารถใช้ brick ที่มีคนทำเอาไว้แล้วได้เช่นกัน</p><h3>What next?</h3><p>วิธีการใช้งานคือ เราสามารถไปหา bricks ที่ <a href="https://brickhub.dev/search">https://brickhub.dev/search</a></p><p>ในตัวอย่างจะใช้ brick model -&gt; <a href="https://brickhub.dev/bricks/model/0.7.1">https://brickhub.dev/bricks/model/0.7.1</a></p><pre># install `model` brick<br>mason add model</pre><h4><strong>Optional</strong></h4><p>เสริมด้วยใส่ .gitignore สำหรับปิด git track ที่ folder .mason</p><pre># .gitignore<br>.mason/</pre><p><a href="https://github.com/panachainy/mason_bricks_example/pull/2">Feat/add by panachainy · Pull Request #2 · panachainy/mason_bricks_example</a></p><h3>How to use?</h3><pre># cli example<br>mason make &lt;your-brick-name&gt;</pre><p>โดยปกติถ้าเป็น brick ง่ายๆ เช่น <a href="https://brickhub.dev/bricks/hello/0.1.0+1">hello brick</a> เราก็ใช้ command ง่ายๆ</p><pre># install<br>mason add hello<br><br># generate<br>mason make hello</pre><p>แต่ในตัวอย่างนี้จะเป็น advance ประมาณนึง ขอไม่อธิบาย แต่เป็น example ให้ดูแทนครับ</p><p>ซึ่งในแต่ละ brick จะมีวิธีใช้งานที่แตกต่างกัน <a href="https://brickhub.dev/bricks/model/0.7.1#readme">model brick doc</a></p><pre>mason make model --model_name user --additionals &#39;[&quot;copyWith&quot;, &quot;json&quot;, &quot;equatable&quot;, &quot;toString&quot;]&#39; --style json_serializable -o ./example</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YnO8ASzLHE0j-0l1Rw8LjA.png" /></figure><p><a href="https://github.com/panachainy/mason_bricks_example/pull/3">mason make by panachainy · Pull Request #3 · panachainy/mason_bricks_example</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82a03588fed9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>