{"id":13657010,"url":"https://github.com/shlomif/fortune-mod","last_synced_at":"2025-04-07T22:11:41.068Z","repository":{"id":37359574,"uuid":"55313340","full_name":"shlomif/fortune-mod","owner":"shlomif","description":"Implementation of the Unix fortune command for displaying a random quotation, for Linux and other systems.","archived":false,"fork":false,"pushed_at":"2024-10-01T04:57:41.000Z","size":9132,"stargazers_count":418,"open_issues_count":4,"forks_count":59,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-11T21:44:38.956Z","etag":null,"topics":["floss","fortune","fortune-cookie","fortune-mod","foss","hacktoberfest","linux","open-source","opensource","quote","quotes","quotes-application","unix"],"latest_commit_sha":null,"homepage":"http://www.shlomifish.org/open-source/projects/fortune-mod/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shlomif.png","metadata":{"files":{"readme":"README.asciidoc","changelog":null,"contributing":"CONTRIBUTING.asciidoc","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-02T19:53:17.000Z","updated_at":"2024-10-09T04:46:26.000Z","dependencies_parsed_at":"2024-01-03T04:14:46.761Z","dependency_job_id":"c7db5d7d-56f4-465c-aeef-408295177202","html_url":"https://github.com/shlomif/fortune-mod","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlomif%2Ffortune-mod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlomif%2Ffortune-mod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlomif%2Ffortune-mod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shlomif%2Ffortune-mod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shlomif","download_url":"https://codeload.github.com/shlomif/fortune-mod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737788,"owners_count":20987721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floss","fortune","fortune-cookie","fortune-mod","foss","hacktoberfest","linux","open-source","opensource","quote","quotes","quotes-application","unix"],"created_at":"2024-08-02T05:00:35.777Z","updated_at":"2025-04-07T22:11:41.044Z","avatar_url":"https://github.com/shlomif.png","language":"C","funding_links":[],"categories":["Just for Fun","C"],"sub_categories":["Image Conversion"],"readme":"== fortune-mod Maintenance Version and Ongoing Development\n\n[link=https://travis-ci.com/shlomif/fortune-mod]\nimage::https://travis-ci.com/shlomif/fortune-mod.svg?branch=master[Travis-CI Build Status]\n\n[link=https://ci.appveyor.com/project/shlomif/fortune-mod/branch/master]\nimage::https://ci.appveyor.com/api/projects/status/0pbvqd1xa7777aoo/branch/master?svg=true[AppVeyor Build status]\n\nThis GitHub repository maintains the sources for fortune-mod, a version\nof https://en.wikipedia.org/wiki/Fortune_%28Unix%29[the UNIX “fortune”\ncommand]. `fortune` is a command-line utility which displays a random\nquotation from a collection of quotes. This collection is read from the\nlocal https://en.wikipedia.org/wiki/File_system[file system] and does\nnot require network access. A large collection of quotes is provided in\nthe download and installed by default, but more quote collections can be\nadded by the user.\n\nThe canonical repository for the time being is:\nhttps://github.com/shlomif/fortune-mod . In the future, we may create a\nGitHub organization for it, and move the sources there.\n\nFor more information about it, you can contact\nhttps://www.shlomifish.org/[Shlomi Fish] .\n\n=== Installation\n\nOn Fedora and other rpm-based distributions:\n\n....\nsudo dnf install fortune-mod\n....\n\n( RHEL and CentOS users may opt to try https://github.com/shlomif/fortune-mod/issues/47#issuecomment-917565752[the EPEL packages]. )\n\nOn Arch Linux and derivatives:\n\n....\nsudo pacman -S fortune-mod\n....\n\nOn Alpine Linux:\n\n....\ncurl -sL https://alpine.swee.codes/install.sh | doas sh # assumes you have doas and curl packages installed, and you aren't root\ndoas apk add fortune-mod\n....\n\nOn Debian, and derivatives (e.g: Ubuntu, Linux Mint):\n\n\n....\ncurl -sL https://swee.codes/repo.sh | sudo bash\nsudo apt install fortune-mod-shlomif\n....\n\nThis setups https://swee.codes/linuxrepos[this apt repository] to make sure you have the latest version.\n\nIf you are content with using a very old version, you can use:\n\n....\nsudo apt install fortune-mod\n....\n\n==== Building from Sources\n\nSee https://github.com/shlomif/fortune-mod/blob/master/fortune-mod/INSTALL.asciidoc[the INSTALL.asciidoc file]. You might also wish to consult the GitHub Actions-based Continuous Integration procedures\n\n=== Release Tarballs\n\nRelease tarballs can be found at\nhttps://www.shlomifish.org/open-source/projects/fortune-mod/arcs/[this\ndirectory] for now.\n\nBased on https://github.com/shlomif/fortune-mod/issues/10[this reported\nbug]:\n\nOne can find the official release tarballs of fortune-mod as prepared by\nCPack there. They have a proper containing directory. One can also\ndownload these tarballs from the\nhttps://github.com/shlomif/fortune-mod/releases[GitHub releases page].\nHowever, please do not use the auto-generated “Source code (zip)” and “Source\ncode (tar.gz)” downloads, which are both incomplete, and have extra\ndirectories inside.\n\n=== Sample usage\n\n....\n$ fortune\nEnthusiasm is one of the most important\ningredients a volunteer project runs on.\n                -- Andreas Schuldei\n$\n....\n\n=== History\n\nI believe fortune-mod was originally forked from the NetBSD version of fortune,\nand ported to run on Linux systems. For some time, it was maintained at the\ncurrently offline redellipse-dot-net inside a\nhttp://en.wikipedia.org/wiki/GNU_arch[GNU Arch] (= an old version control\nsystem) repository, and version 1.99.1 was released as a tarball.\n\nThis maintenance version was initiated by Shlomi Fish, who decided to\nmaintain it, given he is a fan of the fortune command. It started by\nimporting the unpacked source of the fortune-mod-1.99.1.tar tarball from\nthe Mageia Linux .src.rpm into an empty git repository, and proceeding\nfrom there.\n\n=== Why does running \"fortune\" fails?\n\nThere are several possible causes for that.\n\nOne of them is the fact that the “fortune” executable was placed in\nan unusual path, for example +/usr/games/fortune+ rather than +/usr/bin/fortune+.\nIf so, it sometimes need to be invoked using the full path.\n\n=== What is the difference between fortune-mod and the \"normal\" fortune?\n\nfortune-mod (= \"fortune modified\") was the name of a fork of the\noriginal NetBSD fortune, which was done in order to port the code to\nLinux and apply some other changes. If you are using a Linux\ndistribution, chances are that the `fortune` executable's package *is*\nfortune-mod (although in the case of Debian-and-derivatives it is likely\nvery out-of-date as of September 2020).\n\n=== Why is it written in C? Can't it be written in Perl, awk, Python, etc.?\n\nThe answer has several parts:\n\nFirst of all, note that according to\nhttps://en.wikipedia.org/wiki/Fortune_%28Unix%29[the wikipedia page], the\noriginal “fortune” was created in 1979. This is before the first version of\nperl was released in 1987, or those of python, ruby, or Lua, which were\nreleased later, and when UNIX-running computers were more underpowered than\nthey are today.\n\nSecondly, you can find some reimplementations of fortune here:\n\n* https://metacpan.org/pod/distribution/PerlPowerTools/bin/fortune[Perl]\n* https://github.com/bmc/fortune[Python]\n* https://github.com/jvzantvoort/fortune[Go-Lang] (and not too serious)\n* https://github.com/cafkafk/fortune-kind[fortune-kind in Rust-Lang] (under AGPL and with filtered data)\n\nYou may be able to get them to work with the data files of fortune-mod\nand other fortune collections, but note that we have not closely\nreviewed their source codes.\n\nThirdly, most of the value (and relative data size) of the tarball is in\nthe quotes collection.\n\nFourthly, a native executable might still provide a\nhttps://tonsky.me/blog/disenchantment/[better user-experience]. However,\nnote that I have yet to perform a stresstest benchmark, and I doubt it will\nmatter too much for “fortune”'s common use case.\n\nFinally, note that fortune’s runtime algorithm is not as straightforward as one\nmay believe, making use of “.dat” files that contain counts and offsets of\nthe fortune “cookies”.\n\n=== Why did you convert the buildsystem to CMake?\n\nSee:\n\n* https://github.com/shlomif/fortune-mod/pull/54\n* https://twitter.com/shlomif/status/1330457762191511554\n\n== What was already done.\n\n. fortune-mod-1.99.1 was imported into the repository from the Mageia\ntarball as the tag `fortune-mod-1.99.1`.\n. Converted the build system to\nhttps://en.wikipedia.org/wiki/CMake[CMake] .\n. Converted the source files to UTF-8.\n. Added some tests.\n. Removed trailing whitespace.\n. Reformatted long (\u003e 80 chars) lines.\n. Fixed some typos.\n. Added https://travis-ci.org/[Travis-CI] testing.\n. Added valgrind tests and fixed some memory leaks.\n. Released fortune-mod-1.99.3, fortune-mod-1.99.4, v2.0.0 and up to\nversion 2.26.0 and beyond.\n. Fixed some C compiler warnings encountered with the GCC compiler flags\nof\nhttps://github.com/shlomif/shlomif-cmake-modules[Shlomif_Common].\n. Added a build-time option to remove the “-o” (= “offensive”) flag,\ninspired by a set of patches on the Fedora package.\n. Applied some downstream patches.\n. Fixed as many “clang -Weverything” warnings as possible.\n. lib-recode became maintained again at\nhttps://github.com/rrthomas/recode (thanks to @rrthomas ) thus\npreventing a switch to something else.\n. Got the build and tests to pass on\nhttps://ci.appveyor.com/project/shlomif/fortune-mod[AppVeyor/MS Windows]\n(with some appreciated help).\n. Found and fixed some security issues:\n* Seem to have affected some Linux distributions as well as FreeBSD and\nNetBSD.\n** Was already fixed in OpenBSD\n* https://bugs.mageia.org/show_bug.cgi?id=26567\n* https://advisories.mageia.org/MGASA-2020-0199.html\n* https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246050\n* https://github.com/shlomif/fortune-mod/commit/fe182a25663261be6e632a2824f6fd653d1d8f45\n* https://github.com/shlomif/fortune-mod/commit/540c495f57e441b745038061a3cfa59e3a97bf33\n* https://github.com/shlomif/fortune-mod/commit/acd338098071bddfa1d21f87e1813727031428ea\n. Reformatted the C code using\nhttps://clang.llvm.org/docs/ClangFormat.html[clang-format].\n. Moved some cookies to/from the offensive collection.\n. Added new cookies.\n\n== What remains to be done.\n\n. Fix more typos (issue reports and pull-requests are welcome.)\n. Add more quotes / fortune cookies (issue reports and pull-requests are welcome.).\n. Prepare packages for the new releases for\nhttps://pkgs.org/download/fortune-mod[downstream distributions/Operating\nSystems].\n\n== Links\n\n* https://www.shlomifish.org/humour/fortunes/[Shlomi Fish’s Fortune\nCookie Files] - on his site, containing links to many other collections\nof fortune cookies.\n* https://web-cpan.shlomifish.org/modules/XML-Grammar-Fortune/[XML-Grammar-Fortune]\n- an XML grammar for collections of quotes, allowing one to generate\nXHTML or plaintext.\n* http://www.anvari.org/fortune/[Anvari.org’s web interface to “fortune”]\n- with many collections.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshlomif%2Ffortune-mod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshlomif%2Ffortune-mod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshlomif%2Ffortune-mod/lists"}