Skip to content

Commit

Permalink
Readme Updated, some bug fixing,
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencosta13 committed Dec 22, 2021
1 parent 2bed6c1 commit 14657c7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 34 deletions.
Binary file added assets/Animation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 20 additions & 16 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
name="Ruben Lavos Costa"
discord="Ruben Costa#4242"


; Do not use ""

[PlaceHolders]
discordUsername="" #E.G. File Cleaner
embedTitle="" #E.G. Temporary File Cleaner
embedColor=1752220 #Ckeck Colors on the bottom -> Use Int Value
os_placeholder="" #E.G. Operating System:
os_hostname="" #E.G. Hostname: [On my organization we chnaged the computer hostname for the internet switch port's number]
cpu_core="" #E.G CPU cores:
free_ram="" #E.G. Free RAM:
available_ram="" #E.G. Available RAM:
uptime="" #E.G. Uptime:
cpu_percentage="" #E.G. CPU usage [On the code it ads the percentatge symbol itself]
c_drive_usage="" #E.G. C drive usage: [On the code it ads the percentatge symbol itself]
disk_cleanup="" #E.G. C drive needs to be cleaned up: [It will only show if the drive is higher than 70% used]
temporary_files_cleaned ="" #E.G. Temporary files Cleaned!
error="" #E.G. Error:
computer="" #E.G. Computer:
not_updated="" #E.G. New version available: https://github.com/rubencosta13/Temporary-files-cleaner
discordUsername= #E.G. File Cleaner
embedTitle= #E.G. Temporary File Cleaner
embedColor=1752220 #Ckeck Colors on the bottom -> Use Int Value
os_placeholder= #E.G. Operating System:
os_hostname= #E.G. Hostname: [On my organization we chnaged the computer hostname for the internet switch port's number]
cpu_core= #E.G CPU cores:
free_ram= #E.G. Free RAM:
available_ram= #E.G. Available RAM:
uptime= #E.G. Uptime:
cpu_percentage= #E.G. CPU usage [On the code it ads the percentatge symbol itself]
c_drive_usage= #E.G. C drive usage: [On the code it ads the percentatge symbol itself]
disk_cleanup= #E.G. C drive needs to be cleaned up: [It will only show if the drive is higher than 70% used]
temporary_files_cleaned = #E.G. Temporary files Cleaned!
error= #E.G. Error:
computer= #E.G. Computer:
not_updated= #E.G. New version available: https://github.com/rubencosta13/Temporary-files-cleaner
footerText= #E.G. Any text for the footer

[Variables]
discord_logger= #Webhook where all the infos are logged on
Expand Down
15 changes: 7 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const username = os.userInfo().username
const temp = `C:\\Windows\\Temp`
const temp2 = `C:\\Users\\${username}\\AppData\\Local\\Temp`
const prefetch = `C:\\Windows\\Prefetch`
const config = ini.parse(fs.readFileSync(location, 'utf-8'));
const config = ini.parse(fs.readFileSync(__dirname+'\\config.ini', 'utf-8'));

