Skip to content

Instantly share code, notes, and snippets.

View VIRUXE's full-sized avatar

Flávio Pereira VIRUXE

View GitHub Profile
@VIRUXE
VIRUXE / delete_node_modules.ps1
Created June 22, 2024 15:06
Deletes node_modules folders, recursively.
Param(
[Parameter(Mandatory)]
[string]$RootPath
)
if (-not $RootPath) { $RootPath = Read-Host "Enter the root path to search for 'node_modules' folders" }
function Remove-NodeModules($path) {
$success = $true
@VIRUXE
VIRUXE / sv-resources.ps1
Last active June 20, 2024 22:47
Fetch a comma-separated resource list from a FiveM server
try {
$serverCode = $args[0]
if (-not $serverCode) { $serverCode = Read-Host -Prompt 'Please enter the server code' }
$json = Invoke-RestMethod -Uri "https://servers-frontend.fivem.net/api/servers/single/$serverCode"
$serverResources = $json.Data.resources | Sort-Object
Write-Host "Server resources:"
@VIRUXE
VIRUXE / gh_source_repos.php
Created June 18, 2024 14:13
Enumerate source repos and gists for one or multiple user accounts on GitHub
<?php
if (!isset($_GET['username']) && !isset($_GET['usernames'])) {
echo "Usage: gh_source_repos.php?username(s)=username1,username2,...";
exit();
}
$usernames = [];
if (isset($_GET['username']) || isset($_GET['usernames'])) $usernames = array_merge($usernames, explode(",", ($_GET['usernames'] ?? $_GET['username'])));
@VIRUXE
VIRUXE / hts-ectune-colors.ps1
Last active June 17, 2024 10:32
Change your HTS colors for the ones used in eCtune
<#
17-06-2024 VIRUXE - https://flaviopereira.dev
This script replaces current Honda Tuning Suite (https://discord.hondatuningsuite.com) colors with the ones originally used in eCtune.
! eCtune was created by Frank van Koppen
#>
$properties = @{
"TraceColor" = "RGB[-8355585]"
@VIRUXE
VIRUXE / hondaecucomponents.json
Last active June 21, 2024 09:47
HONDA OBD0/1 ECU Component List
{
"credits": [
{
"name" : "Blundar",
"group": "PGMFI.org",
"link" : "http://www.pgmfi.org"
},
{
"name": "BoostedNW",
"link": "http://www.boostednw.com"
@VIRUXE
VIRUXE / scavengesurvive-vehicles.json
Created May 15, 2024 20:19
Vehicle properties from Scavenge and Survive (SA-MP)
[
{
"id": 422,
"name": "Bobcat",
"group": "Civilian",
"category": "TRUCK",
"size": "MEDIUM",
"length": 60.0,
"width": 16.0,
"model": "industrial",
@VIRUXE
VIRUXE / CheckScavengeSurviveServers.ps1
Last active May 16, 2024 23:08
Displays a list of Scavenge and Survive servers, curated from scavengesurvive.com/servers and api.open.mp/servers
function Ping-SampServer {
param(
[string]$Address,
[int]$Port
)
$udpClient = $null
try {
$udpClient = New-Object System.Net.Sockets.UdpClient
@VIRUXE
VIRUXE / GetScavengeSurviveServers.psm1
Created May 14, 2024 21:43
Gets a list of Scavenge and Survive servers, from scavengesurvive.com/servers and api.open.mp/servers
<#
Both functions produce a list of objects with the following format:
Server {
Name,
Address,
Port
}
#>
@VIRUXE
VIRUXE / convert-png-to-webp.py
Created May 11, 2024 23:15
Convert PNG images to WebP, using Pillow
import os
from PIL import Image
import sys
for root, dirs, files in os.walk(sys.argv[1] if len(sys.argv) > 1 else "."):
for file in files:
if file.endswith('.png'):
png_path = os.path.join(root, file)
webp_path = png_path.replace('.png', '.webp')
@VIRUXE
VIRUXE / locale-check.py
Created May 9, 2024 13:26
Checks missing and unused locale keys for a given language, used on the ESX framework (FiveM)
"""
Author: https://github.com/VIRUXE
This script is intended to scan actual script `.lua` files inside a FXServer (CFX/FiveM server) `resources` folder, looking for translation keys.
The ESX framework uses two functions called Translate and TranslateCap to retrieve translations from their respective locale files.
Once it finds all the keys used in the script files, it will scan the `pt.lua` file inside the `locales` folder.
In order to find out which keys are missing, it will compare the keys found in the script files with the keys found in the `pt.lua` file.
The script will then print the keys that are missing and/or unused from the `pt.lua` file