惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News | PayPal Newsroom
Cloudbric
Cloudbric
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Vulnerabilities – Threatpost
Attack and Defense Labs
Attack and Defense Labs
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
S
Secure Thoughts
T
Tor Project blog
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Securelist
T
Tenable Blog
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
T
Troy Hunt's Blog
量子位
大猫的无限游戏
大猫的无限游戏
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
D
Docker
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
博客园 - 叶小钗
腾讯CDC
The Hacker News
The Hacker News
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Martin Fowler
Martin Fowler

Hacker News

Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line Building a Z-Machine in the worst possible language High-Level Rust: Getting 80% of the Benefits with 20% of the Pain GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The air throughout our homes is infused with microplastics. But there are things you can do to breathe less of them The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong Artemis II crew splashes down near San Diego after historic moon mission We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Cooperative Vectors Introduction | Evolve Keeping a Postgres queue healthy — PlanetScale Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? The Zettelkasten Method in Obsidian: A Practical Setup Guide Artemis II Is Competency Porn and We Are Starving For It WeakC4 Flight Viz — Cockpit View A Mexican surveillance giant you’ve never heard of is now watching the U.S. border Surelock: Deadlock-Free Mutexes for Rust RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu The Problem That Built an Industry How Much Linear Memory Access Is Enough? | Solidean Investigating Split Locks on x86-64 Simplest hash functions Sybilproof reputation mechanisms (2005) [pdf] What is a property? How Complex is my Code? Static code analysis in Kotlin — tools overview Toffoli gates are all you need PGLite evangelism dcmake: a new CMake debugger UI Clojure on Fennel part one: Persistent Data Structures Fragments: April 2 Python Release Python install manager 26.1 The Life and Death of the Book Review - Liberties Introducing Database Traffic Control — PlanetScale Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Building slogbox Apple Silicon and Virtual Machines: Beating the 2 VM Limit Who was “Not Even Wrong” first? Pokemon Evolution Vs Darwinian Evolution The APL Programming Language Source Code
Getting my daily news from a dot matrix printer
2026-04-25 · via Hacker News

For a while now I've started my day by unlocking my phone and scrolling through different news and social media sites to see what's going on. It's not exactly great for my mental health and I've been trying to cut down on screen time for a while. I still want to stay up-to-date though, especially after I get up in the morning.

I recently purchased a dot matrix printer from eBay, and thought it would be a great excuse to have a custom "front page" printed out and ready for me each day. So, that's what I built!

Printer ASMR noises in the video below 👇

I'll take this article to dive in and show you what I used, how I set it up, and the PHP script that powers it all.

Interested in that full source code? Check it out on the GitHub repo!

Purchasing the hardware

The supply list for this project was pretty small, and with the exception of the printer, most of this can be found on Amazon or other online retailers.

  • Dot matrix printer
  • Raspberry Pi Zero W [link]
  • Serial to USB adapter [link]
  • Power supply

The printer I purchased was a Star NP-10 from what looks like the mid-80's. I can't be 100% sure, but any dot matrix printer with a serial port should do the trick. The prices range from about $80-120 USD, but I was able to get this one for about half that price because it was marked as "unsure if working".

It did need a little cleaning up and some tuning of the ink ribbon cartridge (isn't that cool, it's like a typewriter!), but after that it fired right up and ran through the test page print.

After that, I hooked everything up. The Raspberry Pi is connected to my WiFi, and then via USB to the serial port of the printer. After turning on the printer and sshing into the Pi, I can verify that the printer is available at /dev/usb/lp0.

Now, how do I get this thing to print?

Figuring out the printer's code

Because the printer is available at lp0 I wanted to see if I could just echo raw text to it and have it come through the printer. So I ran the following:

echo "Hello, world!" > /dev/usb/lp0

Which resulted in an error that the file couldn't be accessed. Bummer, a permissions issue. Easily fixed though with some chmod'ing:

sudo chmod 666 /dev/usb/lp0

There might be a better way to handle that, but it allowed my echo to go through, and I saw the text available on the printer! Alright, I can send raw data to the printer via this file, so let's find a way to scale this up.

I use PHP as my language of choice in a day-to-day basis, and this is no exception. I write a basic script that accesses the file through fopen() and starts writing text to it. I try a few sentences, some spacing, and then some unicode art, but quickly find out that there's not as much character support on the printer as I was sending.

Picture of a printed sheet showing a bunch of wrongly-encoded characters

So I thought it was about time that I start digging into how this thing actually works. Thanks to the hard work and dedication of internet hoarders, I found a full manual for the printer scanned and uploaded as a PDF.

Come to find out, either because of the age or just the manufacturing decision, this printer has a very specific character set that it accepts. Loosely based off of the IBM PC's Code Page 437 it consists mostly of your standard alpha-numeric characters, but with a small set of special symbols, lines, and boxes. Neat!

Sending these characters to the printer is pretty straightforward, I can just echo out the hex values with PHP like so:

$horizontalDouble = "\xCD";

$deg = "\xF8";

echo str_repeat($horizontalDouble, 24);

