Rust port of the Terry Davis' (RIP) "god says" program

Overview

terry

RIP Terry A. Davis 1969-2018

god says

Rust port of the programmer Terry Davis' "god says" (AKA GodSpeaks) program.


Terrence Andrew Davis (December 15, 1969 – August 11, 2018) was an American programmer who created and designed the operating system TempleOS alone. It was a highly complex and unusual undertaking for one person, as the project extended to building core components such as programming language, editor, compiler and kernel virtually from scratch. Davis also posted video blogs to social media, and by the time of his death, had amassed a small online following. He often referred to himself as "the smartest programmer that's ever lived". From Wikipedia.

About TempleOS, from his own words:

TempleOS is God's official temple. Just like Solomon's temple, this is a community focal point where offerings are made and God's oracle is consulted.

Contained in Terry's TempleOS masterpiece were various random text generators. Terry believed that by generating this text one could "speak to God". Through making random associations in the text, much like a Rorschach ink-blot test.

For that purpose, he designed a random number generator called god, and used it in TempleOS to generate text.

The original source of this program can be found here.

Besides the original program which was written in HolyC, he was using a bash script to generate text:

#!/bin/bash
# This prints random words.
echo "$(gshuf -n 32 ./Happy.TXT --random-source=/dev/urandom | tr '\n' ' ')"

So I reproduced this logic in Rust and created a simple CLI program (godsays) and a webserver (godsays-server) for extended use-cases (and tribute to TAD).

Please note that some of the words may be offensive - I am merely using Terry's original wordlist and thus cannot be held responsible for any of the views expounded by God in the generated text. The only modification that has been made to Terry's text is the replacement of underscores with spaces.

Installation

Install the CLI tool from crates.io:

cargo install godsays

Usage

CLI

godsays command line tool simply selects 32 random words from Happy.TXT and prints them out.

cargo run

output:

sloth special case I'll ask nicely incredibly in a galaxy far far away what do you want I'm done slumin oh no the enquirer really by the way that's for me to know Isn't that special don't mention it baffling furious I'll think about it Han shot first downer unsung hero super computer horrendous ahh who's to say You da man I give up cosmetics it'd take a miracle stuff holy grail I'll be back

* Use of the --release flag embeds the Happy.TXT into the binary.

Docker

Pull the latest image from Docker Hub and run the container:

docker pull orhunp/godsays
docker run -t orhunp/godsays

Or do it manually:

docker build -f docker/cli/Dockerfile -t godsays .
docker run -t godsays

Server

godsays-server is a simple HTTP server with the same purpose of godsays. It returns the randomly generated text on a GET / request. (Use GET /json for JSON output)

curl https://godsays.xyz

output:

ba ha you know a better God do not disturb its trivial obviously ho ho ho failure to communicate if anything can go wrong do you like it in a perfect world that's all folks eh Mission Accomplished super computer Trump kick back vice liberal gosh baffling I'm in suspense holier than thou frown in a galaxy far far away in practice China tree hugger scum snap out of it I'm on a roll joyful money what's it to you

to run locally:

cargo run --features server --bin godsays-server

* A fun use case is creating a git alias as follows:

git config --global alias.godsays '!git commit -m "$(curl -s https://godsays.xyz)"'

Docker

Pull the latest image from Docker Hub and run the container:

docker pull orhunp/godsays-server
docker run --rm -e "ADDR=0.0.0.0:3000" -dp 3000:3000 orhunp/godsays-server

Or do it manually:

docker build -f docker/server/Dockerfile -t godsays-server .
docker run --rm -e "ADDR=0.0.0.0:3000" -dp 3000:3000 godsays-server

See also

License

The MIT License

Copyright

Copyright © 2021, Orhun Parmaksız

You might also like...
Tendermint in Rust!

tendermint.rs Tendermint in Rust with TLA+ specifications. Tendermint is a high-performance blockchain consensus engine for Byzantine fault tolerant a

A Rust library for generating cryptocurrency wallets
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Implementation of the Kademlia DHT protocol in Rust
Implementation of the Kademlia DHT protocol in Rust

kademlia-dht Simple implementation of the Kademlia DHT protocol in Rust with state dumping features for educational purposes (not production-ready). T

Collection of Key Derivation Functions written in pure Rust

RustCrypto: Key Derivation Functions Collection of Key Derivation Functions (KDF) written in pure Rust. Supported Algorithms Algorithm Crate Crates.io

Cryptocurrencies trend-following trading bot sandbox written in Rust.

