2025-04-27 12:27 pm

sudo alternatives

I recently had an issue doing an upgrade of AIX Toolbox on an AIX machine and it caused the sudo program to fail because it couldn't find dependencies it needed to execute successfully. I started searching to see if there were simpler alternatives that could do a job similar to sudo and would not have so many dependencies. Of the various options out there, I found three that were interesting.

Doas was created for OpenBSD. There are different versions of the program, including a portable fork called OpenDoas. I tried this version, so I can't say much about the others at this point:
https://github.com/slicer69/doas
The program does build on Linux as well as on the BSD systems. It can use BSD functions on BSD systems for authentication but uses PAM on Linux and other systems. The pam_start function needs struct pam_conv to initialize and part of pam_conv points to a function that handles input. Linux, Solaris and some systems provide functions as part of their PAM library. However, not all systems have a library function to pass to pam_start. I wasn't able to find a supplied function on AIX. OpenDoas appears to have a function as part of the OpenDoas program itself. There are also some simple examples of a function that can be used with PAM available online if you're on an operating system that doesn't have one readily available.

Another option I came across was called please. It only offers the option of PAM authentication. It has the same issues for portability with regards to the function needed by pam_conv. You can find the source code for please here:
https://github.com/gblach/please

The last alternative I experimented with is sup. It's on the recommendations page at suckless.org. The interesting thing about this program is that it doesn't require PAM to work on various systems. That's a nice feature if you're building a minimal operating system and don't have the PAM library built and installed. It has an option to use a hash function to make sure that the user is running the program they're supposed to and not a program with the same name that has been substituted for it. The hash function has a less lenient license than the program on its own. I was thinking it would be nice to use a system library with a hash function instead of needing to use the one provided by the program. However, that would increase the number of dependencies the program requires. The sup program also has a feature to run a program with a fork. As I'm not a fan of the fork function and how many resources it uses and its lack of portability, I avoid that option at all costs. I remember the topic of fork coming up on the musl mailing list. The spawn function was mentioned as a more efficient alternative. Another difference between this program and the other two is that it uses hard-coded settings rather than needing external settings files. This requires recompiling to change options, but it makes it harder for someone else to modify the settings from a security standpoint. Source code for sup is available at:
https://github.com/dyne/sup

Upon further investigation, the sup that the suckless.org site recommends is the earlier version found here:
https://oldgit.suckless.org/sup/files.html
It does not include the hash and fork options and offers a more minimal implementation with straight-forward code.

I've seen some complaints that using sudo or operating/logging in as root can be more insecure. Alternatives may be more secure when they have less code and are easier to maintain and debug. That's one reason they may be attractive. However, the alternatives need to be well written or well tested and debugged or they can be more insecure than the standards. There's also the advantage of security through obscurity. If exploits use sudo, they may not be expecting or looking for an alternative like doas on a system. Many people prefer using whatever's standard assuming that it's secure enough or so many other people wouldn't be using it too. Just as having less code can be more secure, requiring less dependencies can also have security advantages. It's another way to limit the amount of code in a program. Using a shared library can also create security issues for a program that may need to be addressed.

As a cross-platform programmer, I always look for programs that will work on a variety of operating systems. The sudo alternatives port to many systems but many of their concepts won't transfer well to Windows or DOS operating systems. While you can have multiple users on some DOS variants, it's more of a single user operating system and restricting who can run things is not typically an issue. On Windows, this can be important. However, Windows has a completely different way of handling permissions and rights from Unix and Linux systems. I did run across some samples of sudo-like alternatives designed for Windows. However, they work very differently.

It was interesting to find out how programs like sudo or the alternatives I've mentioned function. A sudo-like program is owned by root and has a special permission set on the program file. By setting the suid bit on the file permission of the program, a non-root user can run the program as if they are the root user. A technique like this would not work natively on Windows. One can elevate permissions in Windows using the Windows API. However, it doesn't work in all cases. There's a way to use SeDebugPrivilege to elevate permissions in a program but some organizations turn that privilege off for their users.

Basically any of these types of sudo like programs uses a function such as execute or spawn or CreateProcess to run other programs. They allow a user who typically doesn't have permission on a particular operating system to have that permission by starting another program or process through that program. In some form or other, that program needs to have special rights to run other programs whether the user has the rights to or not.

I find it interesting that root automatically has permissions to copy, move or remove files, no matter what directory. On POSIX systems, running as root really solves a lot of permission issues especially when building and trying to install programs. While Puppy Linux embraces the idea of running as root and some small, single user systems work fine this way, many Unix and Linux systems highly discourage running as root. While it's nice to be able to easily install a program you built, it's not helpful if you accidentally install something over another library or program and cause your system to fail in the process. It's also easier to accidentally remove needed files in a critical directory when you have the permissions to remove anything. For instance, a misbehaving install script could easily wipe out files needed for the system to operate properly. I do feel that critical programs with dependencies, if built statically, have several advantages to programs using shared libraries. They won't fail if there are issues with finding or loading a shared library on the system. Also, someone can't hack the system by having that program load the wrong library with a function that doesn't do what's intended. At this time, static building isn't widely embraced on Linux systems and the GNU glibc library cannot be used to build static programs. One would need to use a C library such as musl if static builds are desired. I personally happen to think there are many advantages to using musl over glibc. However, at this point most Linux operating systems still use glibc. Both using alternatives to glibc and running as root are not mainstream practices and both can be controversial in many sectors. There are pros and cons to running as root versus running as another user. That's what makes programs like sudo and similar alternatives so useful. They give the power of root but can limit what you can do with it to make sure you don't accidentally run commands that could disrupt or cripple the operating system.

Personally, I'd like to see a cross-platform sudo alternative that would work with Windows as well as Unix (including AIX) and Linux operating systems. It would be nice to have a small, simple program that would work for most multi-user operating systems available. I prefer the idea of a more compact program with very limited dependencies. A static build or no extra libraries would have avoided my shared library issue on AIX which caused sudo to fail.

I'd be very intrigued to hear about other sudo alternatives that are available. I'd also be interested in hearing about the pros and cons of security with regards to use of some of these programs. What do you regularly use on your system? What alternatives to root or sudo have you found? What works well on multi-user operating systems beyond Linux and Unix? What are your security concerns using sudo or some of these alternatives and how do you work around them? Feel free to share some of your comments on the topic on Mastodon. I'll be updating this article with more information if I find other lightweight, low dependency sudo alternatives that I like.
2023-08-28 08:22 am

Web-based Open Source

Thought it would be fun to consolidate my list of Open Source apps that work via the web. You can use them right in your browser without having to download or install any software.

There are several web/server based FLOSS projects. Plus, it's now easier than ever to convert some popular desktop Open Source projects to the web using techniques such as Web Assembly. I'll add other examples to this list as I find them.

One of the best collections I've found that lists several FLOSS projects designed to work through a browser over the Internet is Libre Projects:
http://libreprojects.net/
It's been around a while, so I don't know how up-to-date the links are but it has some great examples of web based projects that share their source code.

If you're a fan of Audacity, the audio editor, or Tenacity, a great fork of audacity, check out this online fork of the audio editor:
https://wavacity.com/
https://github.com/ahilss/wavacity

Some other projects by the developer of Wavacity:
https://dj.app/
https://life.dj.app/

Here's a video editor:
https://d2jta7o2zej4pf.cloudfront.net/
https://github.com/shamadee/web-dsp

TinyGL has been ported to the web. Click on the graphic examples to see them in action. I personally like the Atlantis example with the whales:
https://github.com/humu2009/tinygl.js

I've a huge fan of the JavaScript aquarium written in under 20 lines of JavaScript. There's also an asteroid game in under 20 lines.
https://web.archive.org/web/20190128002213/http://www.codecouch.com/dansCode/snippets/zoo/index.php
http://www.ozoneasylum.com/24905
https://www.ozoneasylum.com/25666

Here's another interesting online aquarium:
https://lrusso.github.io/Aquarium/Aquarium.htm
https://github.com/lrusso/Aquarium

You can have free web based meetings using Jitsi Meet:
https://meet.jit.si/
https://jitsi.org/downloads/


I've collected the online examples from my educational games list:

2048
https://play2048.co/
https://github.com/gabrielecirulli/2048

Anagramica
http://anagramica.com/
https://github.com/binarymax/anagramica

Everything Attacks
https://github.com/dulsi/everythingattacks
http://identicalsoftware.com/everythingattacks/

Follow Me
https://www.sandeepnambiar.com/follow_me_javascript_simon_clone/
https://github.com/gamedolphin/follow_me_javascript_simon_clone

Hextris
https://hextris.io/

LGames
https://lgames.sourceforge.io/LMastermind/
https://lgames.sourceforge.io/LMemory/
https://lgames.sourceforge.io/

Tuxmath online
https://tuxmath.org/index-en.html?opt_lang=en


More resources:

[profile] kribbel@mastodon.social recommended Stendhal. It requires a login, but it's FLOSS and it looks like it could be a lot of fun.
https://stendhalgame.org/index.php?id=content/account/login&url=/account/mycharacters.html
2023-05-22 04:11 pm

SDL Migration Options

I've been using SDL for a long while now. The newest version of SDL 3 will require migrating from SDL 2 versions. Like the switch from 1.2.15 to 2, it will once again break backward compatibility. It will remove support for several older platforms and change the API. The good news is that SDL 3 will have a compatibility layer much sooner than SDL 2 did. I'm still patching some of the SDL 1.2.15 programs I use so that they'll work with either SDL 2 or SDL 1.2.15. In my experiences with it so far, patching seems to work better than using the compatibility layer for SDL 1.2 support. SDL 3 will make more use of the GPU and modern graphics libraries and drivers. From what I've read, it'll introduce a new, portable shader language. So, you may now need more than just a C compiler to write programs. I prefer working with a minimal number of languages and compilers and am not looking forward to some of the new changes SDL 3 may bring. This leaves me wondering if I should seek another graphics/GUI library for more of my development.

I've looked into GUIs, TUIs and graphics libraries in the past and I really wasn't thrilled with most of the options out there. Besides SDL, Raylib seems very promising. It doesn't have the variety of FLOSS applications SDL seems to though. Using OpenGL directly can be just as problematic as SDL because its API keeps changing as well. So, GLFW may not be a great strategy either if the OpenGL compatibility it makes accessible has a changing API. Nano-X seems fairly stable and works on a variety of operating systems. Allegro is often used for applications similar to those created by SDL. However, differences between the versions it supports and what platforms those versions offer is also noticeable. I often use pdcurses with an SDL backend, but pdcursesmod works very well on Windows using Win32 and can also support console mode in Windows and BSD-curses and ncurses offers some benefits over pdcurses on POSIX systems. So, while I've found pdcurses built with SDL highly portable and useful (I even added SDL 2 and SDL2_ttf support), programs that build with pdcurses should port easily to other libraries that don't require SDL.

There are some platforms that only work with SDL 1.2.x and are not supported by later versions of SDL. The same will most likely be true for SDL 2 compared to the latest version of SDL 3. I'm wondering if I should keep using and patching the current SDL 2 and 1.2.15 libraries I've been working with or just make the switch to a new library. I'm also wondering if other developers are in the same situation, trying to determine whether to continue with what they have or port what they can to yet another graphics library or a later version of SDL. If there's interest from other developers in continuing to use older versions of SDL because of platforms they supported or portability issues, it would be nice to collaborate in continuing to maintain these libraries. It's easier to find security issues and bugs when there are a group of users rather than just one programmer using it.

I am currently working on backporting the latest SDL 2 helper libraries so that as many as possible work with SDL 1.2.15. That way SDL 1.2.15 can make use of newer features like loading and rendering SVG images, better utf-8 support, etc. I have a patched version of SDL2_ttf that adds functionality needed for sdl_unifontview to work properly. I've also been adding an alternative build system that doesn't require GNU autotools or cmake. It instead uses CDetect and make.