echo '78' . $deg . 'F' . PHP_EOL;

Alright, so I'm able to write text to the printer just fine, and include some special characters and design symbols. Now I need to figure out what I want to see every morning.

Gathering the data

I knew I wanted four distinct sections for my personal front page: weather, stocks, major news headlines, and a few top reddit posts. After all, that's usually what I end up look at on my phone in the morning.

Additionally, since this is an experimental project, I wanted to remain super cheap for this data, free if at all possible. Thankfully there's an amazing GitHub repo for free and public APIs, so I just went through there and found the ones I needed.

  • The weather pulls from Open-Meteo and no API key is needed
  • Stocks data pulls from twelvedata that offers a generous free tier
  • News headlines pull from NYTimes which has a decent free tier, good enough for this project
  • Reddit posts pull from Reddit JSON which is free (but I had to spoof my User-Agent)

For each of the sections, I wrote some basic PHP code to pull in the payload from the API endpoint and compile the data I wanted into a larger overall array. I only wanted specific stocks, types of headlines, and subreddit posts, and if any of the sections couldn't have data to present I just simply crash the script early so I can start it again at a later time.

This can be seen in this snippet which I use for pulling news headlines:

// Get news headlines data

echo "Fetching news headlines data..." . PHP_EOL;

$newsUrl = NEWS . "?api-key=" . NEWSKEY;

$newsData = [];

$newsAmount = 0;

$data = json_decode(file_get_contents($newsUrl), true);

if (!isset($data['results'])) {

die("Unable to retrieve news data");

}

foreach ($data['results'] as $article) {

if (

($article['type'] === 'Article') &&

(in_array($article['section'], ['U.S.', 'World', 'Weather', 'Arts'])) &&

($newsAmount < MAXNEWS)

) {

$newsData[] = $article;

$newsAmount++;

}

}

The NEWS, NEWSKEY, and MAXNEWS variables are all constants instantiated at the top of the script for easy editing.

Running this compiles everything I want to see displayed on the paper, but now I need to take on the actual task of formatting everything for the printer, and sending it the raw data.

Printing out my front page

I could just print out a heading for each section, but that's a little boring. I wanted a bit of flair to the project, so I decided to have a box at the top displaying the current date, day of the week, and my front page name all nicely bordered.

It took a little math, but I got everything working by using a combination of the hex values I talked about above, str_repeat and the knowledge that the page width for this printer is 80 characters.

Now, just simply go through each section, print a little heading:

str_repeat($horizontalSingle, 3) . " WEATHER " . str_repeat($horizontalSingle, (PAGEWIDTH - 9)) . "\n";

And then print out the data that I want displayed for that section:

" " . round(($weatherData['daily']['daylight_duration'][0] / 3600), 2) . "h of Sunlight - Sunrise: " . date('g:ia', strtotime($weatherData['daily']['sunrise'][0])) . " - Sunset: " . date('g:ia', strtotime($weatherData['daily']['sunset'][0])) . "\n";

For the weather and stocks, I knew I wouldn't hit the edge of the paper so I just wrote everything in single long lines. But that's different for the news headlines and Reddit posts.

If I just feed the printer one long line of text, it's smart enough to cut it and start printing on another line. But, I didn't want a word getting cut off in the middle and starting on the next line. So I implemented a small function to handle line length and instead return back an array of lines with a max length corresponding to the page width.

function splitString($string, $maxLength = PAGEWIDTH) {

$result = [];

$words = explode(' ', $string);

$currentLine = '';

foreach ($words as $word) {

if (strlen($currentLine . $word) <= $maxLength) {

$currentLine .= ($currentLine ? ' ' : '') . $word;

} else {

if ($currentLine) {

$result[] = $currentLine;

$currentLine = $word;

} else {

// If a single word is longer than maxLength, split it

$result[] = substr($word, 0, $maxLength);

$currentLine = substr($word, $maxLength);

}

}

}

if ($currentLine) {

$result[] = $currentLine;

}

return $result;

}

Then I can just use it like so:

foreach (splitString($redditPost) as $line) {

fwrite($printer, $line) . "\n";

}

Now all that's left to do is run the script!

Usage and wrapping up

I can fire off the printer manually by just running php print.php but I've instead set up a cron job to handle it for me.

Every morning at around 8am it starts printing out my personalized front page. I rip it off and check it out in the morning while drinking my coffee.

Example page printed

As silly as it might sound, it just feels better having that finite amount of news on a single sheet of paper. Of being able to stop there instead of endlessly scrolling through websites and social media apps.

Also, this was a super fun project and I'm hoping I can find more uses for this dot matrix printer. Working with physical hardware (especially older specimens like this) is always a blast for me, and being able to integrate them with new technology or use them in interesting ways just ignites pure passion and reinforces why I became a programmer in the first place.

So, what do you think? If you have any ideas for projects like this, or just have a question or comment, I'd love to hear it! Catch me on Twitter if you'd like to chat more.

My Newsletter

Subscribe using the form below and about 2-3 times a month you'll receive an email containing project updates, video previews, and inspiring links I've found across the web dev and tech space.