Coder Social home page Coder Social logo

shlomif / fortune-mod Goto Github PK

View Code? Open in Web Editor NEW
379.0 11.0 53.0 8.03 MB

Implementation of the Unix fortune command for displaying a random quotation, for Linux and other systems.

Home Page: http://www.shlomifish.org/open-source/projects/fortune-mod/

License: Other

C 50.60% Perl 31.92% Shell 1.05% CMake 11.63% Python 4.80%
fortune-mod fortune-cookie fortune quotes quote quotes-application unix linux open-source opensource

fortune-mod's Introduction

fortune-mod Maintenance Version and Ongoing Development

Travis-CI Build Status
AppVeyor Build status

This GitHub repository maintains the sources for fortune-mod, a version of the UNIX “fortune” command. fortune is a command-line utility which displays a random quotation from a collection of quotes. This collection is read from the local file system and does not require network access. A large collection of quotes is provided in the download and installed by default, but more quote collections can be added by the user.

The canonical repository for the time being is: https://github.com/shlomif/fortune-mod . In the future, we may create a GitHub organization for it, and move the sources there.

For more information about it, you can contact Shlomi Fish .

Installation

On Fedora and other rpm-based distributions:

sudo dnf install fortune-mod

( RHEL and CentOS users may opt to try the EPEL packages. )

On Arch Linux and derivatives:

sudo pacman -S fortune-mod

On Debian, and derivatives (e.g: Ubuntu, Linux Mint):

sudo apt install fortune-mod

(Warning: may be an old version.)

Release Tarballs

Release tarballs can be found at this directory for now.

Based on this reported bug:

One can find the official release tarballs of fortune-mod as prepared by CPack there. They have a proper containing directory. One can also download these tarballs from the GitHub releases page. However, please do not use the auto-generated “Source code (zip)” and “Source code (tar.gz)” downloads, which are both incomplete, and have extra directories inside.

Sample usage

$ fortune
Enthusiasm is one of the most important
ingredients a volunteer project runs on.
                -- Andreas Schuldei
$

History

I believe fortune-mod was originally forked from the NetBSD version of fortune, and ported to run on Linux systems. For some time, it was maintained at the currently offline redellipse-dot-net inside a GNU Arch (= an old version control system) repository, and version 1.99.1 was released as a tarball.

This maintenance version was initiated by Shlomi Fish, who decided to maintain it, given he is a fan of the fortune command. It started by importing the unpacked source of the fortune-mod-1.99.1.tar tarball from the Mageia Linux .src.rpm into an empty git repository, and proceeding from there.

What is the difference between fortune-mod and the "normal" fortune?

fortune-mod (= "fortune modified") was the name of a fork of the original NetBSD fortune, which was done in order to port the code to Linux and apply some other changes. If you are using a Linux distribution, chances are that the fortune executable’s package is fortune-mod (although in the case of Debian-and-derivatives it is likely very out-of-date as of September 2020).

Why is it written in C? Can’t it be written in Perl, awk, Python, etc.?

The answer has several parts:

First of all, note that according to the wikipedia page, the original “fortune” was created in 1979. This is before the first version of perl was released in 1987, or those of python, ruby, or Lua, which were released later, and when UNIX-running computers were more underpowered than they are today.

Secondly, you can find some reimplementations of fortune here:

You may be able to get them to work with the data files of fortune-mod and other fortune collections, but note that we have not closely reviewed their source codes.

Thirdly, most of the value (and relative data size) of the tarball is in the quotes collection.

Fourthly, a native executable might still provide a better user experience. However, note that I have yet to perform a stresstest benchmark, and I doubt it will matter too much for “fortune”'s common use case.

Finally, note that fortune’s runtime algorithm is not as straightforward as one may believe, making use of “.dat” files that contain counts and offsets of the fortune “cookies”.

Why did you convert the buildsystem to CMake?

See:

What was already done.

  1. fortune-mod-1.99.1 was imported into the repository from the Mageia tarball as the tag fortune-mod-1.99.1.

  2. Converted the build system to CMake .

  3. Converted the source files to UTF-8.

  4. Added some tests.

  5. Removed trailing whitespace.

  6. Reformatted long (> 80 chars) lines.

  7. Fixed some typos.

  8. Added Travis-CI testing.

  9. Added valgrind tests and fixed some memory leaks.

  10. Released fortune-mod-1.99.3, fortune-mod-1.99.4, v2.0.0 and up to version 2.26.0 and beyond.

  11. Fixed some C compiler warnings encountered with the GCC compiler flags of Shlomif_Common.

  12. Added a build-time option to remove the “-o” (= “offensive”) flag, inspired by a set of patches on the Fedora package.

  13. Applied some downstream patches.

  14. Fixed as many “clang -Weverything” warnings as possible.

  15. lib-recode became maintained again at https://github.com/rrthomas/recode (thanks to @rrthomas ) thus preventing a switch to something else.

  16. Got the build and tests to pass on AppVeyor/MS Windows (with some appreciated help).

  17. Found and fixed some security issues:

  18. Reformatted the C code using clang-format.

  19. Moved some cookies to/from the offensive collection.

  20. Added new cookies.

What remains to be done.

  1. Fix more typos (issue reports and pull-requests are welcome.)

  2. Add more quotes / fortune cookies (issue reports and pull-requests are welcome.).

  3. Prepare packages for the new releases for downstream distributions/Operating Systems.

fortune-mod's People

Contributors

0xdah avatar 0xpanic avatar atsampson avatar bboutkov avatar berndpaffenholz avatar candrews avatar cchristiansen avatar corymb avatar daleang avatar dj7lc avatar doughdemon avatar gijack avatar heirecka avatar jcschefer avatar jeffsheltren avatar lkundrak avatar lpar avatar ralismark avatar rashadsaleh avatar rkelly avatar ropery avatar s0nata avatar shlomif avatar telometto avatar thesamesam avatar tristanbatchler avatar tyehle avatar zsz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fortune-mod's Issues

backspace characters

There seem to be a number of places where the backspace character is in the fortune text. When the fortune is sent in email it's not recognized as text and gets converted to an attachment. Also some viewers show ^H instead of rendering the backspace of the text that was intended to be deleted. (vim displays the ^H whereas less interprets it.)

One example is the 'definitions' file. Check "Gray's Law of Programming:". Also this picks up the affected lines:
grep -P '[\b]' definitions

It seems like most examples originally had some underscore syntax that comes through as "_^H'.

Maybe we want this and fortune should have an option to convert the output into plain text?

$XDG_DATA_DIRS and $XDG_DATA_HOME support

Would you consider adding support for looking in $XDG_DATA_DIRS and the paths listed in $XDG_DATA_HOME for fortunes? This would allow fortunes to be put in places other than the directories that are built into the binary, and allow them to use used without specifying the path to them.

Specific usecases include:

I'm happy to help implement this, just kinda want your thoughts on it first before I go ahead.

Let's fix recode!

Surely in the same spirit as you have resurrected fortune-mod rather than find something else, we should fix recode's space leaks rather than find an alternative?

I have, as you can see, filed some issues here and with Test::RunValgrind, trying to build and run the tests of fortune-mod.

Currently I can't actually get the tests to run; if you can help with that, I'm happy to look at fixing librecode (I have plenty of experience both with Valgrind and with this kind of oldish C).

can not cross-compile

I wanna cross-compile for Android. I find that strfile is ruuning when compiling, actually it can not run when compiling.

How to build document at native.

I try to build fortune-mod from github source(rev: fortune-mod-3.2.0). I meet problem when building the document. I have installed perl packages from cpan.

I cannot find fortune_with_offensive.template.man and fortune_without_offensive.template.man under the directory and the cmake file seems to use them with process-fortune-man-template.pl.

