Skip to content

Instantly share code, notes, and snippets.

View richmont's full-sized avatar

Richelmy Monteiro richmont

View GitHub Profile
@richmont
richmont / detect_printers.py
Last active May 8, 2024 01:04
Detect printer name and IP with Get-Printer command from powershell and python (v2)
import subprocess
import sys
import platform
import ipaddress
from datetime import datetime
import time
import queue
from threading import Thread
import requests
from bs4 import BeautifulSoup
@richmont
richmont / compactar_pdfs.ps1
Created September 26, 2023 04:15
Compactar todos os PDFs de uma pasta usando Ghostscript e Powershell
$sourceFolder = "c:\origem"
$destinationFolder = "c:\destino"
$ghostscriptPath = "C:\Program Files\gs\gs10.02.0\bin\gswin64c.exe"
$pdfSettings = "/ebook"
Get-ChildItem -Path $sourceFolder -Filter "*.pdf" | ForEach-Object {
$outputFile = Join-Path -Path $destinationFolder -ChildPath $_.Name
$arguments = "-sDEVICE=pdfwrite", "-dCompatibilityLevel=1.4", "-dPDFSETTINGS=$pdfSettings", "-dNOPAUSE", "-dQUIET", "-dBATCH", "-sOutputFile=`"$outputFile`"", "`"$_`""
& $ghostscriptPath @arguments
@richmont
richmont / python3-windows.sublime-build
Created January 5, 2020 04:18
build system sublime text python3 Windows
{
"cmd": ["C:/Program Files (x86)/Python37-32/python.exe", "-u", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python"
}
@richmont
richmont / cluster_1.bat
Created May 14, 2019 04:33
Scripts para iniciar um servidor dedicado de Don't Starve Together
cd /D "%~dp0"
dontstarve_dedicated_server_nullrenderer.exe -only_update_server_mods
start "My DST Server Master" dontstarve_dedicated_server_nullrenderer.exe -cluster Cluster_1 -shard Master
start "My DST Server Caves" dontstarve_dedicated_server_nullrenderer.exe -cluster Cluster_1 -shard Caves