Source (open):
this is the TuxExec v0.02 source , just the simple c_cpp_helper update
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
void input_cmd(char *buf, size_t size)
{
printf("TuxExec: ");
if (fgets(buf, size, stdin) != NULL) {
buf[strcspn(buf, "\n")] = '\0';
}
}
void wslinstubuntu(void)
{
system("wsl --install -d Ubuntu");
printf("window fuckass using wsl btw =)) ");
}
void inst(void)
{
char pkgmn[256];
printf("Linux pkgmn = ? (pacman ,apt , dnf): ");
fgets(pkgmn, sizeof(pkgmn), stdin);
pkgmn[strcspn(pkgmn, "\n")] = '\0';
if (strcmp(pkgmn, "apt") == 0) {
while(1) {
char apt[512];
printf("pkg install: ");
fgets(apt, sizeof(apt), stdin);
apt[strcspn(apt, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror("pid failed");
}
else if (pid == 0) {
char *args[] = {"sudo", "apt", "install", apt, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
else if (strcmp(pkgmn, "dnf") == 0) {
while(1) {
char dnf[512];
printf("pkg install: ");
fgets(dnf, sizeof(dnf), stdin);
dnf[strcspn(dnf, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror("failed pid");
}
else if (pid == 0) {
char *args[] = {"sudo", "dnf", "install", dnf, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
else if (strcmp(pkgmn, "pacman") == 0) {
char pacman[512];
printf("pkg install: ");
fgets(pacman, sizeof(pacman), stdin);
pacman[strcspn(pacman, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror(" failed pid");
}
else if (pid == 0) {
char *args[] = {"sudo", "pacman", "-S", pacman, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
void c_cpp_helper(void)
{
int choice;
do {
system("clear");
printf("C vs C++ QUICK HELPER & COMPARISON\n\n");
printf("1.Learn about if-else in C vs C++\n");
printf("2.Compare I/O (printf/scanf vs cin/cout)\n");
printf("3.C99 stdbool.h vs C++ Native Bool\n");
printf("4.Memory Management (malloc/free vs new/delete)\n");
printf("5.Back / Exit\n\n");
printf("Enter your choice: ");
if (scanf("%d", &choice) != 1) {
while (getchar() != '\n');
continue;
}
system("clear");
switch (choice) {
case 1:
printf("IF-ELSE IN C VS C++\n\n");
printf("In C:\n");
printf(" Uses integer values to evaluate conditions.\n");
printf(" 0 means FALSE, any NON-ZERO value means TRUE.\n");
printf(" Example: if (1) { /* Always runs */ }\n\n");
printf("In C++:\n");
printf(" Has native 'bool' type with 'true' and 'false'.\n");
printf(" Conditions like if (expr) still implicitly convert numbers to bool.\n");
break;
case 2:
printf("PRINTF/SCANF (C) VS CIN/COUT (C++)\n\n");
printf("C (printf / scanf):\n");
printf(" Pure functions inside <stdio.h>.\n");
printf(" Requires explicit format specifiers: %%d, %%s, %%f, %%p.\n");
printf(" Minimal memory footprint, perfect for lightweight CLI tools.\n\n");
printf("C++ (cin / cout):\n");
printf(" Stream objects inside <iostream>.\n");
printf(" Automatically detects data types via operator overloading (<<, >>).\n");
printf(" Convenient, but increases binary size.\n");
break;
case 3:
printf("BOOLEAN TYPES\n\n");
printf("In C:\n");
printf(" C89/C90 has no native bool type.\n");
printf(" Since C99, you must include <stdbool.h> to use 'bool', 'true', 'false'.\n\n");
printf("In C++:\n");
printf(" 'bool', 'true', and 'false' are built-in keywords.\n");
break;
case 4:
printf("MEMORY MANAGEMENT\n\n");
printf("In C:\n");
printf(" Uses malloc(), calloc(), realloc() for Heap allocation.\n");
printf(" Manual memory cleanup required using free() to prevent leaks.\n\n");
printf("In C++:\n");
printf(" Uses 'new' and 'delete' (or 'delete[]').\n");
printf(" Supports RAII and Smart Pointers (unique_ptr, shared_ptr) for safety.\n");
break;
case 0:
printf("Exiting C/C++ Helper.\n");
break;
default:
printf("Invalid choice!\n");
break;
}
if (choice != 0) {
printf("\n[Press Enter to continue...]");
while (getchar() != '\n');
getchar();
}
} while (choice != 0);
}
void rm(void)
{
char rm_file[80];
printf("file want to remove ? ");
fgets(rm_file, sizeof(rm_file), stdin);
rm_file[strcspn(rm_file, "\n")] = '\0';
char sure[10];
printf("Sure ? Y/n : ");
fgets(sure, sizeof(sure), stdin);
sure[strcspn(sure, "\n")] = '\0';
if (strcmp(sure, "y") == 0 || strcmp(sure, "Y") == 0) {
pid_t pid = fork();
if (pid == 0) {
char *args[] = {"sudo", "rm", rm_file, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
} else {
return;
}
}
void systeminfo(void)
{
pid_t pid = fork();
if (pid == 0) {
char *args[] = {"sh", "-c", "ls && lsblk && ls /", NULL};
execvp(args[0], args);
perror("failed execvp");
exit(0);
}
else {
wait(NULL);
}
}
void rep(void)
{
while(1) {
char rep_cmd[50];
printf(" what do you want?\n"
"<how to see info of system linux>\n"
"<how to get remove file in this system>\n"
"<how to get install pkg>\n"
"c_cpp_helper\n"
"<how to install wsl in this system \\\\ powershell>: ");
fgets(rep_cmd, sizeof(rep_cmd), stdin);
rep_cmd[strcspn(rep_cmd, "\n")] = '\0';
if (strcmp(rep_cmd, "how to see info of system linux") == 0) {
printf("in your terminal , getting command ls, lsblk, ls /, whoami, in this system, you command the systeminfo\n");
} else if (strcmp(rep_cmd, "how to get remove file in this system") == 0) {
printf(" in your terminal, getting command rm and your file path wanted to remove, in this system you command rm and write the path file\n");
} else if (strcmp(rep_cmd, "how to get install pkg") == 0) {
printf("sudo and your pkg and your pkg , in this system, just command inst and select pkgmanager, select pkg\n");
} else if (strcmp(rep_cmd, "how to install wsl in this system \\ powershell") == 0) {
printf(" you really use window bruhhh haha, just command wsl --install Ubuntu or in this system, just command wslinstubuntu\n");
} else if (strcmp(rep_cmd, "c_cpp_helper") == 0) {
printf("command the c_cpp_helper for the c and c++ helper");
} else {
exit(0);
}
}
}
int main(void) {
char user_input[256];
while(1) {
input_cmd(user_input, sizeof(user_input));
if (strcmp(user_input, "wslinstubuntu") == 0) {
wslinstubuntu();
} else if (strcmp(user_input, "inst") == 0) {
inst();
} else if (strcmp(user_input, "rm") == 0) {
rm();
} else if (strcmp(user_input, "systeminfo") == 0) {
systeminfo();
} else if (strcmp(user_input, "c_cpp_helper") == 0) {
c_cpp_helper();
} else if (strcmp(user_input, "rep") == 0) {
rep();
} else if (strcmp(user_input, "exit") == 0) {
break;
} else {
printf("not found ***\n");
}
}
return 0;
}
this is the TuxExec v0.02 source , just the simple c_cpp_helper update
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
void input_cmd(char *buf, size_t size)
{
printf("TuxExec: ");
if (fgets(buf, size, stdin) != NULL) {
buf[strcspn(buf, "\n")] = '\0';
}
}
void wslinstubuntu(void)
{
system("wsl --install -d Ubuntu");
printf("window fuckass using wsl btw =)) ");
}
void inst(void)
{
char pkgmn[256];
printf("Linux pkgmn = ? (pacman ,apt , dnf): ");
fgets(pkgmn, sizeof(pkgmn), stdin);
pkgmn[strcspn(pkgmn, "\n")] = '\0';
if (strcmp(pkgmn, "apt") == 0) {
while(1) {
char apt[512];
printf("pkg install: ");
fgets(apt, sizeof(apt), stdin);
apt[strcspn(apt, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror("pid failed");
}
else if (pid == 0) {
char *args[] = {"sudo", "apt", "install", apt, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
else if (strcmp(pkgmn, "dnf") == 0) {
while(1) {
char dnf[512];
printf("pkg install: ");
fgets(dnf, sizeof(dnf), stdin);
dnf[strcspn(dnf, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror("failed pid");
}
else if (pid == 0) {
char *args[] = {"sudo", "dnf", "install", dnf, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
else if (strcmp(pkgmn, "pacman") == 0) {
char pacman[512];
printf("pkg install: ");
fgets(pacman, sizeof(pacman), stdin);
pacman[strcspn(pacman, "\n")] = '\0';
pid_t pid = fork();
if (pid < 0) {
perror(" failed pid");
}
else if (pid == 0) {
char *args[] = {"sudo", "pacman", "-S", pacman, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
}
}
void c_cpp_helper(void)
{
int choice;
do {
system("clear");
printf("C vs C++ QUICK HELPER & COMPARISON\n\n");
printf("1.Learn about if-else in C vs C++\n");
printf("2.Compare I/O (printf/scanf vs cin/cout)\n");
printf("3.C99 stdbool.h vs C++ Native Bool\n");
printf("4.Memory Management (malloc/free vs new/delete)\n");
printf("5.Back / Exit\n\n");
printf("Enter your choice: ");
if (scanf("%d", &choice) != 1) {
while (getchar() != '\n');
continue;
}
system("clear");
switch (choice) {
case 1:
printf("IF-ELSE IN C VS C++\n\n");
printf("In C:\n");
printf(" Uses integer values to evaluate conditions.\n");
printf(" 0 means FALSE, any NON-ZERO value means TRUE.\n");
printf(" Example: if (1) { /* Always runs */ }\n\n");
printf("In C++:\n");
printf(" Has native 'bool' type with 'true' and 'false'.\n");
printf(" Conditions like if (expr) still implicitly convert numbers to bool.\n");
break;
case 2:
printf("PRINTF/SCANF (C) VS CIN/COUT (C++)\n\n");
printf("C (printf / scanf):\n");
printf(" Pure functions inside <stdio.h>.\n");
printf(" Requires explicit format specifiers: %%d, %%s, %%f, %%p.\n");
printf(" Minimal memory footprint, perfect for lightweight CLI tools.\n\n");
printf("C++ (cin / cout):\n");
printf(" Stream objects inside <iostream>.\n");
printf(" Automatically detects data types via operator overloading (<<, >>).\n");
printf(" Convenient, but increases binary size.\n");
break;
case 3:
printf("BOOLEAN TYPES\n\n");
printf("In C:\n");
printf(" C89/C90 has no native bool type.\n");
printf(" Since C99, you must include <stdbool.h> to use 'bool', 'true', 'false'.\n\n");
printf("In C++:\n");
printf(" 'bool', 'true', and 'false' are built-in keywords.\n");
break;
case 4:
printf("MEMORY MANAGEMENT\n\n");
printf("In C:\n");
printf(" Uses malloc(), calloc(), realloc() for Heap allocation.\n");
printf(" Manual memory cleanup required using free() to prevent leaks.\n\n");
printf("In C++:\n");
printf(" Uses 'new' and 'delete' (or 'delete[]').\n");
printf(" Supports RAII and Smart Pointers (unique_ptr, shared_ptr) for safety.\n");
break;
case 0:
printf("Exiting C/C++ Helper.\n");
break;
default:
printf("Invalid choice!\n");
break;
}
if (choice != 0) {
printf("\n[Press Enter to continue...]");
while (getchar() != '\n');
getchar();
}
} while (choice != 0);
}
void rm(void)
{
char rm_file[80];
printf("file want to remove ? ");
fgets(rm_file, sizeof(rm_file), stdin);
rm_file[strcspn(rm_file, "\n")] = '\0';
char sure[10];
printf("Sure ? Y/n : ");
fgets(sure, sizeof(sure), stdin);
sure[strcspn(sure, "\n")] = '\0';
if (strcmp(sure, "y") == 0 || strcmp(sure, "Y") == 0) {
pid_t pid = fork();
if (pid == 0) {
char *args[] = {"sudo", "rm", rm_file, NULL};
execvp(args[0], args);
perror("failed execvp");
exit(1);
}
else {
wait(NULL);
}
} else {
return;
}
}
void systeminfo(void)
{
pid_t pid = fork();
if (pid == 0) {
char *args[] = {"sh", "-c", "ls && lsblk && ls /", NULL};
execvp(args[0], args);
perror("failed execvp");
exit(0);
}
else {
wait(NULL);
}
}
void rep(void)
{
while(1) {
char rep_cmd[50];
printf(" what do you want?\n"
"<how to see info of system linux>\n"
"<how to get remove file in this system>\n"
"<how to get install pkg>\n"
"c_cpp_helper\n"
"<how to install wsl in this system \\\\ powershell>: ");
fgets(rep_cmd, sizeof(rep_cmd), stdin);
rep_cmd[strcspn(rep_cmd, "\n")] = '\0';
if (strcmp(rep_cmd, "how to see info of system linux") == 0) {
printf("in your terminal , getting command ls, lsblk, ls /, whoami, in this system, you command the systeminfo\n");
} else if (strcmp(rep_cmd, "how to get remove file in this system") == 0) {
printf(" in your terminal, getting command rm and your file path
wanted to remove, in this system you command rm and write the path
file\n");
} else if (strcmp(rep_cmd, "how to get install pkg") == 0) {
printf("sudo and your pkg and your pkg , in this system, just command inst and select pkgmanager, select pkg\n");
} else if (strcmp(rep_cmd, "how to install wsl in this system \\ powershell") == 0) {
printf(" you really use window bruhhh haha, just command wsl
--install Ubuntu or in this system, just command wslinstubuntu\n");
} else if (strcmp(rep_cmd, "c_cpp_helper") == 0) {
printf("command the c_cpp_helper for the c and c++ helper");
} else {
exit(0);
}
}
}
int main(void) {
char user_input[256];
while(1) {
input_cmd(user_input, sizeof(user_input));
if (strcmp(user_input, "wslinstubuntu") == 0) {
wslinstubuntu();
} else if (strcmp(user_input, "inst") == 0) {
inst();
} else if (strcmp(user_input, "rm") == 0) {
rm();
} else if (strcmp(user_input, "systeminfo") == 0) {
systeminfo();
} else if (strcmp(user_input, "c_cpp_helper") == 0) {
c_cpp_helper();
} else if (strcmp(user_input, "rep") == 0) {
rep();
} else if (strcmp(user_input, "exit") == 0) {
break;
} else {
printf("not found ***\n");
}
}
return 0;
}