part log
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_without_offensive.docbook5.xml]
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_with_offensive.docbook5.xml]
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
<<xsltproc --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/strfile.docbook5.xml>> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175.
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/strfile.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18.
make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:107: ../util/strfile.man] Error 2
make[2]: *** Waiting for unfinished jobs....
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
<<xsltproc --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/randstr.docbook5.xml>> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175.
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/randstr.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18.
make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:111: ../util/randstr.man] Error 2
[  7%] Linking C executable strfile
[  7%] Built target randstr
[  7%] Built target unstr
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
<<xsltproc --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_without_offensive.docbook5.xml>> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175.
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_without_offensive.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18.
make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:103: ../fortune/fortune_without_offensive.template.man] Error 2
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
<<xsltproc --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_with_offensive.docbook5.xml>> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175.
Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_with_offensive.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18.
make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:95: ../fortune/fortune_with_offensive.template.man] Error 2
make[1]: *** [CMakeFiles/Makefile2:281: CMakeFiles/generate_man_page.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  7%] Built target strfile
[  7%] Linking C executable fortune
[  7%] Built target fortune
make: *** [Makefile:171: all] Error 2
note: keeping build directory '/tmp/nix-build-fortune-mod-3.2.0.drv-1'
builder for '/nix/store/jgzkin7k2lbx59b9cjmiqg0wlx6lv5yg-fortune-mod-3.2.0.drv' failed with exit code 2
error: build of '/nix/store/jgzkin7k2lbx59b9cjmiqg0wlx6lv5yg-fortune-mod-3.2.0.drv' failed

Shlomif_Common cmake module missing

We seem to be missing the Shlomif_Common cmake module:

CMake Error at CMakeLists.txt:5 (INCLUDE):
include could not find load file:

Shlomif_Common

CMake Error at CMakeLists.txt:7 (SHLOMIF_COMMON_SETUP):
Unknown CMake command "SHLOMIF_COMMON_SETUP".

Ferengi Rules of Acquisition

Hi, I came here to offer a pull request to add the Ferengi Rules of Acquisiton, only to find that they have already been added just a couple of days ago - what a weird coincidence...

However, the contents that were merged contain lots of typos and other errors (presumably, they were pulled from the same source that I used).

I have created a cleaned up version that is also closer to the style of how the rules are usually recited within Star Trek episodes:
froas-biglist-out.txt

Also, I'd like to point out that this seems to be an unofficial list - I couldn't find any indication that there ever was an official, comprehensive list of all 280+ rules. Thus, I also created a list based on these contents which include references to sources:
froas-gistlist-out.txt

Let me know what you think.

Move strfile and unstr (back) to /usr/bin/ (instead of /usr/sbin/)

Since at least *) 2.6.2, strfile and unstr get installed to /usr/sbin/, which indicates that they are meant for usage by root only.

This doesn't make sense - strfile is needed for users who maintain their own collection of fortunes (like my mail signature collection) and perfectly works for non-root users, therefore I see no reason why it should be in sbin.

I don't have such a strong opinion about unstr (because personally I don't need/use it), but IMHO it also should be in /usr/bin instead of sbin.

To fix this, replace the two sbin in fortune-mod/CMakeLists.txt with bin.

*) I noticed this when the openSUSE package was updated to 2.6.2, but since the previous packaged version was 1.99, the sbin path was possibly introduced earlier.

Typo in fortune

"There is also a thriving independent student movement in
Poland, and thus there is a strong possibility (though no
guarantee) of making an EARN-Poland link, should it ever come
about, a genuine link - not a vacuum cleaner attachment for a
Bloc information gathering apparatus rationed to trusted
apparatchiks."
-- David Phillips, SUNY at Buffalo, about establishing a
gateway from EARN (Eurpoean Academic Research Network)
to Poland

Offensive fortunes not automatically decrypting

I built both master and the 2.6.0 release tarball, and both versions fail to automatically "unrotate" offensive fortunes. The effect of this is that fortune -a is occasionally littered with gibberish. fortune -o | rot works fine, but as it stands the behavior does not match what is written in the Notes file.

This may be a blessing in disguise since I tried a few runs and every other offensive fortune I get is a grating limerick.

Move sources out of `fortune-mod`?

The organisation of the code is a little odd to my eyes: why not move everything in fortune-mod up a level, so you don't have this whole fortune-mod/fortune-mod thing going on? I think I see what happened: you dumped the original sources into a directory and slapped a README.md etc. on top; but that can be straightened out, don't you think?

Typo in fortune

Ballistophobia:
Fear of bullets;
Otophobia:
Fear of opening one's eyes.
Peccatophobia:
Fear of sinning.
Taphephobia:
Fear of being buried alive.
Sitophobia:
Fear of food.
Trichophobbia:
Fear of hair.
Vestiphobia:
Fear of clothing.

