[{"data":1,"prerenderedAt":232},["ShallowReactive",2],{"blog-entry-numbers":3,"notes-2026-01-17-zshhistory":59,"references-notes-2026-01-17-zshhistory":209,"related-blog-notes-2026-01-17-zshhistory":216},[4,7,10,13,16,19,22,25,28,30,33,36,39,42,45,48,51,53,56],{"path":5,"date":6},"\u002Fblogs\u002F2024-01-14-setup-ubuntu-server","2024-01-14",{"path":8,"date":9},"\u002Fblogs\u002F2025-04-24-n8n-part-1","2025-04-24",{"path":11,"date":12},"\u002Fblogs\u002F2025-04-28-n8n-part-2","2025-04-28",{"path":14,"date":15},"\u002Fblogs\u002F2025-05-12-next-dns","2025-05-12",{"path":17,"date":18},"\u002Fblogs\u002F2025-05-18-from-old-notebook-to-home-lab-server","2025-05-18",{"path":20,"date":21},"\u002Fblogs\u002F2025-08-18-ollama-desktop-ui","2025-08-18",{"path":23,"date":24},"\u002Fblogs\u002F2025-08-26-xponology-on-old-pc","2025-08-26",{"path":26,"date":27},"\u002Fblogs\u002F2026-08-03-docker-dind-vs-dood","2026-08-03",{"path":29,"date":27},"\u002Fblogs\u002F2026-08-03-grafana-alloy-loki",{"path":31,"date":32},"\u002Fblogs\u002F2026-08-07-node-exporter-mtls-basic-auth","2026-08-07",{"path":34,"date":35},"\u002Fblogs\u002F2026-09-16-headroom","2026-09-16",{"path":37,"date":38},"\u002Fblogs\u002F2026-10-17-humanizer-skills","2026-10-17",{"path":40,"date":41},"\u002Fblogs\u002F2026-10-27-claude-code-server-management","2026-10-27",{"path":43,"date":44},"\u002Fblogs\u002F2026-11-02-agent-skills-security-check","2026-11-02",{"path":46,"date":47},"\u002Fblogs\u002F2026-11-04-ai-native-sdlc","2026-11-04",{"path":49,"date":50},"\u002Fblogs\u002F2026-11-06-seo-aeo-geo-ai-search","2026-11-06",{"path":52,"date":50},"\u002Fblogs\u002F2026-11-06-sshole",{"path":54,"date":55},"\u002Fblogs\u002F2026-11-09-ai-search-visibility","2026-11-09",{"path":57,"date":58},"\u002Fblogs\u002F2026-11-11-persona-review-subagents","2026-11-11",{"id":60,"title":61,"body":62,"date":191,"description":192,"draft":193,"extension":194,"faq":195,"meta":196,"navigation":197,"next":195,"ogTitle":198,"path":199,"pin":193,"prev":195,"recommends":200,"seo":202,"sitemap":203,"stem":204,"tags":205,"updated":207,"__hash__":208},"notes\u002Fnotes\u002F2026-01-17-zshhistory.md","วิธีแก้ไข zsh_history เสียหาย",{"type":63,"value":64,"toc":187},"minimark",[65,69,73,105,108,111,114,117,180,183],[66,67,68],"h2",{"id":68},"ปัญหาที่เจอ",[70,71,72],"p",{},"สำหรับชาว Dev ที่ใช้ ZSH อาจจะเคยเจอเหตุการณ์เปิด Terminal ขึ้นมาแล้วเจอ Error แจ้งเตือนเกี่ยวกับ History file พังแบบนี้ครับ",[74,75,80],"pre",{"className":76,"code":77,"language":78,"meta":79,"style":79},"language-sh shiki shiki-themes material-theme-lighter one-dark-pro github-dark","zsh: corrupt history file \u002Fhome\u002Fpi\u002F.zsh_history\n","sh","",[81,82,83],"code",{"__ignoreMap":79},[84,85,88,92,96,99,102],"span",{"class":86,"line":87},"line",1,[84,89,91],{"class":90},"sosa_","zsh:",[84,93,95],{"class":94},"sAlJX"," corrupt",[84,97,98],{"class":94}," history",[84,100,101],{"class":94}," file",[84,103,104],{"class":94}," \u002Fhome\u002Fpi\u002F.zsh_history\n",[70,106,107],{},"ซึ่งปัญหานี้จะทำให้เราไม่สามารถกดลูกศรขึ้น-ลง เพื่อเรียกดูคำสั่งเก่า ๆ ที่เคยพิมพ์ไปได้ ซึ่งสาเหตุมักเกิดจากเครื่องดับไปดื้อ ๆ หรือโปรแกรมปิดไม่สมบูรณ์ครับ",[66,109,110],{"id":110},"วิธีแก้ไข",[70,112,113],{},"วิธีแก้นั้นง่ายมากครับ ไม่ต้องลบ History ทิ้งทั้งหมด หลักการคือเราจะย้ายไฟล์ที่เสียไปพักไว้ก่อน แล้วใช้คำสั่ง strings เพื่อดึงเฉพาะข้อความที่อ่านรู้เรื่องกลับมาใส่ไฟล์ใหม่ครับ",[70,115,116],{},"พิมพ์ตามนี้ได้เลย หรือจะก๊อปไปวางทีละบรรทัดก็ได้ครับ",[74,118,120],{"className":76,"code":119,"language":78,"meta":79,"style":79},"cd ~\nmv .zsh_history .zsh_history_bad\nstrings .zsh_history_bad > .zsh_history\nfc -R .zsh_history\nrm ~\u002F.zsh_history_bad\n",[81,121,122,131,143,159,171],{"__ignoreMap":79},[84,123,124,128],{"class":86,"line":87},[84,125,127],{"class":126},"sJZfL","cd",[84,129,130],{"class":94}," ~\n",[84,132,134,137,140],{"class":86,"line":133},2,[84,135,136],{"class":90},"mv",[84,138,139],{"class":94}," .zsh_history",[84,141,142],{"class":94}," .zsh_history_bad\n",[84,144,146,149,152,156],{"class":86,"line":145},3,[84,147,148],{"class":90},"strings",[84,150,151],{"class":94}," .zsh_history_bad",[84,153,155],{"class":154},"sbGrh"," >",[84,157,158],{"class":94}," .zsh_history\n",[84,160,162,165,169],{"class":86,"line":161},4,[84,163,164],{"class":126},"fc",[84,166,168],{"class":167},"sEoV_"," -R",[84,170,158],{"class":94},[84,172,174,177],{"class":86,"line":173},5,[84,175,176],{"class":90},"rm",[84,178,179],{"class":94}," ~\u002F.zsh_history_bad\n",[70,181,182],{},"เท่านี้ zsh_history ของเราก็จะกลับมาใช้งานได้ปกติ กดดูคำสั่งย้อนหลังได้เหมือนเดิมแล้วครับ!",[184,185,186],"style",{},"html pre.shiki code .sosa_, html code.shiki .sosa_{--shiki-light:#E2931D;--shiki-default:#61AFEF;--shiki-dark:#B392F0}html pre.shiki code .sAlJX, html code.shiki .sAlJX{--shiki-light:#91B859;--shiki-default:#98C379;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJZfL, html code.shiki .sJZfL{--shiki-light:#6182B8;--shiki-default:#56B6C2;--shiki-dark:#79B8FF}html pre.shiki code .sbGrh, html code.shiki .sbGrh{--shiki-light:#39ADB5;--shiki-default:#ABB2BF;--shiki-dark:#F97583}html pre.shiki code .sEoV_, html code.shiki .sEoV_{--shiki-light:#91B859;--shiki-default:#D19A66;--shiki-dark:#79B8FF}",{"title":79,"searchDepth":133,"depth":133,"links":188},[189,190],{"id":68,"depth":133,"text":68},{"id":110,"depth":133,"text":110},"2026-01-17","วิธีแก้ error zsh corrupt history file ด้วยคำสั่ง strings โดยไม่ต้องลบ history เก่าทิ้งทั้งหมด",false,"md",null,{},true,"How to fix a corrupt zsh history file","\u002Fnotes\u002F2026-01-17-zshhistory",[201],"2025-12-28-zshrc-config-folder.md",{"title":61,"description":192},{"loc":199,"lastmod":191},"notes\u002F2026-01-17-zshhistory",[206],"Development","2026-08-09","cxO71Hft8cT0FMHn9KrGdorDWSxIJvRXTtqmpKiLIgQ",[210],{"id":211,"path":212,"title":213,"date":214,"tags":215},"notes\u002Fnotes\u002F2025-12-28-zshrc-config-folder.md","\u002Fnotes\u002F2025-12-28-zshrc-config-folder","ย้าย .zshrc ไปยัง .config folder","2025-12-28",[206],[217,224,226],{"id":218,"path":219,"title":220,"date":221,"tags":222},"notes\u002Fnotes\u002F2026-03-30-how-to-use-uv.md","\u002Fnotes\u002F2026-03-30-how-to-use-uv","เริ่มต้นใช้งาน uv ตัวจัดการ Python แห่งยุค 2026","2026-03-30",[206,223],"Python",{"id":211,"path":212,"title":213,"date":214,"tags":225},[206],{"id":227,"path":228,"title":229,"date":230,"tags":231},"notes\u002Fnotes\u002F2025-11-03-dirsearch-uv.md","\u002Fnotes\u002F2025-11-03-dirsearch-uv","แก้ dirsearch ติดตั้งด้วย uv แล้วเจอ No module named 'pkg_resources'","2025-11-03",[206],1795352420694]