Trend trading bot Experiments repo about (crypto) trend trading. By "trend" I mean trading following the trend using technical indicators (vs other ki

Martinez is vNext Ethereum implementation written in pure Rust with Erigon architecture as design.
Martinez is vNext Ethereum implementation written in pure Rust with Erigon architecture as design.

🧬 Martinez 🧬 Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture. Why run Martinez? Look at

Fully typed access to the Erigon db in rust

Overview Fully typed access to the Erigon database in rust. use erigon_db::{Erigon, env_open}; use ethereum_types::Address; fn main() - eyre::Result

Basically a KrabsETW rip-off written in Rust

FerrisETW 🦀 Basically a KrabsETW rip-off written in Rust, hence the name Ferris 🦀 All credits go to the team at Microsoft who develop KrabsEtw, with

rip is a command-line deletion tool focused on safety, ergonomics, and performance

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

A copy of ziad87 "very stupid thing" (rip). Now in v2: Electric Boogaloo

IPv6-Place-v2 A re-implementation of ziad87's awesome "Place: IPv6" site. Written in Rust with Axum using Server-Sent-Events for the fun instead of WS

A pure, low-level tensor program representation enabling tensor program optimization via program rewriting

Glenside is a pure, low-level tensor program representation which enables tensor program optimization via program rewriting, using rewriting frameworks such as the egg equality saturation library.

A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Note: This is a fork of the original serialport-rs project on GitLab. Please note there have been some changes to both the supported targets and which

An app which reads data from a serial port and serves it on a TCP port.

serial-to-tcp An app which reads data from a serial port and serves it on a TCP port. How to use Clone this repo and build the app as outlined below (

A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance.

png_defringe_rs png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance. U

Port Finance Variable Rate Lending & Liquidity Mining Program
Port Finance Variable Rate Lending & Liquidity Mining Program

Port Variable Rate Lending Forked from Solana Token Lending Bug Bounty We have partnered with Immunefi to offer bug bounty up to 500K: https://immunef

Another Network Tunnel; A simple program for local/remote port forwarding over a SSH tunnel.

🐜 ANT Another Network Tunnel; A simple program for local/remote port forwarding over a SSH tunnel. Table of Contents Installation Pre-requisites Pre-

A simple program for C program IO testing. Written in Rust

A simple program for C program IO testing. Written in Rust, using concurrency to speed up valgrind testing. Make sure to update settings at your first run of the program!

That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

📌 This program is designed to translate text into the correct layout when typing is incorrect. 📌 Example ghbdtn - привет Just (by default) pressing

Comments
  • SIGABRT

    SIGABRT

    I tried installing with just cargo install godsays and it isn't working unfortunately. I get the following: thread 'main' panicked at 'Unable to read the file', /home/da5id/.cargo/registry/src/github.com-1ecc6299db9ec823/godsays-0.1.2/src/lib.rs:24:38 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace fish: Job 1, 'godsays' terminated by signal SIGABRT (Abort)

    opened by umop3plsdn 2
Releases(0.1.4)
  • 0.1.4(Aug 4, 2022)

    • Include the Terry's wordlist in the crates.io release (#3)
    • Automate crates.io releases
    • Enable funding for the project (check out my GitHub Sponsors page 💖)
    • Bump dependencies

    “What’s reality? I don’t know. When my bird was looking at my computer monitor I thought, ‘That bird has no idea what he’s looking at.’ And yet what does the bird do? Does he panic? No, he can’t really panic, he just does the best he can. Is he able to live in a world where he’s so ignorant? Well, he doesn’t really have a choice. The bird is okay even though he doesn’t understand the world. You’re that bird looking at the monitor, and you’re thinking to yourself, ‘I can figure this out.’ Maybe you have some bird ideas. Maybe that’s the best you can do.” ― Terry A. Davis

    Source code(tar.gz)
    Source code(zip)
  • 0.1.3(Apr 10, 2022)

  • 0.1.2(Jan 26, 2022)

  • 0.1.1(Jul 22, 2021)

    Release v0.1.1

    • Use musl builder for docker images (8c8c46ef3a155ff76b4b1f5c059be61a6f52092c)
    • Automate docker builds with github actions (72219713ed5aab9f20fe6e5e03bbef7897f3fe2f)
    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Jun 22, 2021)

Owner
Orhun Parmaksız
FOSS developer, @archlinux packager, oxidizing things
Orhun Parmaksız
Coinbase pro client for Rust

Coinbase pro client for Rust Supports SYNC/ASYNC/Websocket-feed data support Features private and public API sync and async support websocket-feed sup

null 126 Dec 30, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Holochain License: This repository contains the core Holochain libraries and binaries. This is the most recent and well maintained version of Holochai

Holochain 737 Dec 28, 2022
DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.

Holochain-rust Travis: Circle CI: Codecov: License: This code is loosely based on the previous Golang prototype. Code Status: This Rust version is alp

Holochain 1k Jan 3, 2023
IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Informal Systems 296 Jan 4, 2023
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

Sigma Prime 2.1k Jan 1, 2023
Official Rust implementation of the Nimiq protocol

Nimiq Core implementation in Rust (core-rs) Rust implementation of the Nimiq Blockchain Core Nimiq is a frictionless payment protocol for the web. Thi

Nimiq 72 Sep 23, 2022
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Parity Technologies 183 Sep 8, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022