Should be Trichophobia

Does unstr still make sense?

Back in the day when index and fortunes lived in the same file it made a lot of sense.

But lately I've been trying to use it and it always complain about the file format (?) plus I don't see the point of it anymore. Is there any valid use case for it?

Build error with 1.99.5 release

fortune/fortune.c:122:27: fatal error: recode.h: No such file or directory

cmake configure output:

-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Perl: /usr/bin/perl (found version "5.22.2")
-- Looking for regex.h
-- Looking for regex.h - found
-- Configuring done
-- Generating done

It seems to me, that recode.h not checked at configure time.

Problem with running valgrind tests

I tried to run the valgrind tests to see what is up with librecode, but having commented out the plan skip_all line, I got the following error when I ran the tests:

/home/rrt/repo/fortune-mod/fortune-mod/tests/t/valgrind.t ................ Error open (<:raw:encoding(UTF-8)) on 'fortune--1.valgrind-log': No such file or directory at /home/rrt/.local/share/perl/5.22.1/Test/RunValgrind.pm line 74.

I have fortunes, want to integrate them?

I created a fortune php script in 2007 and grabbed whatever fortune files I had on hand and uploaded them. At the time I think I was using Gentoo and/or Slackware, so it appears that I have fortunes from both of them. I had forgotten about it, but someone recently reminded me of the script so I went looking for other repos of fortunes. :)

I've attached a tarball of the fortunes directory that I uploaded in 2007. I haven't done the diff yet, but it looks similar to what you have, with some differences.

Are you interested in integrating any of these to this repo? If so, I might put together a PR -- though, are there guidelines for what you might/might not want?

File list

