<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go on Hsing-Yu Shih</title><link>https://www.hugoshih.com/tags/go/</link><description>Recent content in Go on Hsing-Yu Shih</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Sun, 16 Aug 2026 23:04:50 +0800</lastBuildDate><atom:link href="https://www.hugoshih.com/tags/go/index.xml" rel="self" type="application/rss+xml"/><item><title>CineTTY A Tiny Tool That Makes Your Terminal Look Like a Movie Hacker Scene</title><link>https://www.hugoshih.com/p/cinetty/</link><pubDate>Sun, 16 Aug 2026 23:04:50 +0800</pubDate><guid>https://www.hugoshih.com/p/cinetty/</guid><description>&lt;img src="https://www.hugoshih.com/p/cinetty/cover.jpg" alt="Featured image of post CineTTY A Tiny Tool That Makes Your Terminal Look Like a Movie Hacker Scene" /&gt;&lt;p&gt;I recently built a little toy with almost no practical purpose, but it makes a computer look as if it is doing something extremely important: &lt;a class="link" href="https://github.com/h920032/cinetty" target="_blank" rel="noopener"&#10; &gt;CineTTY&lt;/a&gt;. It automatically types C code, updates system metrics, and scrolls kernel events to create a cinematic hacker-workstation effect.&lt;/p&gt;&#10;&lt;p&gt;Everything on screen is simulated. CineTTY never compiles the displayed code, scans a network, or changes the system.&lt;/p&gt;&#10;&lt;h2 id="origin"&gt;Origin&#10;&lt;/h2&gt;&lt;p&gt;The project originated while I was filming promotional videos with friends. Several shots needed to suggest an engineer or hacker at work, with source code, system information, and rapidly scrolling text on screen.&lt;/p&gt;&#10;&lt;p&gt;We tried online tools, including the classic &lt;a class="link" href="https://github.com/abishekvashok/cmatrix" target="_blank" rel="noopener"&#10; &gt;cmatrix&lt;/a&gt;. Its falling green characters are instantly recognizable, but the effect was too simple for a busy engineering workstation. More elaborate macOS tools existed, but some required extra runtimes, packages, or terminal libraries and were inconvenient to use across platforms.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;I wanted something that installed easily, started with one command, and looked consistent on Linux, macOS, and Windows.&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;CineTTY draws three panels inside one screen rather than creating real tmux panes:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;An automatically typing C editor on the left.&lt;/li&gt;&#10;&lt;li&gt;An htop-style system monitor at the upper right.&lt;/li&gt;&#10;&lt;li&gt;A continuously scrolling kernel event stream at the lower right.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The earliest prototype included Matrix rain and an interactive console. I replaced both with an autonomous display: run &lt;code&gt;cinetty&lt;/code&gt;, and it continues like a workstation in the middle of a build, debugging session, or system incident.&lt;/p&gt;&#10;&lt;p&gt;&lt;img alt="CineTTY in action" class="gallery-image" data-flex-basis="426px" data-flex-grow="177" height="405" loading="lazy" sizes="(max-width: 767px) calc(100vw - 30px), (max-width: 1023px) 700px, (max-width: 1279px) 950px, 1232px" src="https://www.hugoshih.com/p/cinetty/output.gif" width="720"&gt;&lt;/p&gt;&#10;&lt;h2 id="features"&gt;Features&#10;&lt;/h2&gt;&lt;h3 id="a-self-typing-c-editor"&gt;A self-typing C editor&#10;&lt;/h3&gt;&lt;p&gt;The left panel simulates a Linux kernel-style C editor with line numbers, syntax colors, a cursor, revision information, and progress. CineTTY generates fictional code using familiar concepts such as schedulers, memory, IRQs, DMA, and networking, but never compiles or executes it.&lt;/p&gt;&#10;&lt;p&gt;To avoid a short repeating animation, the generated source is at least 100 times longer than the original preamble and rolls for well over an hour at the default speed.&lt;/p&gt;&#10;&lt;h3 id="a-dense-htop-style-monitor"&gt;A dense htop-style monitor&#10;&lt;/h3&gt;&lt;p&gt;The upper-right panel imitates a dense htop display with:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Per-core CPU meters&lt;/li&gt;&#10;&lt;li&gt;Memory and swap usage&lt;/li&gt;&#10;&lt;li&gt;Tasks, threads, load averages, and uptime&lt;/li&gt;&#10;&lt;li&gt;Network traffic, disk I/O, and temperature&lt;/li&gt;&#10;&lt;li&gt;A continuously changing process table&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The layout adapts to the terminal and fills the available panel. It requires at least &lt;code&gt;70 × 22&lt;/code&gt;; below that size, CineTTY displays a resize message.&lt;/p&gt;&#10;&lt;h3 id="a-fast-kernel-event-stream"&gt;A fast kernel event stream&#10;&lt;/h3&gt;&lt;p&gt;The lower-right panel generates fictional events involving IRQs, schedulers, network packets, NVMe, filesystems, DMA, and systemd. Message lengths and types vary, and CineTTY never runs &lt;code&gt;dmesg&lt;/code&gt; or reads real logs.&lt;/p&gt;&#10;&lt;h2 id="installation"&gt;Installation&#10;&lt;/h2&gt;&lt;p&gt;The easiest method is Homebrew, followed by &lt;code&gt;cinetty&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew install h920032/cinetty/cinetty&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cinetty&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;The formula supports macOS and Linux. Alternatively, the installer downloads the correct release, verifies its SHA-256 checksum, and places it in &lt;code&gt;~/.local/bin&lt;/code&gt;:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://raw.githubusercontent.com/h920032/cinetty/main/install.sh &lt;span class="p"&gt;|&lt;/span&gt; sh&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;With Go 1.22 or newer, install from source:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;go install github.com/h920032/cinetty@latest&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Windows users can download &lt;code&gt;cinetty_windows_amd64.zip&lt;/code&gt; from the &lt;a class="link" href="https://github.com/h920032/cinetty/releases/latest" target="_blank" rel="noopener"&#10; &gt;latest GitHub release&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="controls"&gt;Controls&#10;&lt;/h2&gt;&lt;p&gt;CineTTY runs autonomously and keeps only a few controls:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;Space&lt;/code&gt; pauses or resumes the display.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Q&lt;/code&gt;, &lt;code&gt;Esc&lt;/code&gt;, or &lt;code&gt;Ctrl-C&lt;/code&gt; exits CineTTY.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Green, Cyan, and Amber themes are available, along with adjustable typing speed and frame rate:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cinetty -theme cyan -speed 1.5&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cinetty -theme amber -fps &lt;span class="m"&gt;60&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cinetty -no-color&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cinetty -version&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;code&gt;-speed&lt;/code&gt; accepts &lt;code&gt;0.2&lt;/code&gt; to &lt;code&gt;5.0&lt;/code&gt;, while &lt;code&gt;-fps&lt;/code&gt; accepts 10 to 60.&lt;/p&gt;&#10;&lt;h2 id="why-go"&gt;Why Go?&#10;&lt;/h2&gt;&lt;p&gt;The earliest prototype was written in Python, but I wanted users to download one file and run it without extra runtimes or packages. I rewrote CineTTY in Go using only the standard library. The result is a single native executable with no runtime dependency on Go or third-party modules; ANSI escape sequences and platform terminal APIs handle rendering and input.&lt;/p&gt;&#10;&lt;p&gt;Releases currently include:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Linux x86-64 and ARM64&lt;/li&gt;&#10;&lt;li&gt;macOS Intel and Apple Silicon&lt;/li&gt;&#10;&lt;li&gt;Windows x86-64&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="conclusion"&gt;Conclusion&#10;&lt;/h2&gt;&lt;p&gt;CineTTY is not a real monitor or editor, but it still behaves like a complete tool: it installs with one command, runs across platforms, adapts to terminal size, and restores the original screen when it exits. It works well for filming, demo backgrounds, or simply making a terminal feel cinematic for a while.&lt;/p&gt;&#10;&lt;p&gt;The source is available under the MIT License. Feel free to try it, report a problem, or help add even more needlessly dramatic effects:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/h920032/cinetty" target="_blank" rel="noopener"&#10; &gt;CineTTY GitHub repository&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/h920032/cinetty/releases/latest" target="_blank" rel="noopener"&#10; &gt;Download the latest release&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;</description></item></channel></rss>