Friday, March 13, 2026

PowerShell para organizar archivos por año mes y dia

 $origen = "D:\DeleteMe"

Get-ChildItem $origen -File | ForEach-Object {

    # Obtener fecha de modificación en formato YYYYMMDD

    $fecha = $_.LastWriteTime.ToString("yyyyMMdd")

    # Crear carpeta destino

    $carpetaDestino = Join-Path $origen $fecha

    if (!(Test-Path $carpetaDestino)) {

        New-Item -ItemType Directory -Path $carpetaDestino | Out-Null

    }

    # Mover archivo

    Move-Item $_.FullName $carpetaDestino

}

Wednesday, October 29, 2025

Espacio disponible en Sharepoint

 https://admin.cloud.microsoft/?#/reportsUsage/SharePointStorage




Friday, August 8, 2025

lets encrypt para nginx

 https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04-es


sudo apt install certbot python3-certbot-nginx

sudo nano /etc/nginx/sites-available/example.com

...

server_name example.com www.example.com;

...

sudo certbot certonly --webroot -w /var/www/html/ -d tuSitio.ddns.net

#para validar configuracion 
sudo nginx -t

#para recargar la nueva configuracion
sudo systemctl reload nginx


#para validar la actualizacion
sudo systemctl status certbot.timer

#para actualizar
sudo certbot renew --dry-run


#basado en 
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04-es

Friday, May 2, 2025

Msg 15138, Level 16, State 1, Line 7 The database principal owns a schema in the database, and cannot be dropped.

 Msg 15138, Level 16, State 1, Line 7 The database principal owns a schema in the database, and cannot be dropped.



SELECT SCHEMA_NAME, 

    SCHEMA_OWNER

FROM INFORMATION_SCHEMA.schemata

WHERE SCHEMA_OWNER = 'USERNAME';

--mi arreglo--

alter authorization on schema::db_ddladmin TO dbo;

alter authorization on schema::db_owner TO dbo;


posterior a eso puedo borrar y crear el usuario con problema

Friday, April 25, 2025

obtener ip publica desde power shell

 Invoke-RestMethod -Uri "https://ipinfo.io/ip"



telnet por powershell

 Telnet de Power Shell:


debe ser con acceso de admin

Test-NetConnection -ComputerName 193.127.xxx.xxx -port 22

Thursday, April 24, 2025

Generar PFX desde un certificado auto generado

 

openssl pkcs12 -export -in certificate.crt -inkey privatekey.key -certfile ca-bundle.crt -out output.pfx


al querer cargar en windows 2016 arroja error.

con este otro comando permite instalar

openssl pkcs12 -export -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -nomac -inkey tetra.key -in tetra.crt -out tetra.pfx