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}};  …

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…

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>…

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…

Read More

C program to write a string to a file.

I think I may have posted this before, but this is a little program I am working on that writes a text string to a file. I have got it to work perfectly and it compiles without errors using gcc -Wall. /* * This program is free software; you can…

Read More