fortunes
fortunes/off
fortunes/off/art
fortunes/off/art.dat
fortunes/off/art.u8
fortunes/off/astrology
fortunes/off/astrology.dat
fortunes/off/astrology.u8
fortunes/off/atheism
fortunes/off/atheism.dat
fortunes/off/atheism.u8
fortunes/off/black-humor
fortunes/off/black-humor.dat
fortunes/off/black-humor.u8
fortunes/off/cookie
fortunes/off/cookie.dat
fortunes/off/cookie.u8
fortunes/off/debian
fortunes/off/debian.dat
fortunes/off/debian.u8
fortunes/off/definitions
fortunes/off/definitions.dat
fortunes/off/definitions.u8
fortunes/off/drugs
fortunes/off/drugs.dat
fortunes/off/drugs.u8
fortunes/off/ethnic
fortunes/off/ethnic.dat
fortunes/off/ethnic.u8
fortunes/off/fortunes
fortunes/off/fortunes.dat
fortunes/off/fortunes.u8
fortunes/off/hphobia
fortunes/off/hphobia.dat
fortunes/off/hphobia.u8
fortunes/off/limerick
fortunes/off/limerick.dat
fortunes/off/limerick.u8
fortunes/off/linux
fortunes/off/linux.dat
fortunes/off/linux.u8
fortunes/off/misandry
fortunes/off/misandry.dat
fortunes/off/misandry.u8
fortunes/off/miscellaneous
fortunes/off/miscellaneous.dat
fortunes/off/miscellaneous.u8
fortunes/off/misogyny
fortunes/off/misogyny.dat
fortunes/off/misogyny.u8
fortunes/off/politics
fortunes/off/politics.dat
fortunes/off/politics.u8
fortunes/off/privates
fortunes/off/privates.dat
fortunes/off/privates.u8
fortunes/off/racism
fortunes/off/racism.dat
fortunes/off/racism.u8
fortunes/off/religion
fortunes/off/religion.dat
fortunes/off/religion.u8
fortunes/off/riddles
fortunes/off/riddles.dat
fortunes/off/riddles.u8
fortunes/off/sex
fortunes/off/sex.dat
fortunes/off/sex.u8
fortunes/off/songs-poems
fortunes/off/songs-poems.dat
fortunes/off/songs-poems.u8
fortunes/off/vulgarity
fortunes/off/vulgarity.dat
fortunes/off/vulgarity.u8
fortunes/off/zippy
fortunes/off/zippy.dat
fortunes/off/zippy.u8
fortunes/SP
fortunes/SP.dat
fortunes/art
fortunes/art.dat
fortunes/art.u8
fortunes/ascii-art
fortunes/ascii-art.dat
fortunes/ascii-art.u8
fortunes/bofh-excuses
fortunes/bofh-excuses.dat
fortunes/calvin
fortunes/calvin.dat
fortunes/chalkboard
fortunes/chalkboard.dat
fortunes/chapterhouse-dune
fortunes/chapterhouse-dune.dat
fortunes/children-of-dune
fortunes/children-of-dune.dat
fortunes/chucknorris
fortunes/chucknorris.dat
fortunes/computers
fortunes/computers.dat
fortunes/computers.u8
fortunes/cookie
fortunes/cookie.dat
fortunes/cookie.u8
fortunes/debian
fortunes/debian.dat
fortunes/debian.u8
fortunes/debilneho
fortunes/debilneho.dat
fortunes/definitions
fortunes/definitions.dat
fortunes/definitions.u8
fortunes/drugs
fortunes/drugs.dat
fortunes/drugs.u8
fortunes/dubya
fortunes/dubya.dat
fortunes/dune
fortunes/dune-messiah
fortunes/dune-messiah.dat
fortunes/dune.dat
fortunes/education
fortunes/education.dat
fortunes/education.u8
fortunes/ethnic
fortunes/ethnic.dat
fortunes/ethnic.u8
fortunes/familyguy
fortunes/familyguy.dat
fortunes/firefly
fortunes/firefly.dat
fortunes/food
fortunes/food.dat
fortunes/food.u8
fortunes/fortunes
fortunes/fortunes.dat
fortunes/fortunes.u8
fortunes/futurama
fortunes/futurama.dat
fortunes/gentoo-dev
fortunes/gentoo-dev.dat
fortunes/gentoo-forums
fortunes/gentoo-forums.dat
fortunes/god-emperor
fortunes/god-emperor.dat
fortunes/goedel
fortunes/goedel.dat
fortunes/goedel.u8
fortunes/heretics-of-dune
fortunes/heretics-of-dune.dat
fortunes/hitchhiker
fortunes/hitchhiker.dat
fortunes/homer
fortunes/homer.dat
fortunes/house-atreides
fortunes/house-atreides.dat
fortunes/house-harkonnen
fortunes/house-harkonnen.dat
fortunes/humorists
fortunes/humorists.dat
fortunes/humorists.u8
fortunes/humorix-misc
fortunes/humorix-misc.dat
fortunes/humorix-stories
fortunes/humorix-stories.dat
fortunes/kernelcookies
fortunes/kernelcookies.dat
fortunes/kids
fortunes/kids.dat
fortunes/kids.u8
fortunes/knghtbrd
fortunes/knghtbrd.dat
fortunes/knghtbrd.u8
fortunes/law
fortunes/law.dat
fortunes/law.u8
fortunes/linux
fortunes/linux.dat
fortunes/linux.u8
fortunes/linuxcookie
fortunes/linuxcookie.dat
fortunes/linuxcookie.u8
fortunes/literature
fortunes/literature.dat
fortunes/literature.u8
fortunes/love
fortunes/love.dat
fortunes/love.u8
fortunes/magic
fortunes/magic.dat
fortunes/magic.u8
fortunes/medicine
fortunes/medicine.dat
fortunes/medicine.u8
fortunes/men-women
fortunes/men-women.dat
fortunes/men-women.u8
fortunes/miscellaneous
fortunes/miscellaneous.dat
fortunes/miscellaneous.u8
fortunes/news
fortunes/news.dat
fortunes/news.u8
fortunes/osfortune
fortunes/osfortune.dat
fortunes/paradoxum
fortunes/paradoxum.dat
fortunes/paradoxum.u8
fortunes/people
fortunes/people.dat
fortunes/people.u8
fortunes/perl
fortunes/perl.dat
fortunes/perl.u8
fortunes/pets
fortunes/pets.dat
fortunes/pets.u8
fortunes/platitudes
fortunes/platitudes.dat
fortunes/platitudes.u8
fortunes/politics
fortunes/politics.dat
fortunes/politics.u8
fortunes/powerpuff
fortunes/powerpuff.dat
fortunes/pqf
fortunes/pqf.dat
fortunes/riddles
fortunes/riddles.dat
fortunes/riddles.u8
fortunes/science
fortunes/science.dat
fortunes/science.u8
fortunes/slack-fortunes-vol-1
fortunes/slack-fortunes-vol-1.dat
fortunes/slack-fortunes-vol-10
fortunes/slack-fortunes-vol-10.dat
fortunes/slack-fortunes-vol-11
fortunes/smac
fortunes/slack-fortunes-vol-11.dat
fortunes/slack-fortunes-vol-12
fortunes/slack-fortunes-vol-12.dat
fortunes/slack-fortunes-vol-13
fortunes/slack-fortunes-vol-13.dat
fortunes/slack-fortunes-vol-2
fortunes/slack-fortunes-vol-2.dat
fortunes/slack-fortunes-vol-3
fortunes/slack-fortunes-vol-3.dat
fortunes/slack-fortunes-vol-4
fortunes/slack-fortunes-vol-4.dat
fortunes/slack-fortunes-vol-5
fortunes/slack-fortunes-vol-5.dat
fortunes/slack-fortunes-vol-6
fortunes/slack-fortunes-vol-6.dat
fortunes/slack-fortunes-vol-7
fortunes/slack-fortunes-vol-7.dat
fortunes/slack-fortunes-vol-8
fortunes/slack-fortunes-vol-8.dat
fortunes/slack-fortunes-vol-9
fortunes/slack-fortunes-vol-9.dat
fortunes/smac.dat
fortunes/songs-poems
fortunes/songs-poems.dat
fortunes/songs-poems.u8
fortunes/sports
fortunes/sports.dat
fortunes/sports.u8
fortunes/startrek
fortunes/startrek.dat
fortunes/startrek.u8
fortunes/starwars
fortunes/starwars.dat
fortunes/strangelove
fortunes/strangelove.dat
fortunes/tao
fortunes/tao.dat
fortunes/translate-me
fortunes/translate-me.dat
fortunes/translate-me.u8
fortunes/wisdom
fortunes/wisdom.dat
fortunes/wisdom.u8
fortunes/work
fortunes/work.dat
fortunes/work.u8
fortunes/zippy
fortunes/zippy.dat
fortunes/zippy.u8
fortunes/zx-error
fortunes/zx-error.dat