function checkVersion(){
const currentVersion = fs.readFileSync(__dirname+'\\version.js', 'utf-8')
Expand All @@ -22,7 +22,6 @@ function checkVersion(){
if (currentVersion !== githubVersion){
console.log(`New version available!`)
newUpdate()
return
}
})
}
Expand All @@ -42,7 +41,7 @@ function newUpdate(){
"image": {},
"thumbnail": {},
"footer": {
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} `
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} ${config.PlaceHolders.footerText}`
},
"fields": []
}
Expand Down Expand Up @@ -71,13 +70,13 @@ try {
{
"title": config.PlaceHolders.embedTitle,
"color": config.PlaceHolders.embedColor, // config.PlaceHolders.os_placeholder +`${os.type()}\n`+config.PlaceHolders.os_hostname+`${os.hostname()}\n`+config.PlaceHolders.cpu_core+`${os.cpus().length}\n`+config.PlaceHolders.free_ram+`${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+`${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+`${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+`${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+`${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned
"description": config.PlaceHolders.os_placeholder +`${os.type()}\n`+config.PlaceHolders.os_hostname+`${os.hostname()}\n`+config.PlaceHolders.cpu_core+`${os.cpus().length}\n`+config.PlaceHolders.free_ram+`${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+`${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+`${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+`${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+`${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned,
"description": config.PlaceHolders.os_placeholder +` ${os.type()}\n`+config.PlaceHolders.os_hostname+` ${os.hostname()}\n`+config.PlaceHolders.cpu_core+` ${os.cpus().length}\n`+config.PlaceHolders.free_ram+` ${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+` ${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+` ${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+` ${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+` ${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned,
"timestamp": null,
"author": {},
"image": {},
"thumbnail": {},
"footer": {
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()}`
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} ${config.PlaceHolders.footerText}`
},
"fields": []
}
Expand All @@ -93,13 +92,13 @@ try {
{
"title": config.PlaceHolders.embedTitle,
"color": config.PlaceHolders.embedColor, //config.PlaceHolders.os_placeholder +`${os.type()}\n`+config.PlaceHolders.os_hostname+`${os.hostname()}\n`+config.PlaceHolders.cpu_core+`${os.cpus().length}\n`+config.PlaceHolders.free_ram+`${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+`${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+`${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+`${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+`${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned+"\n\n"+config.PlaceHolders.disk_cleanup
"description": config.PlaceHolders.os_placeholder +`${os.type()}\n`+config.PlaceHolders.os_hostname+`${os.hostname()}\n`+config.PlaceHolders.cpu_core+`${os.cpus().length}\n`+config.PlaceHolders.free_ram+`${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+`${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+`${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+`${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+`${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned+"\n\n"+config.PlaceHolders.disk_cleanup,
"description": config.PlaceHolders.os_placeholder + `${os.type()}\n`+config.PlaceHolders.os_hostname+` ${os.hostname()}\n`+config.PlaceHolders.cpu_core+` ${os.cpus().length}\n`+config.PlaceHolders.free_ram+` ${Math.floor(os.freemem().toFixed(2))} Mb\n`+config.PlaceHolders.available_ram+` ${Math.floor(os.totalmem().toFixed(2))} Mb\n`+config.PlaceHolders.uptime+` ${os.uptime()} seconds\n`+config.PlaceHolders.cpu_percentage+` ${cpuPercentage}%\n`+config.PlaceHolders.c_drive_usage+` ${disks[0].capacity}\n\n`+config.PlaceHolders.temporary_files_cleaned+"\n\n"+config.PlaceHolders.disk_cleanup,
"timestamp": null,
"author": {},
"image": {},
"thumbnail": {},
"footer": {
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()}`
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} ${config.PlaceHolders.footerText}`
},
"fields": []
}
Expand All @@ -124,7 +123,7 @@ try {
"image": {},
"thumbnail": {},
"footer": {
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} `
"text": `Made by: Ruben Costa#4242 | ${date.toISOString()} ${config.PlaceHolders.footerText}`
},
"fields": []
}
Expand Down
42 changes: 32 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
# Temp file cleaner
# Temporary file cleaner

This script is being developed, so companies, don't have to worry about going to a computer, deleting temporary files (this can cause a loss of performance if not cleaned, this is more visible on low spec computers), and checking the following things:
- [Temporary File Cleaner](#-Temporary-file-cleaner)
- [Project Explanation](#-Project-explanation)
- [Project Status](#-Project-Status)
- [Usage](#usage)
- [What's New?](#whats-new)
- [Question](#question)
- [License](#license)
- [Technologies](#links)



# About the project
This script was developed, so companies, don't have to worry about going to a computer and deleting temporary files (this can cause a loss of performance if not cleaned, this is more visible on low spec computers). And monitor the following information:

- Task manager:
- Cpu utilization
- Memory utilization
- General computer specs
- General computer specs

You can also retrieve information about the system, over discord:
<br>
<img src="./assets/Animation.gif">

# 📃 To-do:
# Project Status
## 📃 To-do:
[] Getting information about CPU temperature
# 🛠️ Working on:
## 🛠️ Working on:
[] Auto updating;

# ✅ Done:
## ✅ Done:
[] Getting information about the disks
[] Cleaning temporary files


# Configurations
- Create a webhook
Creating a Discord Webhook:

<!-- - Create a webhook
- Go into config.ini file and assign the values, (inside the file there's an explanation about every setting)
- Download all the packages using `npm install`, use `npm build` to make an executable with nexe. (Caution: Some antivirus will flag it as a virus. Why? You may ask. Response: It removes OS folders, specifically temporary folders: ["temp", "%temp%", "prefetch"], so don't worry!)
- Optional:
Expand All @@ -32,8 +49,13 @@ This script is being developed, so companies, don't have to worry about going to
- Then click "OK"
- Then click "OK" again and close task manager (The program should run on the defined schedule)## Pre-requisites:
- Recommended having a discord server, to receive the data;
- Then you are going to receive the data to the discord!
- Then you are going to receive the data to the discord! -->


# Technologies
- [NodeJs](https://nodejs.org/)
- [Ini](https://www.npmjs.com/package/ini)
- [Nexe](https://github.com/nexe/nexe)

# 🆘 Help!

Expand Down

0 comments on commit 14657c7

Please sign in to comment.