How to test if a C program on Linux is running from a TTY or not.

This simple C program will test whether it is running from a TTY or not. This is a simple test, but it could be quite useful. #include <stdio.h> #include <poll.h> #include <unistd.h>   int main(int argc, char* argv[]){   struct pollfd fds[1] = {{.fd = STDIN_FILENO, .events = POLLIN}};   if (!poll(fds, sizeof(fds) / sizeof(struct … Read more

Windows XP Program Manager source code.

Here is the source code to the Windows Program Manager, this is the main interface in Windows 3.1 and 3.11. This used program groups to organize various applications like Microsoft Office and accessories. As well as the ability to create your own program groups to organize your favorite applications. Download the source code here: https://mega.nz/file/R1hy1RyS#Dkm0hK8hGmwTx-__9hOQKBWtNDDBCW-ChSneHGSc_RY. … Read more

Very useful C program. Print a random fortune.

Here is one of my programs. I wrote this ages ago and it uses the standard ASCII character set. This will print a random fortune by running the fortune app to get a fortune and this selects a category to print from. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <string.h> const char* x[] … Read more

My system information program I coded for Linux a while ago. This works very well.

https://github.com/john302/sysinfo. This is my system information program I coded for Linux. This gives a bit of information about your Linux system. Just check out the source and type make to compile. Here is some sample output. 13:21:02 ~/Downloads/sysinfo.kdevelop-1.0 homer@neo $ ./sysinfo 1 –System name – Linux –Nodename – neo.deusexmachina –Release – 3.9.5-301.fc19.x86_64 –Version – #1 … Read more