pets duplicates the same fortune twice

%
It's always sad when the fleas leave, because that means your dog is dead.
-- Wesley T. Williams
%
It's always sad when the fleas leave, because that means your dog is dead.
-- Wesley T. Williams

Little nit to clean up, looks like the same fortune cookie is repeated twice for some reason.

No patch, but sed -i -e '187,189 d' fortune-mod/datfiles/pets should clean it up.

Compiling ipk for OpenWRT failed

Compiling ipk for OpenWRT failed
is it possible make fortune for OpenWRT?
is it really possible or not in principle?

make[5]: Entering directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
[ 0%] Building C object CMakeFiles/strfile.dir/util/strfile.c.o
[ 1%] Linking C executable strfile
make[5]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
[ 1%] Built target strfile
make[5]: Entering directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
Scanning dependencies of target randstr
make[5]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
make[5]: Entering directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
[ 1%] Building C object CMakeFiles/randstr.dir/util/randstr.c.o
[ 2%] Linking C executable randstr
make[5]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
[ 2%] Built target randstr
make[5]: Entering directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
Scanning dependencies of target fortune
make[5]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
make[5]: Entering directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
[ 2%] Building C object CMakeFiles/fortune.dir/fortune/fortune.c.o
[ 2%] Linking C executable fortune
/home/dima/OpenWRT/openwrt/staging_dir/toolchain-mips_24kc_gcc-7.5.0_musl/lib/gcc/mips-openwrt-linux-musl/7.5.0/../../../../mips-openwrt-linux-musl/bin/ld: cannot open output file fortune: Is a directory
collect2: error: ld returned 1 exit status
CMakeFiles/fortune.dir/build.make:83: recipe for target 'fortune' failed
make[5]: *** [fortune] Error 1
make[5]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
CMakeFiles/Makefile2:169: recipe for target 'CMakeFiles/fortune.dir/all' failed
make[4]: *** [CMakeFiles/fortune.dir/all] Error 2
make[4]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
Makefile:151: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1'
Makefile:70: recipe for target '/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1/.built' failed
make[2]: *** [/home/dima/OpenWRT/openwrt/build_dir/target-mips_24kc_musl/fortune-mod-3.6.1/.built] Error 2
make[2]: Leaving directory '/home/dima/OpenWRT/openwrt/feeds/packages/utils/fortune-mod'
time: package/feeds/packages/fortune-mod/compile#0.88#0.36#1.18
package/Makefile:111: recipe for target 'package/feeds/packages/fortune-mod/compile' failed
make[1]: *** [package/feeds/packages/fortune-mod/compile] Error 2
make[1]: Leaving directory '/home/dima/OpenWRT/openwrt'
/home/dima/OpenWRT/openwrt/include/toplevel.mk:225: recipe for target 'package/fortune-mod/compile' failed
make: *** [package/fortune-mod/compile] Error 2