As one of the earlier contributors to MinGW, I use the original MinGW port to Windows and try to avoid the hostile fork of MinGW whenever possible. Unfortunately, many libraries do not maintain compatibility with the original MinGW compiler. The newer the libraries are, the less compatible they typically are. So, while SDL 1.2.15 is no problem to build with MinGW. SDL 2.26.5 is a nightmare. I'm currently looking into some issues related to building it with the original MinGW now. I maintain my own version of w32api based on the last public domain release and have been trying to add enough functionality to it to compile many of the more modern standard FLOSS libraries. I also built SDL 2 on AIX at one point to experiment with running SDL applications on AIX via X-forwarding. So, I have patches for that as well.

I've started a thread on Mastodon:
https://fosstodon.org/@lmemsm/110413981373101611
Would be very interested to hear how others are dealing with the SDL upgrade path and whether they will be upgrading, staying with what they have or seeking other libraries. If anyone's considering the route of maintaining older libraries, I'd be very interested in sharing resources and patches.
2023-05-12 01:28 pm

calendar program

I've been investigating calcurse which is supposed to have support for importing and exporting ical format and exporting pcal format. It sounded like it could integrate well with the other software I use. It has a calendar, information about appointments and a todo list. So, it covers a lot of the functionality I am interested in. I don't find the interface immediately intuitive, but there is documentation. I prefer programs that will work on any operating system I'm using. That means I need Windows support when I'm at work. I could not find any ports of calcurse to a Windows system. The code includes fork and other non-portable functionality which makes porting a nuisance. I did find a DOS version of calcurse. So, I figured if it had been ported to DOS, it could be made to work on Windows. I didn't read the fine print and the DOS port mentions the program hangs on exit and doesn't handle shelling to other applications properly. I went ahead and debugged those issues as best I could. It currently seems to be working on Windows with enough functionality to use it. Haven't figured out how to integrate it with my workflow yet, but it's at least a step toward some progress. I can get it to build with modified code, but I have not put in the work to attempt to automate the building and patching processes. If I'm just going to use it for myself, I may not need to go through that effort. However, if I want to share it and I want to be able to reproduce building on Windows easily, I need to set up my build scripts and create patch files. So, now I'm curious. Is there anyone other than me that would like to have calcurse working on Windows?
2023-05-09 10:44 am

Android on Windows

Slow Android emulators to test Android programs may be a thing of the past on my current Windows system. I downloaded and installed Windows Subsystem for Android. It's a convenient way to test out apps you've created without having to resort to installing VirtualBox and Android x86 or using other alternatives such as Qemu or some of the very slow Android app emulators.

If you want to try out other Android apps on your Windows system, you can do that as well. It may not look like there's a wide variety of apps to choose from at first glance. Windows Subsystem for Android comes with Amazon Appstore instead of Google Play store. I've seen some reports of getting Google Play store working but it doesn't seem worth the effort and really isn't necessary. If you're just going to test your own apps, you don't need an entire app store. However, it is fairly easy to get F-Droid installed on Windows Subsystem for Android. Most of the apps from F-Droid work very well in an emulator. F-Droid had more than enough apps for my needs. Also, there are other repositories such as IzzyonDroid that can be added to F-Droid giving even more options to choose from. Finally, there are sites, such as APKPure, that will allow you to download apk files directly. Once you have the apk file, you can install the app yourself.

The basics for installing apk files in Windows Subsystem for Android follow. First, download a copy of the Google Android platform tools for Windows. adb is the program that is required from the platform tools. Start up an Android app, any Android app, in Windows Subsystem for Android. This makes sure that Windows Subsystem for Android is currently running. At the command line, type:
adb connect 127.0.0.1:58526

Once a successful connection is made, most apk files can be installed from the command line using a command similar to the following:
adb install file.apk
Substitute the actual name of the apk file for file.apk in the command.

What if you have an xapk file instead of an apk file? Rename it to a zip extension. Use a tool like unzip to extract the files in the xapk. Use the command adb install-multiple with a list of the extracted apk files.

That's all there is to it. Once that's done, you can easily install Android apps and run them on Windows. I found some actually run better on Windows than on a phone. However, some did not fit the screen well and some required Bluetooth which is not yet supported in Windows Subsystem for Android. Still, you can run quite a nice selection of apps and you can use it to test your own Android apps as you develop them.
2023-05-05 01:48 pm

Inertia Alarm Program

I've continued my search for organizing software ( https://lmemsm.dreamwidth.org/25452.html ). I've tried several options available from F-Droid and Google Play. I've run across interesting concepts such as using gamification and rewards systems to encourage new habits or complete large tasks. There are also tools to help set goals (such as Specific, Measurable, Achievable, Relevant and Time-Bound SMART goals), break down tasks, remind when to do a task and track what's completed. With all those apps and even some FLOSS programs out there, I've yet to find anything I'm comfortable working with. Some of the commercial mobile apps have wonderful concepts behind them. However, they also have fees or ads or require you to sign up for a service on the Internet. The F-Droid apps are typically more friendly when it comes to privacy. They don't have ads and most don't require sending personal data over the Internet. They're typically simpler than the commercial apps which can be a good thing. However, it's a matter of finding one that does what you need in a way that's comfortable to you not just what the developers and core users need.

I've been reading a lot lately about flow states and the psychological inertia many experience when they're trying to break out of the flow and do something else. Writers may get lost in writing and forget to break for a meal. A programmer may be so engrossed in a coding project, he or she may not notice the clock and the fact that it's time to go home. Who really wants to miss that? Inertia can also make it hard to start a new task. So, I tried to narrow my search to alarm programs that could notify me when to change focus and switch tasks. There are several timer programs that can time tasks for you and fire off an alarm when the interval to work on a task is over. I decided I wanted something more along the lines of an alarm that notified me at a specific time every day. It was suggested I check out the Google clock program which has an alarm. The alarm certainly got my attention. However, I couldn't turn it off without turning off my phone completely and it could easily annoy people around me.

I finally decided to overcome my own inertia and stop searching for a solution and just write one. I used SDL because it ports to a number of platforms including mobile devices. I broke the job up into tasks and started with the most crucial pieces I needed. I figured it would be more difficult to come up with a file format and source code to decipher multiple alarm times, so I started by hard-coding the time. Then, I switched to passing the time via the command line. Once I got that working, I realized, I don't really need to store several alarm times in an initialization file for the program. Using the Unix philosophy of doing one thing well, I decided to leave that task to another program and call this one just to display one alarm. So, one could combine this program with another program like remind or one could use cron or Windows task scheduler to start this program when needed.

What I really wanted was a way to gradually shift gears when I'm heavily concentrating on something. I did not want a jarring alarm. I wanted something that would give me time to complete what I'm doing and transition to something else. I really liked the Toastmasters concept of using green, yellow and red signaling to decide when to end an ongoing talk. So, I started with the color concept. I added a way to play an optional wave file with it. By limiting what the program did to just handling the alarm related tasks, I was able to get it done in a fairly reasonable amount of time.

While I was searching for useful organizing and scheduling programs, I experimented with remind. I found it very promising, but it takes some work to create the entries you want to be reminded about. The main drawback is that its designed for Linux and the developer would prefer that it not be ported to non-Free operating systems. While it can be ported, I'd prefer to work with software created by developers who want to support multiple platforms. I do like the idea that it's a command line tool and can be customized using a text file. Instead of using todo programs, I've been using simple text files to keep track of my lists. I've found that more effective. Something like the todo.txt file used by todo.c and other programs might be an option at some point in the future because it combines the idea of a simple text file with a more programmatic tool. It would be nice to see a todo tool and an alarm tool combined. Possibly if a time is part of each task, a program could parse out times and activate an alarm when needed. So, I'm still searching for the right tools to use together to help improve organization. However, I'm happy to finally have an alarm that offers the features I most wanted.