How do you build this?

Does not seem to be documented, which is important for baroque build systems like CMake.

‘Stupid idiot users’ insults outside `off`

%
User n.:
A programmer who will believe anything you tell him.
%
user, n.:
The word computer professionals use when they mean "idiot."
-- Dave Barry, "Claw Your Way to the Top"

[I always thought "computer professional" was the phrase hackers used
when they meant "idiot." Ed.]

These two seem rather rude to users of fortune-mod (including ‘computer professionals’
because it implies they are, as a rule, rude). Could they be moved to off or removed?

Specifying percentage for "all" breaks if both FORTDIR and LOCFORTDIR have fortunes

Demonstration:

$ fortune 70% all
fortune: probabilities sum to 140%!

This seems to be because FORTDIR and LOCFORTDIR both get separately added with the specified pecentage, instead of sharing the 70% between the two, so it effectively interprets it as fortune 70% <locfortdir> 70% <fortdir>.

I don't think fixing this is as simple as halving the percentage, since if the two directories have different numbers of fortunes, each fortunes in FORTDIR would have a different probability of showing up compared to ones in LOCFORTDIR. This would differ from what I'd expect if all the fortunes were in the same directory, where e.g. fortune 70% ./dir would still mean every fortune in dir has a roughly equal chance of appearing.

fortune all with a special standard databases path.

System: NixOS

Directory info:

       /nix/store/zmaq9zkqzjhp917gd5qs4m8cq6h9dkda-fortune-mod-1.99.1/share/games/fortunes
              Directory for innoffensive fortunes.
       /nix/store/zmaq9zkqzjhp917gd5qs4m8cq6h9dkda-fortune-mod-1.99.1/share/games/fortunes/off
              Directory for offensive fortunes.

Run and output:

$ nixos fortune all                                                  
No fortunes found

By the way, if run without all, it can work correctly.

[Feature] Convert the documentation from nroff to a more versatile format

In accordance with this and my "Unixdoc" vision I am contemplating to convert fortune-mod's documentation from nroff (which has limited readability and support for different output formats) to a better format.

Some options are:

We can still ship man pages generated from it in the main tarball.

I'd love to hear your thoughts and opinions.

PPA

Is there the potential for a PPA that we can add for the latest versions rather than building from source?

Currently, on Ubuntu 22.04 the version is 1.99.1 which seems quite outdated.

3.0.0 release can't be (easily) compiled from source

The errors below apply to macOS 10.14 (Mojave) using MacPorts and Debian 10.2 (Buster).

Attempting to build master from a Git clone, I quickly came upon #5, so I downloaded and unpacked the 3.0.0 release tarball instead.

Attempting to build in the usual way with CMake, I received the error message:

CMake Error at CMakeLists.txt:105 (find_package):
  By not providing "FindRinutils.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Rinutils",
  but CMake did not find one.

  Could not find a package configuration file provided by "Rinutils" with any
  of the following names:

    RinutilsConfig.cmake
    rinutils-config.cmake

  Add the installation prefix of "Rinutils" to CMAKE_PREFIX_PATH or set
  "Rinutils_DIR" to a directory containing one of the above files.  If
  "Rinutils" provides a separate development package or SDK, be sure it has
  been installed

I then git cloned Rinutils into the fortune-mod directory and attempted to build it in the usual CMake way, but got this error:

CMake Warning at cmake/shlomif_common_bootstrap.cmake:7 (MESSAGE):
  Could not find Shlomif_Common.cmake - you can find it here:
  https://github.com/shlomif/shlomif-cmake-modules ; trying to download it
  for you.
Call Stack (most recent call first):
  CMakeLists.txt:4 (INCLUDE)


CMake Error at CMakeLists.txt:5 (SHLOMIF_COMMON_SETUP):
  Unknown CMake command "SHLOMIF_COMMON_SETUP".

Having seen #5 from the fortune-mod repo, I had some idea how to proceed here, so I downloaded the rinutils 0.4.1 release tarball, unpacked it, and attempted to build that in the usual CMake way. However, then I ran into this:

-- Checking for module 'cmocka'
--   No package 'cmocka' found
CMake Error at /usr/local/cmake/3.8.1/share/cmake-3.8/Modules/FindPkgConfig.cmake:416 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/local/cmake/3.8.1/share/cmake-3.8/Modules/FindPkgConfig.cmake:589 (_pkg_check_modules_internal)
  CMakeLists.txt:150 (pkg_check_modules)

At this point, I'm sorry to say, I gave up. Neither Rinutils nor fortune-mod mentioned the cmocka dependency, and I was able to get the old tarball from '97 working with only the basic kit and minor changes to the Makefile.

I realize that last part is more or less a rinutils problem, and probably should be tracked in rinutils' issue tracker simple matter of apt install libmocka-dev or port install cmocka and then try again. But with all due respect, wouldn't it be prudent to try to incorporate whatever bits and bobs you need from the Rinutils repo into the fortune-mod one (maybe as a submodule), so that it can build in the expected way with git clone …; mkdir build; cd build; cmake ..?

Add fill usage list

Hey could you add a full usage list in the readme can't find much documentation on it

  • -a : shows blah
  • ....

Incorrect Verbage

mittsquinter, adj.:
A ballplayer who looks into his glove after missing the ball, as
if, somehow, the cause of the error lies there.
-- "Sniglets", Rich Hall & Friends

Is the fortune with the issue. It describes a mittsquinter as an adjective but then goes on to describe a noun.

Valgrind tests seem to work

If I comment out the plan skip_all line, and instead uncomment the plan 1 line, I get:

/home/rrt/.local/var/repo/fortune-mod/fortune-mod/tests/t/valgrind.t ................ ok   

So are the tests passing, or am I somehow failing to run them?

Package is unavailable/broken for CentOS 8

Just tried to install this on 2x different CentOS minimal installs: sudo yum install fortune-mod.

  1. CentOS cannot see the package via yum / dnf.

  2. On getting the package listed for Fedora (.rpm), I manually try to install it and get into a mess of library conflicts.

Basically, the package is 100% broken for CentOS 8 and not available from the yum / dnf repository.

(Edited to change apt to yum / dnf)

Only two pratchett quotes

I just tried fortune for the first time in what must be ten years, and did a list of the various dat files. I was pleased to discover that there was a separate file for Pratchett quotes, and tried it out. Got the same quote three times in a row, inspected the file, and discovered that there are in fact only two quotes in the file. Though they are both good quotes, this looks like a bug to me.

Language

Hi! i have a system in english lang, but i need fortune in Spanish!!!! i already installed fortunes-es and there a included folder in /usr/share /games/fortunes/es buut no way to say fortune that only say in spanish lang. In the man of fortune is no information.. Very thanks

rinutils is missing in 3.16.0 release

This issue has appeared some times.

I think it is better that a CI job checks the release package. Or remove this from release package and add it as an dependencies in the document to let users add it manually.

1.99.3 tarball hasn't been cleaned

The fortune-mod-1.99.3.tar.xz tarball hasn't had "make clean" run on it beforehand -- so it contains object files, timestamp files, etc. This will cause strange build failures.

It would be a good idea to automate the process of building the tarball to prevent this kind of problem (automake would provide "make dist"; I assume CMake has something equivalent).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.