I'd be very interested to hear how others organize and switch or begin new tasks when they're experiencing inertia. What tools and programs do you use? What works? Also, if anyone is interested in brainstorming putting together different simple tools that each do one task well to help improve organization and efficient use of time, feel free to contact me. Discussion is welcome via Mastodon (https://fosstodon.org/@lmemsm) or the distasis mailing list on groups.io.
2022-06-15 01:24 pm

To Do Lists and Personal Information Managers

I'd looked for personal information managers, todo and organizational programs and even countdown timers before. However, recently I started looking at some of the options at F-Droid which prompted me to look at the lightweight, cross-platform programs I've found in this category again.

fltdj ( http://www.geocities.ws/letapk/thedailyjournal.html ) is a great option if you need a lightweight personal information manager. It uses FLTK as its GUI library. Some other interesting options I previously tracked down and tried were hyperlist which works with SDL 1.2.15 and tux_todo which is also FLTK based. I haven't worked with hyperlist or tux_todo in a while and I don't see their source code available online any longer. While they are lightweight, I felt some more user friendly options might be a better match for me. OTK ( http://otk.sourceforge.net/ ) is an interesting cross-platform GUI based on OpenGL. Two user-friendly applications for OTK are StopWatchTimer and countdown_timer. Another program I discovered a while ago was rcard ( https://sourceforge.net/projects/rcard/ ), a contact management program that uses pdcurses/ncurses. It can work with files in vcf format.

I recently searched for console based todo list programs. There are also several console based options mentioned at the Inconsolation site ( https://inconsolation.wordpress.com/ ). I searched through several of them trying to find the more portable options. I also searched various code archives looking for cross-platform portable C programs in this category. Most of what I found was fairly simple. Here's a list to date which I've tried to break down by functionality.


Habit trackers:
habit (cli) https://github.com/iestynpryce/habit
habit-builder-challange-30days (cli) https://github.com/ethemsvg/habit-builder-challange-30days

todo.txt based programs:
ctodo (ncurses/pdcurses) https://github.com/nielssp/ctodo
Todo.c (ncurses/pdcurses) https://github.com/Sir-Photch/Todo.c
todo-C (cli) https://github.com/29rohitkr/todo-C
The following works cross-platform if you comment out the wordexp related code for systems that don't support it:
todo.c (cli) https://github.com/hit9/todo.c
todocmd (cli) https://github.com/iiAtlas/todocmd
todocmd (cli) https://github.com/cfolwell/todocmd

Other scheduling programs:
memo (cli) https://github.com/anttiviljami/memo
tasktimes (cli) https://github.com/timpark/tasktimes


Another FLTK based organizer program that I recently compiled was MUPO ( http://www.jwwulf.de/de/apps/mupo/intro_en.htm ). Needed a few modifications to work with FLTK 1.4.x, but it does compile, build and run.

As to finding a good FLOSS todo organizer for Android devices, I'm still looking. However, F-Droid offers several options. Editors that are designed to work with todo.txt files are another option available on Android.

If anyone has other suggestions for lightweight and portable organizer and timer applications, please let me know. I'll be adding to this list as I come across other alternatives.
2022-03-19 01:36 pm

Lightweight C Applications and Libraries

While I have other lists that cover a variety topics, wanted one that just had useful lightweight C programs, utilities and libraries. So, I'll be repeating some links here. However, I hope to add some new projects as well. I'd also be interested in hearing suggestions that fit the criteria of lightweight, cross-platform C projects. If you're aware of any I've left off this list, please let me know.

bard
Ebook reader with text-to-speech support using SDL and flite. I have some patches for this program to improve portability and support using SDL2.
https://github.com/festvox/bard

BearSSL
Rather secure implementation of the SSL/TLS protocol. Can be used with curl.
https://bearssl.org/

cal
Command line calendar.
http://unicorn.us.com/cal.html

cDetect
C based alternative to GNU configure/autoconf. More info at IngwiePhoenix's cDetect project ( https://github.com/IngwiePhoenix/cDetect ). Plus, I've forked the project and use it with many of my builds from source code. I've added support for cross-compiling and many, many other features. Contact me if you'd like a copy.
http://cdetect.sourceforge.net/

csvutils
CSV command utilities. Uses libcsv.
https://github.com/rgamble/csvutils

curl
Command line data transfer tool.
https://curl.se/

diction and style
Analyze documents for readability and other metrics. Find grammatical issues.
https://www.gnu.org/software/diction/

diff
diff implementation for sbase. Check the follow-up mailing list threads for further patches.
https://lists.suckless.org/dev/1601/28247.html

diffh
Works with diff and creates an easy to read display of differences between files.
https://sourceforge.net/projects/diffh/

dr_libs
Single file header audio decoding libraries.
https://github.com/mackron/dr_libs

easylzma
Public domain compression and extraction library for lzma.
https://github.com/lloyd/easylzma/tree/master

fcurl
Library to simplify working with curl.
https://github.com/curl/fcurl

BSD gettext
Older BSD gettext/libintl implementation. I have a fork of this one as well. Also, check out the BSD Citrus Project.
https://www.mmnt.net/db/0/18/ftp.khstu.ru/pub/unix/distfiles

gifsicle
GIF animator utility.
http://www.lcdf.org/gifsicle/

grafx2
Graphics editor.
http://grafx2.chez.com/

BSD gzip
BSD version of the gzip compression/decompression program. There are various forks to port this to operating systems other than BSD. I have a portable fork as well.
https://github.com/NetBSD/src/tree/trunk/usr.bin/gzip

less
Less is more than more, pager program.
https://www.greenwoodsoftware.com/less/

libcsv
ANSI C library to read and write CSV files.
https://github.com/rgamble/libcsv

libgrapheme
C99 Unicode library including encoding, decoding and line-break functionality.
https://libs.suckless.org/libgrapheme/

liblzw
Library for LZW (.Z) compression/decompression.
http://freestdf.sourceforge.net/liblzw.php

libtomcrypt
Public Domain cryptography library.
https://github.com/libtom/libtomcrypt

libutf
C89 UTF-8 library which includes an API compatible with Plan 9's libutf plus a number of improvements.
https://github.com/cls/libutf

lxsplit
Command line file split/join tool.
http://lxsplit.sourceforge.net/

man
C program to view standard man pages. Now part of Elks (elkscmd/sys_utils).
https://github.com/jbruchon/elks/blob/1b6110b73fbb123021a5a29b05d8fa9caef33235/elkscmd/sys_utils/man.c
https://github.com/rofl0r/hardcore-utils/blob/master/man.c

mandoc
BSD version of man page utilities. Uses their manpage format. Includes tools to convert to manpage format used by most man tools.
http://mandoc.bsd.lv/
https://embedeo.org/ws/doc/man_windows/

minicpio
Mini cpio compression and decompression routines.
https://github.com/rayae/minicpio

minizip library
A zip library for zlib. Useful when working with files in zip format. Code is in the contrib section of zlib.
http://zlib.net/

nanosvg
Lightweight SVG library.
https://github.com/memononen/nanosvg

ncurses hexedit
Curses based hex editor.
http://www.rogoyski.com/adam/programs/hexedit/

nemini
Lightweight SDL2 based Gemini client.
https://github.com/neonmoe/nemini

BSD patch
BSD fork of the patch program. I have a fork of this as well with some portability additions to better handle carriage return/line feed issues.
https://github.com/openbsd/src/tree/master/usr.bin/patch

pdfconcat
Concatenates PDF files.
https://github.com/pts/pdfconcat

pdftxt
Convert PDF to text. Helpful for searching PDFs with grep.
https://litcave.rudi.ir/

pdlzip
Compression/decompression for lzma format compatible with the lzip data compressor.
https://www.nongnu.org/lzip/pdlzip.html

picaxo
Graphics viewer.
http://gigi.nullneuron.net/comp/picaxo/

pkgconf
Drop in replacement for pkg-config with no circular dependencies.
https://github.com/pkgconf/pkgconf

pspg
Postgres pager provides a console based pager for PostgreSQL, MySQL, CSV and other formats. Uses ncurses (or pdcurses).
https://github.com/okbob/pspg

sbase
Efficient implementations of core base utilities.
https://core.suckless.org/sbase/

shot
Command line screenshot program.
https://github.com/rr-/shot/

sox
Sound exchange utility. Converts sound formats. Plays audio files.
http://sox.sourceforge.net/

stb
Public Domain single file header libraries. Includes stb_truetype.h, a lightweight alternative to the freetype library, which can parse, decode and rasterize characters from truetype fonts.
https://github.com/nothings/stb

TinyLZMA
Minimal LZMA compressor and decompressor.
https://github.com/WangXuan95/TinyLZMA

unarr
Decompression library for rar and other formats. Part of sumatrapdf project.
https://github.com/sumatrapdfreader/sumatrapdf/tree/master/ext/unarr
Standalone version of unarr.
https://github.com/selmf/unarr

x509cert
Generate x509 certificate requests. Works with BearSSL.
https://github.com/michaelforney/x509cert
2022-01-29 03:05 pm

diff and patch

I've been interested in the BSD versions of diff and patch for a long while now. I often use a version of patch modified from various BSD patch implementations that were based on patch version 2.0.12u8. My variation includes some support for carriage return/line feed differences among systems. I've found it useful when working with patches from Windows or DOS systems that might accidentally introduce carriage return/line feed sequences instead of just line feed which POSIX systems use.

Recently saw an informative page covering some of the history of patch and diff:
https://invisible-island.net/diffstat/
It mentions that the 12u variant of patch contains no copylefted code. It also mentions a version 2.0.12.u9. So, I thought it was interesting that the various BSD versions found on NetBSD, OpenBSD and FreeBSD seem to start with version 2.0.12u8 as their basis. I'm very curious as to why they started with u8 instead of u9 but have seen no documentation on it. There doesn't seem to be that many differences between u8 and u9 so they probably didn't use much that was useful. If anyone knows anything further on this or know of some projects that started with the u9 version, I'd appreciate hearing about it.

BSD operating systems such as NetBSD switched from the BSD 4 clause license to the 2 clause. The 2 clause license is compatible with GNU license software while the 4 clause is not. So, it's not surprising that most of the code for BSD diff can be found with a 2 clause license. However, the diffreg.c file still contains the 4 clause license and a 3 clause license. I've searched for alternative versions of diffreg.c with other licenses. There are other versions available such as the diffreg.c that comes with the Plan 9 diff. They use the same algorithm. However, they don't contain some of the updates found in the BSD versions such as support for unified diff.

The BSD version of diff uses the longest common subsequence algorithm which performs in O(n2) at worst case and typically performs as O(nlogn). There is a newer algorithm by Myers that performs in O(nD). It's used by GNU diff. I saw a request a long while ago for someone to update the BSD diff to use the Myers algorithm. I don't think anyone's ever completed the task.

While the BSD version of diff is very usable, it would be nice to have a version of diff without the 4 code clause so that it could possibly be used as library code in conjunction with software that might contain GNU licensed source code. I prefer working with a more lenient license like BSD 2 clause or MIT rather than GNU when possible. So, it would be great to find a version of diff that supported unified diff output and avoided the GNU or BSD 4 clause licenses. I think the main alternative that might offer diff with a more lenient license and unified diff support would be Toybox. The Toybox license is BSD 0. However, Toybox doesn't support as many command line options as BSD or GNU diff.

I also just found out that there are versions of diff and patch for sbase. However, they're not in the main source code repository for sbase. You can find the source by searching the dev list from suckless.org. The sbase diff appears to be fully POSIX compliant. It's missing several features that were added to BSD and GNU diff programs. It supports unified diff only. The output is very close to the output of the BSD diff utility and it also uses the longest common subsequence algorithm.

I did run across the code to convert between diff standard output and unified diff output:
https://github.com/AceHusky12/unidiff
It's listed as public domain.

If anyone else is using an unusual variant of diff or patch or is writing their own, I'd be very interested in hearing about. I would love to compare notes on some of the different BSD variants out there and the various features they support.
2022-01-27 11:48 am

SVG and Postscript

I'm still looking for lightweight alternatives to work with and display Postscript or SVG files. I've previously compiled some of the information I've found on PDF and Postscript related programs here: https://lmemsm.dreamwidth.org/3702.html As mentioned, programs such as abcm2ps, lcal, pcal and others output to Postscript. So, I wanted to find a lightweight way to view the output. The abcm2ps program can also output to SVG. One thought was to convert Postscript or SVG to PDF and view the files with mupdf. So, far I haven't found a solution I've been happy with.

I wanted to avoid heavyweight programs and dependencies such as Ghostscript and librsvg. I've been using nanosvg for SVG files. There's an example svgview utility that comes with it. SDL2_img now supports SVG using nanosvg, so you can load and view images that way. I often use picaxo for quick image viewing and since it uses SDL2_img, it's able to support display of some SVG files. I've also been experimenting with an older version of mupdf that was released under a GPLv3 license. Along with adding cbr support (thanks to a FLOSS library from sumatrapdf), I added SVG support using nanosvg. I haven't tried the latest release of mupdf, but I did try a version a few years ago and nanosvg did a better job of handling SVG files than the mupdf code at the time.

I recently found an interesting lightweight SVG to PDF converter than uses nanosvg and libharu. Thought it might be worth checking out. It's called svgtopdf: https://github.com/MichaelMorozIQDirect/svgtopdf There's also a fork with some improvements at: https://github.com/Erroneous1/svgtopdf/tree/improvement/CurveTo As in the other solutions I've tried, it works well for some SVG examples but not others. I thought it was a very clever idea though. Biggest drawback with the program is that there's no information on licensing. I can't tell whether it would qualify as a FLOSS program or not. Would be nice if the author clarified the situation. It's written for Windows, but I believe it would be fairly easy to port to other operating systems.

I haven't found the solution I've been looking for, but trying svgtopdf did give me an excuse to update my libharu build scripts. I've switched them from using cmake to using CDetect, pkgconf and make. The library builds and works quite well. Haven't tracked down all the bug fixes and patches since version 2.3.0 and I don't think there have been any official releases since then. However, if I find some other programs I need that depend on it, I'll definitely look into updating the source with some of the patches others have created for it. Seems like it could be a useful library.

I am still trying to find utilities that handle rendering abcm2ps output properly. So far, I've found no lightweight solutions. Heavyweight browsers or Ghostscript can handle the situation, but I'd really like to find alternatives that are easier to build from source and would be more efficient on very low resource computers.

Also ran across an interesting C program to concatenate PDF files called pdfconcat:
https://github.com/pts/pdfconcat
I asked on github about the license since it wasn't indicated and just found out from the developer that the license is GPLv2. Looks like a nice program. Definitely worth sharing.

If you know of other lightweight SVG, Postscript or PDF utilities or conversion programs with minimal dependencies, I'd be very interested to hear about them.
2021-11-29 10:54 am

Holiday Gifts

Whether you celebrate 8 days of Hanukkah, 12 days of Christmas, 7 days of Kwanzaa or anything else, it's always nice to have presents. With supply chains backed up and health hazards of shopping in crowded locations, this year is a great time to consider homemade presents.

I know many believe you get what you pay for me and that homemade gifts are not worthwhile. However, consider the time, effort and manpower that went into making a homemade gift. If you had to monetize it by paying someone else to do the work for you, with today's rising inflation, it would certainly cost a pretty penny to hire someone to do the job. Often a homemade gift has more intrinsic value that the latest cool commercial gadget or game.


Here are some gift ideas for the season...

Coloring

Coloring has been found to be a useful stress reduction activity. Give yourself the gift of a homemade coloring book using public domain clip art. You can also give your finished artwork or handmade holiday cards to others as a present.

Public Domain snowflake clip art to get you started:
https://www.rawpixel.com/board/1308894/vintage-snowflakes-wilson-alwyn-bentley-i-high-quality-cc0-images

Some other places to find artwork to color:
https://openclipart.org/faq
https://www.pdclipart.org/
https://publicdomainvectors.org/
http://commons.wikimedia.org/wiki/Main_Page

You can also create your own designs to color with free programs like TuxPaint and mtPaint ( https://github.com/wjaguar/mtpaint_handbook ) and rgbPaint ( http://mtpaint.sourceforge.net/rgbpaint.html ).

Exercise

Give yourself the gift of exercise. Why wait until your New Year's resolution to go to the gym when you can start exercising now and feel better for it? Studies have shown Vitamin D from sunlight can help protect against diseases ( https://www.sciencedaily.com/releases/2021/09/210915095408.htm ). Awe walks can have positive health effects and improve your mood more than walking just for the exercise ( https://pubmed.ncbi.nlm.nih.gov/32955293/ ). Try an early morning walk outside and enjoy the beauty of nature or try doing a Tai Chi form, QiGong exercise set or some yoga out in the sunshine. See how you feel afterwards.

Books

A book can be a wonderful gift.
Here's one of my favorite science fiction books:
http://www.gutenberg.org/ebooks/18137
It even includes a furry protagonist. Hope others enjoy reading it as much as I did.

Here's a list of free books that could make nice presents:
https://lmemsm.dreamwidth.org/13112.html

Books don't have to be fictional to be fun. Check into the many wonderful public domain hobby related books such as recipe books available online. You can also create your own and share it with others.

Want to find more ideas for books to read? Check out the reviews at BookWyrm
( https://bookwyrm.social/ ) or share some of your own reviews. If the book you want to read is not in the public domain, check archive.org or online resources from your local library to see if they can help you access it.

Movies

Some movies and TV shows with well known characters are actually in the public domain. So if you're in the mood for a literally free movie, check some of these out.

Mysteries

https://archive.org/search.php?query=charlie+chan&and[]=mediatype%3A%22movies%22&and[]=year%3A%221973%22&and[]=year%3A%221966%22&and[]=year%3A%221949%22&and[]=year%3A%221948%22&and[]=year%3A%221945%22&and[]=year%3A%221943%22&and[]=year%3A%221942%22&and[]=year%3A%221941%22&and[]=year%3A%221940%22&and[]=year%3A%221939%22&and[]=year%3A%221938%22&and[]=year%3A%221937%22&and[]=year%3A%221936%22&and[]=year%3A%221934%22&and[]=year%3A%221931%22&and[]=year%3A%221917%22&and[]=subject%3A%22mystery%22&and[]=subject%3A%22Charlie%20Chan%22

Action and adventure

https://archive.org/search.php?query=superman&and[]=mediatype%3A%22movies%22&and[]=year%3A%221948%22&and[]=year%3A%221947%22&and[]=year%3A%221944%22&and[]=year%3A%221943%22&and[]=year%3A%221942%22&and[]=year%3A%221941%22&and[]=year%3A%221940%22&and[]=year%3A%221939%22&and[]=year%3A%221938%22&and[]=year%3A%221937%22&and[]=year%3A%221936%22&and[]=year%3A%221932%22&and[]=year%3A%221930%22&and[]=year%3A%221920%22&and[]=subject%3A%22superman%22

https://archive.org/details/TARZANOFTHEAPESPUBLICDOMAINVERSION
https://archive.org/details/silent-the-adventures-of-tarzan
https://archive.org/details/TheAdventuresOfTarzan1921USAedicinAmericana.3gp
https://archive.org/details/silent-the-son-of-tarzan

Science Fiction

https://archive.org/search.php?query=Flash%20Gordon%20Conquers%20the%20Universe%20taylor%20AND%20mediatype%3Amovies
https://archive.org/details/PurpleDeathFromOuterSpace

https://archive.org/details/planet_outlaws_ipod

You can find more movies and adventures by searching archive.org.
You can also look through the listings at this site:
https://www.openculture.com/freemoviesonline

Here's some information on a radio play based on a popular movie series which includes material from my favorite author:
https://www.openculture.com/2020/05/the-original-star-wars-trilogy-adapted-into-a-14-hour-radio-drama-by-npr-1981-1996.html

Stargazing

Stargazing gives you something to do with your time that's aesthetically pleasing and a good learning experience. You can find out about constellations, planets and moons.

To help you get started, here are some free programs for your PC and phone that can help guide your star search.
https://f-droid.org/en/packages/org.tengel.planisphere/
https://f-droid.org/en/packages/com.google.android.stardroid/
http://nightsky.sourceforge.net/
https://portableapps.com/de/apps/education/stellarium_portable
https://portableapps.com/apps/education/celestia_portable

Games

What good is a gift idea list without the mention of games? From Free, Libre and Open Source computer games for your electronic devices to Creative Commons and public domain books about how to play a wide variety of games, there are several great resources for finding and sharing free games.

Here's my list of educational games for computers and mobile devices:
https://lmemsm.dreamwidth.org/15912.html
Know of others? Please share them.

You can play games remotely via: https://www.freeboardgames.org/

Birding

Give to others by giving the birds a gift this year. You can create bird feeders from recycled materials. You can also start planning your gardens and include some bird, animal and environment friendly plants. The birds may even give you a gift in return with some beautiful bird songs.
You can watch birds anytime virtually:
https://www.allaboutbirds.org/cams/cornell-lab-feederwatch/
It's also fun to learn how to identify the different types of birds that visit your neighborhood. Check out some of the free bird identification resources online such as public domain birding books and the e-bird program.

Giving to Others

Sometimes the best gift is sharing your time and skills with others.

This year, how about volunteering to help a Free, Libre, Open Source software project? You don't have to be a programmer to help out. They also need beta testers, artists, translators, help writing documentation and guides and help with other tasks. How fun would it be to beta test some computer games and be helping FLOSS projects at the same time?

There are also several Creative Commons projects in need of resources such as artwork, creative writing, multimedia recordings and more. You can add your creative works to a site featuring Creative Commons material using a CC license. You can also volunteer to help out various CC projects and web sites.

You can also help projects like these by advocating for them. Get involved with events like Software Freedom Day to help spread the word about great FLOSS and CC resources. Use FLOSS sites such as Get Together ( https://gettogether.community/ ) and Mobilizon ( https://instances.joinmobilizon.org/instances ) to share events. Use FLOSS programs ( https://lmemsm.dreamwidth.org/14124.html ) to host them virtually.

If you have a web site or blog or develop sites, help by making them more accessible. Find out more from projects like https://anybrowser.org/ and sites that discuss web accessibility such as 508E guidelines and A11Y best practices.

Continuous learning helps with brain health and neuroplasticity. Learn something new and help the world by volunteering your scientific skills. There are several citizen science projects in need of volunteers.

You can find more volunteer related links here:
https://lmemsm.dreamwidth.org/18603.html


Wrapping Up

Those are some of my gift ideas for now. You can also check earlier posts for holiday ideas from previous years. If you have other free resources you recommend, I'd enjoy hearing about them. Give a gift this year by sharing your own ideas, creativity and resources with others.
2021-11-19 09:14 am

Lightweight Command Line Utility Program Alternatives

I've been investigating some of the lightweight, command line utilities that are often used to check the status on a system. In some cases, it was hard to track down the packages they were in. It's difficult to search when some of the names are so ubiquitous. Just try running a search for the free utility.

I knew that many of the utilities were in the GNU coreutils package. I found out that many others were often supplied by the procps or the newer procps-ng packages. The procps and procps-ng packages are fairly Linux specific. So, it's not likely you'll find the code ported to other operating systems. While GNU coreutils ports to many platforms, I typically prefer GNU alternatives. They tend to be more lightweight with not as many features. Also, many GNU developers don't particularly like programming for portability and often won't accept patches for their code when there are portability issues. Many of the utilities I considered have been on Unix systems for a long time and are also available on BSD systems. The GNU versions tend to add more features and functionality. BSD systems don't use coreutils, so most of the programs are part of the operating system code.

Busybox and Toybox provide a lot of the utilities as well. Both Busybox and Toybox are designed as one monolithic program that can be accessed through links to the various utility names. That's convenient because there can be a lot of repetition between what some of these programs do. Having the code in all in one place means less maintenance for repetitive tasks. In a few cases, more standard versions of some utilities took this approach as well. For instance, the w program on a BSD system is also the who program.

It seems almost random as to what stats some of these programs cover. For instance, uptime not only gives you how long the machine was up, it also gives you how many users are on the system and system load averages. Sometimes seemingly non-related information may all be returned by the same function on a particular operating system, but sometimes it requires different functions to check each statistic. So, why put it together in this particular presentation? Likely, it's just because that's how it's historically been done and changing too much could break a lot of scripts out there. Some lightweight implementations don't always show all the information of the more common versions of the utilities either. For instance, some versions of uptime just show the boot time and don't bother with the other statistics.

Command line options for invoking a program may not be the same for different versions of a program. Also, since many of the programs have been around a long time, the command line options may not be that intuitive. For instance, I typically see -h reserved for help, but in some cases, it's being used for printing a human readable format. Some other utilities use -H for human readable. Some use both lowercase and upper case for human readable but use factors of 1024 bytes for one instance and factors of 1000 for the other. Personally, I would prefer to use -h for help and -B with a blocksize to indicate what factor I might want to divide by. That way you don't need separate command line options for kilobyte, megabyte, gigabyte and kibibyte, mebibyte and gibibtye. Many programs don't even offer options for terabyte which has become much more standard. As memory sizes go up, the older hard-coded options won't adapt as well. As mentioned, one of the issues with changing command line options to make utilities more uniform is that it could interfere with backward compatibility and cause other programs depending on that functionality to fail. However, all the various implementations aren't exactly standardized to begin with. The Open Group has some standards for utility conventions. Many programs use getopt or getopt_long to help standardize parsing of command line. However, it's not enough of a standard to prevent all the differences between different implementations. So, it's not like scripts can rely on all the same options to be there on different platforms or with non-standard software choices anyway.

I was interested in tracking statistics on memory usage, disk space, CPU usage, process and user related information and when a machine was rebooted. The tools I investigated included free and vmstat which show memory usage, df and du for disk space usage, uptime for CPU usage and boot time, nproc shows number of CPUs, ps and top for process information and utilities such as w, who and whoami for user related information.

I wanted to find lightweight alternatives that I could use on multiple platforms and not just Linux. Minix 3 uses a lot of the BSD utilities, so going with those might be one alternative. However, many still have a lot of code to implement them and the code is often very specific to BSD style operating systems.

One place to find lightweight versions of some of these utilities is ubase which was designed with the suckless.org philosophy in mind:
https://git.suckless.org/ubase/files.html
The code is very readable, but can be very Linux specific. Another alternative is nbase:
https://github.com/cheusov/nbase
This is a port of NetBSD tools to POSIX systems so that makes it a more portable option. Earlier versions of Minix had some lightweight versions of various utilities in their commands/simple directory before they switched to the BSD versions. PicoBSD also had some interesting lightweight utilities programs including aps and sps which are ps alternatives and vm which is a vmstat alternative.

There are also Windows ports of utilities such as ntop:
https://github.com/gsass1/NTop However, while some of these programs look like common Unix/Linux/BSD utilities, many are completely rewritten from scratch and would not port well to other operating systems besides Windows. Alternative operating systems such as hobby OSs that some developers create may have some of these utilities as well. After all, they're simple, command line based and useful. However, since many of the hobby OSs don't support POSIX or have large differences in kernel design, their implementations probably don't port well to other platforms either.

I'm currently in need of utilities that work on Linux, AIX and Windows. I've been investigating writing some of these utilities from scratch in a more portable manner so I can use them in a consistent way on whatever operating system I may need them. Unfortunately, they can be difficult to write, since the underlying functions are not part of the C or POSIX standards and are very platform specific. They can even change with the version of the operating system. Nevertheless, I'm going to continue to work on implementing more portable alternatives for some of the more common utilities. They're useful and their functionality is sorely missed on operating systems where they are not native. It would be really interesting to discuss design issues and trade-offs further with any developers who may be working on similar projects or with users testing out these types of utilities.

Would love to compare notes on this subject. Are there other simple command line utilities that I haven't mentioned that you use to check the status of your operating system? Do you know of other alternative implementations for some of the more common utilities mentioned? Are you interested in using some of these utilities on an operating system where they may not be as readily available? Let me know about your experiences in this area.
2021-11-06 07:23 pm

Open Source Utilities for AIX

I was tasked at work to find some monitoring tools for AIX. I'm familiar with AIX Toolbox and a few third party repositories. I wanted to build some programs from source code. I use a lot of portable programs and can port them to wide variety of platforms including AIX. However, monitoring tools in general are usually not too portable.

We already have nmon on the system. I also found source code for a related program njmon, but it's mostly for gathering statistics and then some kind of reporting utilities are needed to make sense of the data. I looked for top, but couldn't find it. Read that topas is available instead. I couldn't locate any source code for topas, so I guessed it was closed source. Just confirmed that. It's based on nmon for AIX code which is closed source. So nmon in AIX is not Open Source either. I would prefer to use Open Source tools so the source code can be modified if needed and so I can maintain and patch the software if necessary. Decided to try to build htop and it built on AIX with some patching. However, it didn't display anything and said platform unsupported. I found some old patches for AIX for an older version of htop that's not even in the current htop repository. I was able to incorporate the older patches into the latest version and get system related information to display. I contacted the htop project, but they're not at all interested in adding AIX support even if patches to do so are supplied to them. So, I'm debating whether to use a patched htop on AIX or whether I should look for another utility that can do a similar job but would be a better option for AIX systems. I found an old version of top that had AIX 5 support. It works fine on AIX pretty much as is. I've used saidar on BSD systems. It's part of libgrabstat. It built fine from source on AIX. I know there's an uptime utility on the system, but it should also be fairly easy to create a simple, portable uptime program that would work on a variety of platforms including AIX and Windows.

We also installed nano on AIX at some point. I think it's been removed from the AIX Toolbox since then. It's an old version of nano and seems rather buggy. When using nano via ssh, the scrolling gets really messed up. Rebuilt nano from a later version of the source code. It seems to work fine.

I'll be looking for other command line utilities that are somewhat portable and may work on AIX. Will add the results of my search here. If anyone runs across some useful tools that have AIX support or that port easily to AIX, please let me know. If anyone's interested in sharing code, patches or programs, contact me. Would also be very interested to hear what FLOSS programs others are using often on AIX systems.
2021-11-04 11:22 am

Revisiting SSL Libraries

I've been looking into three different choices for a SSL/TLS library: LibreSSL, MbedTLS and BearSSL. I'd investigated SSL libraries and switched to LibreSSL in 2017: https://lmemsm.dreamwidth.org/7048.html With some Linux distributions dropping LibreSSL as their library of choice and reports of compatability issues with various applications, I felt it was a good time to reevaluate that decision.

Parts of LibreSSL are under multiple licenses including BSD style licenses.  However, there are some clauses in at least one license that are controversial when combined with GNU public licenses.  MbedTLS is available under a dual license of either Apache 2.0 or GPL 2.0.  The GNU GPL 2.0 option makes it more compatible with some GNU public licenses.  BearSSL is released under a MIT license which is typically the least problematic license of the three when it comes to using it in projects with other licenses.  Plus, BearSSL is very secure.  Many of the security issues reported for various SSL/TLS libraries typically just aren't a problem with BearSSL. The major drawback is that many applications and utilities expect an OpenSSL compatible library.  LibreSSL has typically been able to fill that role very easily.  However, as the designs between OpenSSL and LibreSSL diverge, it's going to be harder to find applications that support both without requiring more and more patching.

The curl project is notable because it offers several choices for backends. There are at least 14 to date:
https://daniel.haxx.se/blog/2019/12/11/BearSSL-is-curls-14th-tls-backend/
Plus, many other programs use libcurl.  There's also an easy interface for adding libcurl functionality to a program should a C/C++ programmer want libcurl functionality:
https://github.com/curl/fcurl  
So, some of the issues with finding a SSL library that is supported can be overcome by using programs that instead support curl as a backend.  As an example, Netrider's wkccc web library works with libcurl. So does vorbistools.

Many SSL libraries also provide a cryptographic library.  However, some projects only supply cryptographic support.  Of the various cryptographic libraries, I've been using LibTomCrypt https://github.com/libtom/LibTomCrypt which is public domain.  Interestingly enough, NaCl is also in the public domain.  Might be worth investigating if there is any functionality in it that is not yet available in LibTomCrypt. I've written my own checksum utilities including md5sum, sha256sum, sha512sum and a base64 program.  I used LibTomCrypt as the backend for these utilities to provide the hash functionality. There are several implementations of hash functions available in the public domain or with a variety of licenses. There was no reason to reinvent the wheel yet again and create a new hash implementation. Plus, LibTomCrypt has a nice API that will let you easily switch between hash functions if you want to write your own all-in-one checksum utilities similar to a BusyBox or ToyBox implementation. Even libraries like musl borrowed from some of the public domain code from libraries such as LibTomCrypt instead of creating something completely from scratch.

I'd like to minimize the number of SSL and cryptographic libraries on my system without losing too much functionality.  I'd rather not have to pick and choose building some programs with one SSL library and some with another just because of licensing issues.  So, the trick will be finding enough useful programs that will work with whichever SSL library I end up with.

There's a library for working with Keepass compatible files called libkpass which is used by the program ckpass.  It has GNU GPLv3 licensing and currently uses nettle.  I'm trying to see if LibTomCrypt or one of the other SSL crypto libraries will work as alternative to nettle. Using nettle and GnuTLS is another option for SSL/TLS support. However, I'd prefer to avoid that option if possible or it will bring GPL license considerations into every application, not just those that already use the GPL license.

My main issue is making sure curl will build because it is such a useful program and library. The dependencies I currently have for building curl currently include c-ares, libssh2 and nghttp2. Curl uses a SSL/TLS library of some kind, but, as mentioned, there are several choices available.

libssh2 requires a cryptographic library.  It has support for the cryptographic libraries that are part of the LibreSSL and MbedTLS projects.  However, there's no direct support for BearSSL.  I'm looking into how difficult it would be to add LibTomCrypt as a backend since I'm already using it with other utilities.

nghttp2 may need a SSL library as well.  It has options to use OpenSSL (or LibreSSL) and it needs c-ares (another curl dependency).

I didn't notice any SSL or cryptographic requirements with c-ares, but I've been having other issues with it. One platform I build programs on is Windows and I prefer to keep the programs backward compatible with older versions of Windows so they can be built with a compiler from the original MinGW project and so that they will run on systems like ReactOS. Every time I build a new version of c-ares, I'm finding it less and less compatible with older versions of Windows. The latest version of c-ares requires at least a Windows Vista system and I'm still attempting to be backward compatible with Windows XP systems. A couple of alternatives, patch around the functionality that's not available on older systems or switch to using a POSIX compatible layer underneath like Cygwin does. That latter approach would avoid the constantly changing Win32 API completely. I have been checking into creating a POSIX compatible socket library and did a lot of work on it at one point. However, some libraries and programs would still require a lot of patching to switch Windows builds to using it over the Win32 API because they assume if it's a Windows platform it must use the Win32 API.

I rebuilt curl last year without too many issues. However, trying to update to the most recent libraries and programs needed to build curl has become a mess of dependencies and backward compatibility issues without a clear resolution in sight. So, it's basically a work in progress.

Building curl successfully is one piece of the decision making process when choosing a SSL library but there are other factors. Not all programs use libcurl for SSL support. Some use a SSL library directly and will need to lose SSL capabilities or be modified to use another library or libcurl if their dependency needs can't be met. Tools from SSL libraries are often needed to set up certificates on a system. Cryptographic libraries may be needed for signing shared messages or files and for checking security of signed information.

Michael Forney has done a lot of work adding compatibility with BearSSL to software used in Oasis Linux.  His list of BearSSL compatible programs is here:
https://github.com/oasislinux/oasis/issues/14
He's also written libtls on top of BearSSL to help with some of the compatibility issues. I have not attempted porting libtls to non-POSIX platforms, but it doesn't look like a quick option.

Michael Forney has written a tool to help generate X509 certificates and certificate requests:
https://github.com/michaelforney/x509cert
This functionality is something that OpenSSL and LibreSSL already provide.  There may be code available to provide this type of functionality for MbedTLS, but I haven't found it yet.  The x509cert program does port to non-Posix platforms like Windows with a little patching.  LibTomCrypt added some X509 support, so it might be interesting to see if a tool could be created that worked with that library.

SSL libraries are used most often with browser programs. As mentioned, netrider uses curl, so that won't be as big of an issue. The other browsers I like to build from source are lynx, D+ (a more portable fork of Dillo) and possibly links. The lynx browser is a text based browser. I find it very useful when checking the accessibility of web sites. If it looks okay in lynx, odds are, it will be okay in most browsers and accessible to some screen readers. It is useful to have some basic graphical support in browsers without requiring the latest browser engine implementation with all the newest HTML, CSS and scripting features. Links is very similar to lynx but adds some basic graphics capabilities. There's a fork that uses SDL as a backend, so graphics could be viewable in framebuffer mode outside of X and Wayland on Linux systems. D+ and Dillo are lightweight GUI based browsers that use FLTK. FLTK is one of the lighter GUI frameworks still available and actively developed. I like to use diffh in conjunction with the diff utility. The output of diffh is HTML. Unfortunately, I've yet to find a text browser that renders the output well (even when the content is all text). D+ offers a lightweight solution without requiring a high-powered browser on the system. Dillo is more updated and better supported, but the project has never been open to cross-platform portability. So, D+ which works in a variety of environments including FreeDOS seems like a better choice for my purposes.

There are issues when using certain types of licenses together in a project. The LibreSSL and original OpenSSL licenses are not compatible with GNU Public Licenses due to conflicting restrictions in one of the license clauses. There are BSD style licenses with clauses ranging from 0 to 4 or more. BSD style licenses with 4 or more clauses typically become an issue with compatibility if you want to work with projects that use the GPL. There are issues with some versions of Apache licenses combined with some versions of GNU licenses. The Apache 2 license now used by OpenSSL fixed a lot of that but there are still conflicts between the GNU GPLv2 license and the Apache 2 license. I tend to prefer less strict licenses so I often opt for GNU GPLv2 applications over GPLv3 applications. The Linux kernel remains GNU GPLv2 as well. So, any decision on SSL libraries not only needs to take into account which libraries are easiest to build projects with but also which libraries are legally compatible when used.

The lynx license is GPLv2.  It will probably never be updated to GPLv3 or later because many of the original contributors can't be contacted to get approval for the license change. I don't see any linking exceptions for lynx in the current documentation.  The Apache 2 license that OpenSSL uses may be an issue with GNU GPLv2 programs like lynx.  However, lynx shows that support has been added for OpenSSL, LibreSSL and gnutls in some of the comments. I assume, since the code includes mention of these libraries, the developer(s) are okay with use of OpenSSL or LibreSSL being linked to the lynx code. Links, on the other hand, uses GPLv2 or later, so doesn't run into some of the issues of programs that only support GPLv2.

Dillo, which is currently licensed GPLv3, had a linking exception for OpenSSL at one point.  I thought it had added LibreSSL as an exception as well, but current versions no longer have any license exception clause and no longer mention OpenSSL as an exception.  This is probably due to the fact that they assume use of a later version of OpenSSL with the newer Apache 2 license. That license is compatible with GPLv3. D+ had support for OpenSSL and experimental support for cyassl (now available as WolfSSL).  There was an exception for OpenSSL but not for LibreSSL.  Unfortunately, there's no way to contact the author and find out if an exception can be added for LibreSSL. The program could be built without SSL support. It's really not necessary just to view the output of diffh. It would be interesting to see what it would take to add BearSSL support though since there is no issue between licenses.

That covers some of the browsers options. There are other programs and libraries I typically use or need as dependencies when building applications that require SSL/TLS and/or cryptographic support. With many of the cases, it might not be intuitive to consider they'd even need it. Yet, many do require it. In some situations, you can avoid the issue and just leave the needed functionality out. In others, the libraries or programs are designed not to build without the dependency.

LibArchive has an optional dependency of a cryptographic library and offers support for OpenSSL/LibreSSL and Nettle. LibArchive and LibreSSL are both BSD projects created to replace other popular projects. So, it would be natural to assume that LibArchive would function well with LibreSSL. Support for using LibreSSL is probably going to be better than OpenSSL in this one particular case.

PostgreSQL requires OpenSSL. I've built it with LibreSSL and, so far, compatibility with that seems fine. I did not see options for other SSL/TLS libraries. Some other Linux distributions may provide patches that offer other options.

Vorbistools uses the curl library.  Opusfile requires OpenSSL (or LibreSSL).  It won't build without the dependency. There are two libraries that opusfile creates, libopusfile and libopusurl.  The libopusurl library needs the OpenSSL dependency.  Luckily, many programs only link with libopusfile which doesn't list OpenSSL as a dependency.

Fossil is one of the simpler version control systems to build from source code. It optionally uses OpenSSL (or LibreSSL) if SSL support is desired.

The picaxo program is a lightweight SDL based graphics viewer. It can also display graphics at a URL location. It uses sockets directly and doesn't appear to support SSL/TLS options.  The sdl_net library also appears to use sockets directly.

I haven't looked into email clients recently, but this is another area where a SSL/TLS library will be an important factor. My preference is to use Sylpheed for email, but the builds are older and I've been having trouble with certificates of late. I'd prefer to use a different GUI library if I'm going to build my email client from scratch. Building with a fork of GTK+ that offers a ncurses backend might also be an interesting option.

There are several email options using the lighter FLTK GUI framework. flmail and hermail are both FLTK based options. I believe hermail is no longer available from Sourceforge. I still have the source somewhere. flmail is part of the NanoLinux distribution at Sourceforge. PostOffice is an old FLTK email client. I was able to get it to build from source with later versions of FLTK after some patching. The user interface works to some extent, but the mail code probably needs extensive updating. It does have a nice interface with 3 panes comparable to email clients such as Sylpheed. It would be nice to use a project like this as a front end to a more modern command line only email client.

One text based email option I like is alpine. There are several forks of it including realpine, so I'd need to look into which is the most useful to start with. Originally, alpine licensing was an issue. That was one reason the GNU based nano project was created to replace pico. The latest alpine version at https://repo.or.cz/alpine.git has an Apache 2 license. It also lists openssl and libressl in its directory tree so OpenSSL and LibreSSL appear to be the valid options for SSL/TLS support.

If there are other lightweight, cross-platform portable email client suggestions, I'd be very interesting in hearing about them.

Cryptographic libraries are also used with many signing programs to make sure messages and files are authentic. Some of the smaller Linux distributions I've looked at are adding features to sign their archives and ensure they're legitimate. I recently checked into lightweight software options that can be used for this purpose in place of programs like GnuPG. I ran across several solutions. Most used Ed25519. Many BSD systems use signify. There are various ports of signify to Linux. They typically need some kind of BSD compatibility library. I ran across asignify which uses TweetNaCl and was inspired by signify. I also found minisign which uses libsodium and is maintained by the libsodium developer. The lightest option I've found to date is usign. It includes the cryptographic code. It's lightweight enough that I was able to port it to non-POSIX platforms without much issue. Since LibTomCrypt or some of the SSL libraries offer cryptographic support for Ed25519, another good option might be to write something specifically using one of them as a backend. That would cut down the number of cryptographic algorithm implementations on the system that would need to be supported and maintained. If anyone else is investigating this sort of thing, I'd appreciate hearing how you plan to approach the issue of signing information and/or packages.

The other place tools from a cryptographic library are needed is with certificates. I've covered certificate requests, but certificates need to be installed for programs like curl, a web browser or email client in order to work properly. I'm not familiar with how most Linux Distributions create their certificates packages, but Linux From Scratch gives an interesting glimpse on one way to do so with their make-ca program:
https://www.linuxfromscratch.org/blfs/view/svn/postlfs/make-ca.html
I did contact one distribution that was using BearSSL and asked how certificates were handled. In that case, the bundle from the curl web site was used. I do like the LFS method of creating a certificate package including a certificate bundle. One nice thing is that I can easily add some custom certificates if I need them behind a firewall. I currently use a simplified version of the make-ca process to create my own certificate package for the systems I build programs on. The make-ca script calls the openssl program. Some of the utility calls in the make-ca script are just doing base64 encoding. So, any base64 program with equivalent functionality could be used in place of calling openssl. However, there are other cases where specific openssl functionality is called. I've yet to find replacements for that or other ways to simplify the make-ca process to avoid it. So, for now, the process requires OpenSSL or LibreSSL in order to work. I would be very interested to hear how other distributions (besides LFS) create their certificate packages and what tools they use to do so.

I had hoped the process to switch completely to BearSSL would be a simple one especially since curl added support for it. However, reviewing the programs I like to work with, there are several that would require patching, losing SSL/TLS support or just wouldn't work with the switch. It does appear to be the most secure option at this point. LibreSSL works with all the libraries and programs I currently build, but there may be licensing issues in some cases. Also, support for LibreSSL may or may not be available in future updates of the software. Continuing to use LibreSSL requires less work at present, but may not be the best decision moving forward. MbedTLS is an interesting option. The dual license covers the situation of using it with GPL and non-GPL programs. It's used by ReactOS, so it currently has decent support for older versions of Windows. Other than curl and some of its dependencies, there aren't a lot of programs out there designed to use it though. There aren't a lot of tools to use with it either such as for dealing with certificates. I'm still investigating the various alternatives and their pros and cons. I'd really prefer to not have to work with multiple SSL/TLS libraries on my system. The choice may just come down to what will allow the most applications to build successfully.

It has recently come to my attention that MbedTLS 2.17 and greater will no longer be available under a GNU GPL license. This causes license conflicts with GNU GPLv2 licensed software. This change pretty much rules out using MbedTLS as a useful option for me at this point.

I'd be very interested to hear from others who build their programs from source or who work with small operating system distributions or packaging of libraries and programs as to what their choices are in this area. Possibly if enough small projects banded together, good support for a less popular library could be created. If anyone's interested in that or knows of projects that are interested, please pass that information on to me. I believe in the principle of security through obscurity. So, going off the beaten path and using a less well-known SSL library may have a very good overall benefit.
2021-06-07 03:04 pm

In search of an Open Source project

I do a lot of Open Source development just for me. Basically, it's the philosophy of scratching an itch. If there's something I want and no one's working on it, I work on it on my own. True to Open Source philosophy, if I want something done, I do it myself. I typically assume not many other people will be interested in what I'm interested in anyway.

However, it is nice to have a community. It's helpful to have other developers to discuss designs with or other users to test out new programs or people to help find new and interesting code and resources to explore. I've asked before in various places, but I'm going to ask again here and now. If anyone knows of a FLOSS project in need of volunteers, please share information about it with me. I'd be happy to add them to my list of FLOSS projects looking for volunteers. I also really want to find a project that's a good fit with my own goals and donate some of my time and expertise.

I work a lot with lightweight, cross-platform FLOSS applications and build them from source, modify them, fix bugs, add features, etc. I've ported applications to a wide variety of platforms including more unusual operating systems. I would love to get involved with a small Linux or BSD distribution or even an original or unusual operating system and port and/or build some programs for it. I also use Windows a lot and would be happy to help out a Windows or DOS project that's involved in building FLOSS applications. I have a lot of experience porting FLOSS programs to operating systems like these. I do have my own build system/package management tools and I'm not interested in switching to another system at this time. I also have my own preferences as to which libraries I use when building applications. At this time, I'm working primarily with C and occasionally with C++. It would be fun to get involved with others interested in making their own distribution or putting together FLOSS applications to share with people.

So, if you know of a project that might need help or have a project you're working on that's in need of volunteers, please let me know. If you just want to compare notes on lightweight and/or cross-platform portable software or you want to talk about C programming in general, feel free to contact me. More contact information available here: http://www.distasis.com/connect.htm
2021-06-03 08:35 am

PGAdmin3 status

We use the server status portion of PGAdmin3 often at work. Unfortunately, PGAdmin3 is no longer officially supported. The new PGAdmin4 does not have the server status feature. Since the PGAdmin3 software is Open Source, I have no issues continuing to use unsupported software as long as I can build and fix it myself. So, that's what I set about doing.

Before reinventing the wheel and creating all my fixes from scratch, I searched to see if other projects had made similar fixes to PGAdmin3. For a while, BigSQL supported an LTS version of PGAdmin3 and continued to supply executables and patches but they have since given up. From what I read, their patching was very minor and the patches the Debian distribution made were probably better done. BigSQL did offer a Windows executable which was very convenient. We typically run PGAdmin3 on Windows at work.

I found several projects at Github that attempted to continue to patch PGAdmin3. However, when I contacted the projects to see if they were interested in sharing efforts, most of the developers had given up on the idea of continuing to update PGAdmin3. They'd made the switch to other tools. I've searched through many other tools and built some from source out of curiosity but have yet to find something that replaces the functionality I use most with PGAdmin3.

I had decided to go ahead with my own fork of PGAdmin3 based on some of the fixes that others had made to continue to support it after official development stopped. One thing I really wanted was to be able to compile wxWidgets in a more standard way. WxWidgets developers made the switch to using STL for containers and there are other standard compile flags that most distributions typically use. PGAdmin wouldn't build with many of those settings out of the box. So, I went through and fixed all the warnings and errors that occurred while trying to compile PGAdmin3 with a more standard wxWidgets installation. I cherry-picked fixes to update PGAdmin3 to later versions of PostgreSQL based on some of the other forks. I added some fixes of my own for PostgreSQL updates as well. I planned to rework the build system so that it was easier for me to maintain and update. The idea was to switch to CDetect and makefiles rather than using GNU autotools, cmake or standard Visual C++ configuration files. Work on this stopped for a while and when I was ready to pick it up again, I decided to check once more to see if there were any useful forks that were active.

This time, I found there were new and active forks. I haven't had a chance to contact the maintainers and see if they'd like to collaborate on anything yet. However, the ability to use other projects with later versions of PostgreSQL makes the need for my updates much less urgent. I would still like to get a fork together than uses the latest version of wxWidgets and more standard compile settings. It's just not an absolute priority anymore.

I'd like to share links to two of the projects that I found that work with later versions of PostgreSQL and that provide executables for Windows:

https://vvs.ru/pg/index-en.html
https://github.com/levinsv/pgadmin3

If anyone else is still using PGAdmin3 and has ideas on future paths forward, I would be very interested in hearing those opinions. Some possible alternatives:
Fork just the server status piece possibly using another GUI and maintain that as a new program.
Collaborate with one of the active forks.
Continue with a fork that cherry picks the best features of other forks along with original patches.
2020-10-10 04:24 pm

Halloween Brainstorms

Celebrating Halloween all alone? Here are some ideas and brainstorms.

First, I'd like to invite you take the Halloween Holiday Tour. It's only accessible in October.
You can find a link to it here:
http://www.distasis.com/write

If you'd like to create your own Halloween interactive adventures electronically, here are some
of the many Free, Libre and Open Source options out there:
https://playfic.com/
http://twinery.org/
https://www.alanif.se/
http://www.tads.org/index.htm
http://www.trizbort.com/

Some also allow you to create web pages without needing to be a web designer:
http://textadventures.co.uk/squiffy
http://textadventures.co.uk/quest/
http://inform7.com/

This lets you create your own mobile apps:
https://appinventor.mit.edu/

You can also practice programming and create a storyline with these tools:
https://scratch.mit.edu/
http://www.alice.org/get-alice/storytelling-alice/

If you create your own Halloween adventure and it's not too scary, feel free to let me know about it:
http://www.distasis.com/connect.htm
I'd love to hear about any Free, Libre, Open Source, Creative Commons or public domain resources for Halloween. Treat it as a scavenger or treasure hunt and try to find some of your own or help create some new ones and share them with everyone.

The Halloween Holiday Tour has several ideas for celebrating Halloween plus links to activities, so I don't want to repeat that here. What else can I cover? I have seen some interesting web sites that mention favorite music and movies to watch for Halloween, so I'll share some of mine at this time.

I like classical Halloween music such as Night on Bald Mountain. I'm in the process of transcribing it to ABC notation so I can create a midi file of it. I also like Loreena McKennit's music. Some of her songs are based on public domain music or lyrics. I took some of my favorite Halloween themed songs from various music I own and put together my own Halloween playlist. You can find free software to work with music and create your own music CDs as part of this list on Open Source software:
http://www.distasis.com/cpp/osrclist.htm

As far as Halloween TV shows and videos, some of my favorites suitable for all ages are:
Curious George: A Halloween Boo Fest
Charlie Chan: Meeting at Midnight
Wishbone: The Legend of Creepy Collars
Legion of Superheroes season 1 episode 4 Fear Factory
Voyagers! episode 4
Spooky House
Thunder and the House of Magic
Check your local libraries for them.
You can find the Charlie Chan video online at archive.org: https://archive.org/details/CharlieChanBlackMagicMeetingAtMidnight
If you run across others, suitable for any age, feel free to let me know. I may add them to the list.

I'll definitely be doing some baking this Halloween. What's Halloween without some treats to go with the tricks? Haven't decided what's on my menu yet, but there will definitely be some homemade baked goods. I also like magic tricks on Halloween. You can check out some public domain magic books for ideas: https://lmemsm.dreamwidth.org/13112.html

Here is a 1917 recipe book that includes some ideas for celebrating Hallowe'en:
https://books.google.com/books?id=TeEqAAAAYAAJ
Here is a 1911 magazine that gives some menu ideas including a recipe for soul cakes on page 28 of the October 26th issue:
https://books.google.com/books?id=Zi4xAQAAMAAJ

In previous years, one of our local parks held a wonderful annual Halloween event. Will miss it this year. They showcased some of their animals. Some of their holidays decorations were really clever. You can try these at home. They took tennis balls and decorated them with pumpkin faces. They even sprayed some orange. They cut out the back of old gallon milk containers and put tea lights in them. They used markers to decorate faces on them. They provided a nice glow toward evening.

Our Wellness Department at work mentioned virtual staycations and here was one of the links they shared:
https://www.travelandleisure.com/trip-ideas/disney-vacations/virtual-disney-park-rides-worldwide
The Mystic Manor video looked like a lot of fun and very appropriate for Halloween.

Halloween is when the walls between the worlds grow thin and spirits of the Underworld walk the earth. For some cultures, Halloween is a wonderful time to remember ancestors and family no longer with us. What ways do you remember family members at this time?

Haven't tried an escape room yet. However, I did read that one of the libraries shared a digital escape room that might be fun for Halloween:
https://ptlibrary.org/hogwarts-digital-escape-room/

Halloween Comic Fest celebrates comic books once a year. This year they're offering older comic books in electronic format in their Throwback Thursday articles:
https://www.halloweencomicfest.com/EventNews
You can also check if there are any comic book stores participating in Halloween Comic Fest virtually this year.

Have some of your own kid-friendly Halloween rituals to continue celebrating at home this year? Please share them and help brainstorm some positive and safe ways to enjoy the holiday.
2020-07-08 03:23 pm

Machine Learning and Deep Learning Resources for C/C++

Machine learning and deep learning have become very popular. Unfortunately for C/C++ developers, most of the tools for these fields are written in other languages even though many of the core libraries are still written in C/C++. This list tries to track what FLOSS libraries and resources are available in the field that C/C++ developers can work with.

The list is by no means comprehensive and really doesn't offer that many options. So, if you have other suggestions for machine learning C/C++ source code, please let me know.

One thing desperately needed by some projects is a decent FLOSS speech-to-text recognizer. Some suggestions are included below but other options, especially compact ones that will work with mobile devices as well as standard desktop computers would be very useful. I've also included a list of FLOSS text-to-speech programs.


C resources:

https://pjreddie.com/darknet/
Darknet is an open source neural network framework written in C and CUDA.

https://github.com/yui0/catseye
Neural network library.

https://github.com/liuliu/ccv
http://libccv.org
C-based/Cached/Core Computer Vision Library

https://github.com/alrevuelta/cONNXr
A onnx runtime written in pure C99 with zero dependencies focused on embedded devices.

https://github.com/100/Cranium
Portable, header-only, artificial neural network library written in C99.

https://github.com/jeffheaton/encog-c
Encog machine learning framework port to C/C++ for experimentation with CUDA.

http://leenissen.dk/fann/wp/
FANN, Fast Artificial Neural Network Library, is a free open source neural network library which implements multilayer artificial neural networks in C with support for both fully connected and sparsely connected networks.

https://github.com/codeplea/genann
Genann is a minimal, well-tested library for training and using feed-forward artificial neural networks (ANN) in C.

https://github.com/attractivechaos/kann
KANN is a standalone and lightweight library in C for constructing and training small to medium artificial neural networks such as multi-layer perceptrons, convolutional neural networks and recurrent neural networks (including LSTM and GRU).

https://github.com/jppbsi/LibDEEP
LibDEEP is a deep learning library developed in C language for the development of AI techniques.

https://github.com/karpathy/llama2.c
Inference Llama 2 in one file of pure C.

https://github.com/fomichev/llm.c
Large language model in C. GPT-2 inference implementation in pure C.

https://github.com/GHamrouni/LocusCode
LocusCode allows you to perform similarity search on web scale datasets using C.

https://github.com/siavashserver/neonrvm
neonrvm is an Open Source machine learning library written in C for performing regression tasks using RVM technique.

https://github.com/GHamrouni/Recommender
A C library for product recommendations/suggestions using collaborative filtering (CF).

https://github.com/xiph/rnnoise
Recurrent neural network for audio noise reduction and suppression written in C.

https://github.com/LuisWohlers/simpleCnet
SimpleCNet is a simple single-header header-only library for neural networks written in C (C89). Training is accomplished using backpropagation.

https://github.com/symisc/sod
An Embedded Computer Vision & Machine Learning Library that is CPU Optimized & IoT Capable.

https://github.com/glouw/tinn
Tinn (Tiny Neural Network) is a 200 line dependency free neural network library written in C99.

https://github.com/Imetomi/TinY-ANN
TinY ANN is a simple library to create neural networks in C for smaller data science projects.

https://www.vlfeat.org/
The VLFeat open source library implements popular computer vision algorithms specializing in image understanding and local features extraction and matching. Algorithms include Fisher Vector, VLAD, SIFT, MSER, k-means, hierarchical k-means, agglomerative information bottleneck, SLIC superpixels, quick shift superpixels, large scale SVM training and many others. It is written in C for efficiency and compatibility with interfaces in MATLAB for ease of use.

https://igraph.org/c/
Igraph is a C library for creating, manipulating and analysing graphs. It is intended to be as powerful and fast as possible to enable working with large graphs.

http://htk.eng.cam.ac.uk/
Hidden Markov Model Toolkit (HTK) is a portable toolkit for building and manipulating hidden Markov models. HTK is primarily used for speech recognition research although it has been used for numerous other applications including research into speech synthesis, character recognition and DNA sequencing. HTK is in use at hundreds of sites worldwide.
HTK consists of a set of library modules and tools available in C source form. Source available but license is not listed at OSI.


C++ resources:

https://opencv.org/
OpenCV is a C++ library of programming functions mainly aimed at real-time computer vision.

https://aogmaneo.handmade.network/
AOgmaNeo is a machine learning system in C++.

https://github.com/iVishalr/cDNN
cDNN is a deep Learning Library written in C which provides functions that can be used to create artificial neural networks (ANN).

https://github.com/dmlc/cxxnet
CXXNET is a fast, concise, distributed deep learning framework in C++.

https://code.google.com/archive/p/cuda-convnet/
High-performance C++/CUDA implementation of convolutional neural networks.

https://github.com/jolibrain/deepdetect
DeepDetect is a machine learning API and server written in C++11.

http://dlib.net/
Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems.

http://eblearn.sourceforge.net/
Eblearn is an object-oriented C++ library that implements various machine learning models.

https://github.com/FidoProject/Fido
Fido is an lightweight, highly modular C++ machine learning library for embedded electronics and robotics.

https://github.com/nickgillian/grt
The Gesture Recognition Toolkit (GRT) is a cross-platform, Open Source, C++ machine learning library designed for real-time gesture recognition.

https://github.com/tboox/hnr
hnr is an off-line handwritten numeral recognition system written in C++.

https://github.com/mosdeo/LKYDeepNN
Low dependency (using C++11 and STL only), portable, header-only, deep neural networks for embedded systems.

https://github.com/ggerganov/llama.cpp
Port of Facebook's LLaMA model in C/C++.

https://www.mlpack.org/
MLpack is a fast, flexible machine learning library written in C++ that aims to provide extensible implementations of cutting-edge machine learning algorithms.

https://github.com/CMU-Perceptual-Computing-Lab/openpose
OpenPose is real-time multi-person keypoint C++ detection library for body, face, hands and foot estimation.

http://image.diku.dk/shark/sphinx_pages/build/html/index.html
SHARK is a fast, modular, feature-rich open-source C++ machine learning library.

https://github.com/Tyill/skynet
Skynet is a neural network library written from scratch in C++ using only STL and OpenBLAS for calculation.

https://github.com/tensor-compiler/taco
Tensor algebra compiler in C++.

https://github.com/LanguageMachines/timbl/
TiMBL implements several memory-based learning algorithms using C++.

https://github.com/tiny-dnn/tiny-dnn
Header only, dependency-free deep learning framework in C++14.

https://github.com/aksnzhy/xlearn
xLearn is a high performance, easy-to-use, and scalable machine learning package written in C++ that contains linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM), all of which can be used to solve large-scale machine learning problems.

https://github.com/google/XNNPACK
XNNPACK is a highly optimized library of floating-point neural network inference operators written in C/C++ for ARM, WebAssembly, and x86 platforms. It provides low-level performance primitives for accelerating high-level machine learning frameworks


Tensorflow related:

https://github.com/tensorflow/tensorflow
An Open Source Machine Learning Framework in C++ for everyone.

https://github.com/google/mediapipe
MediaPipe is the simplest way for researchers and developers to build world-class ML solutions and applications for mobile, desktop/cloud, web and IoT devices.MediaPipe on the Web is an effort to run the same ML solutions built for mobile and desktop also in web browsers. C++

https://github.com/terryky/tflite_gles_app
GPU accelerated deep learning inference applications using TensorflowLite GPUDelegate/TensorRT and C.

https://github.com/uTensor/uTensor
TinyML AI inference library for C++11.


Open Source Speech-to-Text resources:

https://github.com/cmusphinx/pocketsphinx
PocketSphinx is one of Carnegie Mellon University's open source large vocabulary, speaker-independent continuous speech recognition engines written mainly in C.
https://github.com/cmusphinx/sphinxbase
Basic libraries shared by the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II, Sphinx-III, and PocketSphinx) written in C.
https://sourceforge.net/projects/cmusphinx/files/sphinx2/
CMU Sphinx 2 is a speaker-independent large vocabulary continuous speech recognizer written in C and released under BSD style license.

https://github.com/kaldi-asr/kaldi
Kaldi is a toolkit for speech recognition, intended for use by speech recognition researchers and professionals written in C++.

https://github.com/julius-speech/julius
Open Source large vocabulary continuous speech recognition engine written in C.

https://github.com/arthurv/srec
Fork of Android's speech recognition engine in C. From Android 4.1 aka Jelly Bean.

https://github.com/mozilla/DeepSpeech/tree/master/native_client
DeepSpeech from Mozilla (uses tensorflow). Written in C++.

https://github.com/nyumaya/nyumaya_audio_recognition_lib
C/C++ audio recognition library using tensorflow.

https://github.com/ggerganov/whisper.cpp
OpenAI's Whisper model in C/C++.


Open Source Text-to-Speech resources:

http://www.festvox.org/flite/index.html
CMU Flite (festival-lite) is a small, fast run-time open source text to speech synthesis engine developed at CMU and primarily designed for small embedded machines and/or large servers. Flite is designed as an alternative text to speech synthesis engine to Festival for voices built using the FestVox suite of voice building tools. C only, very portable source. (See also Festival.)

http://espeak.sourceforge.net/
eSpeak is a compact Open Source speech synthesizer for English and other languages written in C.

https://github.com/espeak-ng/espeak-ng
eSpeak NG is a compact Open Source speech synthesizer that supports more than hundred languages and accents. It is written in C.

https://github.com/MycroftAI/mimic
Mycroft's TTS engine, based on CMU's Flite (Festival Lite) in C.

https://github.com/robotology/speech
Speech synthesis and speech recognition programs including PicoTTS.

https://github.com/gmn/nanotts
NanoTTS is a command line speech synthesizer that improves on pico2wave, part of SVOX PicoTTS.

https://github.com/syoyo/tacotron-tts-cpp
Tacotron text to speech in C++ (synthesize only). Uses tensorflow.
2020-04-14 09:20 am

Open Education Resources

List of Open Education Resources (OER):


OER Search


MERLOT
https://www.merlot.org/merlot/
Multimedia Educational Resource for Learning and Online Teaching. Content at site is CC licensed. Search MERLOT and over 50 OER digital libraries

OASIS
https://oasis.geneseo.edu/

Mason OER Metafinder (MOM)
https://oer.deepwebaccess.com/oer/desktop/en/search.html

BC Campus OpenED
https://open.bccampus.ca/browse-our-collection/find-open-textbooks/

OpenOregon Educational Resources
https://openoregon.org/resources/

DiscoverEd
http://wiki.creativecommons.org/DiscoverEd
Search OER materials. Prototype from Creative Commons.


Mailing Lists and Discussion Groups


SPARC Libraries and OER forum
https://sparcopen.org/our-work/sparc-library-oer-forum/

Teaching Open Source Mailing List
http://teachingopensource.org/
http://lists.teachingopensource.org/mailman/listinfo/tos


FLOSS Books, Manuals and Tutorials


FLOSS Manuals
http://en.flossmanuals.net/
Manuals on FLOSS Software and related topics in various languages.

HowtoForge
https://www.howtoforge.com/tutorials/
Linux Tutorials

PLEAC
http://pleac.sourceforge.net/
Programming Language Examples Alike Cookbook. This project aims to be a quick, handy and free reference to solve most common programming problems using various programming languages and can be used for comparison on ease-of-use and power/efficiency of these languages.

FOSS Books
https://code.google.com/archive/p/book-on-foss/downloads
Books about Free and Open Source Software.

Open Organization Guide for Educators
https://github.com/open-organization-ambassadors/open-org-educators-guide

Open Books from O'Reilly
https://www.oreilly.com/openbook/
Books on a number of technical subjects.


OER Related Sites:


Community Contributed Open Education Resources for Teaching and Learning Spreadsheet
http://bit.ly/CCCOERPivotOnline

OER Commons
http://www.oercommons.org/

OER Knowledge Cloud
https://oerknowledgecloud.org/about

The Open University
https://www.open.edu/openlearn/

P2PU
http://p2pu.org/en/
Peer to Peer University

Open Courseware Consortium
http://ocwconsortium.org/courses

Open Textbook Library
https://open.umn.edu/opentextbooks

OpenStax
https://openstax.org/

LibreTexts
https://libretexts.org/

OpenContent
http://www.opencontent.org/
Blog about Open Courseware

UNESCO
https://en.unesco.org/themes/building-knowledge-societies/oer
Open Education Resources

CK-12
https://www.ck12info.org/about/mission/
Provides open-source content and technology tools to help teachers provide learning opportunities for students globally

MIT Open Courseware
https://ocw.mit.edu/help/faq-intellectual-property/
More than 2000 course available and materials for most subjects are available on the web free of charge.

Open Yale Courses
https://oyc.yale.edu/about
Provides free and open access to a selection of introductory courses taught by distinguished teachers and scholars at Yale University. Most lectures and course material are under Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

Saylor Academy
https://www.saylor.org/
Free and open online courses.

Wikiversity
https://en.wikiversity.org/wiki/Wikiversity:Main_Page
Wikiversity is a Wikimedia Foundation project devoted to learning resources, learning projects and research for use in all levels, types and styles of education from pre-school to university, including professional training and informal learning. They invite teachers, students and researchers to join us in creating open educational resources and collaborative learning communities.

University Free and Open Consortium
https://unicon.ucoz.org/

Runestone Interactive
http://runestoneinteractive.org/pages/faq.html#what-is-runestone-interactive

Monmouth University E-books resources
https://guides.monmouth.edu/ebooks-COVID-19

Online Education Database
https://oedb.org/ilibrarian/80-oer-tools/
80 Open Education Resource (OER) Tools for Publishing and Development Initiatives

Jorum UK
https://wordpress.viu.ca/openeducationalresources/2013/09/jorum-uk/

Connexions
https://cnx.org/
View and share educational material. To be merged with openarchive.org

ERIC at archive.org
https://archive.org/details/ericarchive
Education Resources Information Center (ERIC) Archive. An internet-based digital library of education research and information sponsored by the Institute of Education Sciences (IES) of the U.S. Department of Education. Includes Open lesson plans.
2020-04-02 12:55 pm

Ergonomic and Health related Free and Open Source Software

Here are some of my favorite health related programs. The ergonomic programs are useful if you're spending long hours in front of your computer. The recipe and nutrition software can be used to improve your nutrition.

Ergonomic software

Workrave - available for Windows and Linux/POSIX operating systems
http://www.workrave.org/
https://portableapps.com/apps/utilities/workrave_portable

PrevRSI - available for Windows
http://prevrsi.sourceforge.net/

Xwrits - available for Linux/POSIX operating systems, X Windows based without a lot of GUI dependency libraries
http://www.lcdf.org/~eddietwo/xwrits/

Eyes' Thanks - available on Windows and other Qt supported platforms
https://github.com/yalov/eyes-thanks

Resto - available on Windows and other Qt supported platforms
https://github.com/Justyna-JustCode/Resto

RSIBreak - available on Linux and other KDE supported platforms
https://userbase.kde.org/RSIBreak

Gnome Break Timer - available on Linux and other GNOME supported platforms
https://gitlab.gnome.org/GNOME/gnome-break-timer/

Safe Eyes - available for POSIX compatible systems
http://slgobinath.github.io/SafeEyes/

Enso Retreat - available on Windows
https://github.com/GChristensen/retreat

Eyes Guard - available on Windows
https://github.com/avestura/EyesGuard

RestStop - available on Windows
https://gazugafan.github.io/RestStop/

WristSaver - available for Mac OSX
https://sourceforge.net/projects/wristsaver/

Stretchly - available on Windows, Linux, FreeBSD, Mac OSX and anywhere else Electron will run
https://github.com/hovancik/stretchly

BreakTimer - available on Windows, Linux, Mac OSX and Electron supported platforms
https://github.com/tom-james-watson/breaktimer-app

wnr - available on Windows, Linux, Mac OSX and Electron supported platforms
https://github.com/RoderickQiu/wnr

Chime - available on Mac OSX and Electron supported platforms
https://github.com/erdogany/chime

Aktivpause to Go - break reminder with exercises for Android
https://apt.izzysoft.de/fdroid/index/apk/org.secuso.aktivpause

Pausing Healthy - break reminder with exercises for Android
https://f-droid.org/en/packages/org.secuso.privacyfriendlypausinghealthily/

Mindfulness at the Computer is a breathing reminder - available for Windows, Linux, Mac OSX
https://sourceforge.net/projects/mindfulness-at-the-computer/

Breathing - available for Linux
https://github.com/SeaDve/Breathing

Breathe - available for Pebble
https://github.com/aaronhktan/exhale

Brethap - breathing app for Android
https://f-droid.org/en/packages/com.jithware.brethap/

Breathly - breathing app for Android
https://f-droid.org/en/packages/com.mmazzarolo.breathly/

Medito - meditation app for Android
https://apt.izzysoft.de/fdroid/index/apk/meditofoundation.medito

Mindfulness Meditation - meditation app for Android
https://f-droid.org/en/packages/biz.binarysolutions.mindfulnessmeditation/

Be Well - heart rate monitor
https://apt.izzysoft.de/fdroid/index/apk/com.bewell.lite

Virtual Magnifying Glass - available for Windows, Linux, FreeBSD, Mac OSX
https://sourceforge.net/projects/magnifier/
https://portableapps.com/apps/accessibility/virtual_magnifying_glass_portable

Adapt screen brightness/temperature on Windows and POSIX systems with Gammy:
https://github.com/Fushko/gammy
https://github.com/Fushko/gummy

Changes the color temperature of your monitor to better match that of your surroundings on Linux and Windows systems:
https://sourceforge.net/projects/redshiftgui/

Adjust colors of screen based on time of day on POSIX compatible systems:
https://wiki.archlinux.org/index.php/Redshift

Adjust colors of screen based on time of day on POSIX compatible systems:
https://github.com/maandree/blueshift

Iris Floss is a blue light reduction program for X11:
https://github.com/yurrriq/iris-floss

Gammastep adjusts screen colors for Linux systems:
https://gitlab.com/chinstrap/gammastep

Red Moon for Android:
https://github.com/LibreShift/red-moon

Fake Dawn is a gradual light alarm for Android:
https://f-droid.org/en/packages/org.balau.fakedawn/

Fall Detector for Android:
https://github.com/altermarkive/experimental-fall-detector-android-app
https://apt.izzysoft.de/fdroid/index/apk/altermarkive.guardian

Nutrition and Recipe software (cross-platform)

NUT - Nutrition software
https://sourceforge.net/projects/nut/

Gourmet - Recipe Manager
http://thinkle.github.io/gourmet/

EnRecipes - Offline recipe manager for Android.
https://f-droid.org/packages/com.vishnuraghav.EnRecipes/

Waistline - Libre calorie counter and weight tracker for Android built with Cordova
https://github.com/davidhealey/waistline