Skip to content

Instantly share code, notes, and snippets.

View gioxx's full-sized avatar
☮️
I do things, I see people, I write.

Giovanni Francesco Solone gioxx

☮️
I do things, I see people, I write.
View GitHub Profile
@gioxx
gioxx / AzureADMSNamedLocationPolicy-CountriesTranslate.ps1
Created January 5, 2023 16:19
Tiro fuori una lista di paesi dai quali accetto accesso condizionale (M365) in base al nome dato al gruppo località in AzureAD.
<#
OFFICE 365: Expand Countries from Location Policies on Azure AD (Get-AzureADMSNamedLocationPolicy) for PowerShell 7
---------------------------------------------------------------------------------------------------
Autore: GSolone
Versione: 0.1
Utilizzo: .\AzureADMSNamedLocationPolicy-CountriesTranslate.ps1
Info: https://gioxx.org/tag/o365-powershell
Fonti utilizzate: https://learn.microsoft.com/en-us/powershell/module/azuread/get-azureadmsnamedlocationpolicy?view=azureadps-2.0
https://datahub.io/core/country-list
https://stackoverflow.com/a/5466355/2220346
@gioxx
gioxx / rpi_PowerCheck.sh
Created July 8, 2022 12:21
Tieni sotto controllo eventuali blackout di corrente tramite eventi / controlli sul Raspberry Pi. https://gioxx.org
#!/bin/bash
# Electricity Power Check Script
# GSolone, 2022 - https://gioxx.org
#================================================================================
# Credits:
# https://raspberrypi-guide.github.io/programming/run-script-on-boot
# https://unix.stackexchange.com/a/616085
# https://www.cyberciti.biz/faq/unix-linux-bash-script-check-if-variable-is-empty/
# https://www.cyberciti.biz/tips/howto-linux-unix-write-to-syslog.html
# https://askubuntu.com/a/77739
@gioxx
gioxx / r2z-fx.py
Created May 19, 2022 13:21
Script di creazione pacchetto "portable" di Firefox Win32 partendo dall'ultima release stabile.
import requests
import urllib.request
import base64
import json
import os
import shutil
import subprocess
import hashlib
channel = "LATEST_FIREFOX_VERSION"
@gioxx
gioxx / Homenet-TelecomItalia-Suffix.ps1
Created March 22, 2022 11:37
Rimuove il suffisso DNS inserito in maniera forzata dai router Telecom Italia sulle schede di rete Windows - https://gioxx.org/tag/powershell/
<#
Remove homenet.telecomitalia.it from Windows DNS Suffix
GSolone 22/3/22
Credits:
https://superuser.com/a/1507551
https://docs.microsoft.com/en-us/powershell/module/dnsclient/set-dnsclientglobalsetting?view=windowsserver2022-ps&viewFallbackFrom=win10-ps
https://www.mssqltips.com/sqlservertip/5459/how-to-modify-the-global-dns-configuration-on-servers-using-powershell/
https://adamtheautomator.com/powershell-replace/
#>
try {
@gioxx
gioxx / O365LicenseFriendlyName.txt
Created March 7, 2022 10:38
Una lista di mappatura tra licenze Office 365 (SkuPartNumber via PowerShell) e nome più amichevole (la base è stata curata da https://o365reports.com/2021/11/23/office-365-license-reporting-and-management-using-powershell, in seguito modificata da me) - https://gioxx.org
AAD_BASIC= Azure Active Directory Basic
AAD_PREMIUM= Azure Active Directory Premium
AAD_PREMIUM_P1= Azure Active Directory Premium P1
AAD_PREMIUM_P2= Azure Active Directory Premium P2
ADALLOM_O365= Office 365 Advanced Security Management
ADALLOM_STANDALONE= Microsoft Cloud App Security
ADALLOM_S_O365= POWER BI STANDALONE
ADALLOM_S_STANDALONE= Microsoft Cloud App Security
ATA= Azure Advanced Threat Protection for Users
ATP_ENTERPRISE= Exchange Online Advanced Threat Protection
@gioxx
gioxx / WinVerNew.nsh
Created February 14, 2022 11:40
GetWindowsVersion 4.1.2 (2022-01-24) - alternate script with server versions - fixes the problem related to the non-detection of Windows 10 (the original script does match only if it finds version 10.0) - https://gioxx.org
; GetWindowsVersion 4.1.2 (2022-01-24) - alternate script with server versions
;
; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/
; Update by Joost Verburg, Giovanni 'Gioxx' Solone
; Update (Macro, Define, Windows 7 detection) - John T. Haller of PortableApps.com - 2008-01-07
; Update (Windows 8 detection) - Marek Mizanin (Zanir) - 2013-02-07
; Update (Windows 8.1 detection) - John T. Haller of PortableApps.com - 2014-04-04
; Update (Windows 2008, 2008R2, 2012 and 2012R2 detection) - Francisco Simoões Filho franksimoes@gmail.com - 2014-08-25
; Update (Windows 10 TP detection) - John T. Haller of PortableApps.com - 2014-10-01
; Update (Windows 10 TP4 and 2016 detection, and added include guards) - Kairu - 2015-06-22
@gioxx
gioxx / CleanSDPPatch.vbs
Created February 9, 2022 11:28
Uno script che permette di pulire la cartella Patch di ManageEngine ServiceDesk Plus (Aggiornato al 2022)
'GSolone 2019
' ult.mod. 9/2/22: integro le eccezioni per cartelle e file da escludere dalla pulizia
' Credits:
' https://www.experts-exchange.com/questions/23543652/VBScript-to-delete-all-files-and-folders-in-a-directory.html
' https://www.automateexcel.com/vba/getfolder-getfile/
' https://superuser.com/a/1127074
strFolder = "C:\ManageEngine\ServiceDesk\Patch"
intDays = 0
@gioxx
gioxx / mirror_remote_directory_to_local_directory
Last active January 26, 2022 13:48 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
REMOTE_DIR='/absolute/path/to/remote/directory'
LOCAL_DIR='/absolute/path/to/local/directory'
@gioxx
gioxx / AttachmentReminder.cls
Created January 21, 2022 14:01
Dedicato a chi dimentica di allegare i file prima di mandare un'email. Testato con successo su Outlook 2016 (16.0.14326.20706)
' Outlook 2016: Attachment Reminder
' -----------------------------------------------------------------------------------------------------------
' Author: GSolone
' Version: 0.1
' Last modified: 21-01-2022
' Credits: https://www.slipstick.com/outlook/email/attachment-missing-from-outlook-message/
' https://stackoverflow.com/questions/40934390/how-to-check-for-attachment-when-sending-an-email
' ------------------------------------------------------------------------------------------------------------
' UPDATES:
' -
@gioxx
gioxx / Win10DisableShutdown.cmd
Created November 15, 2021 11:58
Uno script che ti permette di disabilitare / abilitare facilmente le voci per arrestare il sistema, riavviarlo, disconnettere l'utente corrente. Vedi https://gioxx.org/tag/StartOptionDisable
@echo off
:: Windows 10 Start Options Disable
:: https://gioxx.org/tag/StartOptionDisable
:: GSolone 2021 (ult.mod. 15112021-rev5)
:: Check Windows Version
for /f "tokens=4,5,6 delims=[]. " %%G in ('ver') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
if '%_major%' NEQ '10' (
echo Windows 10 non rilevato, premi un tasto per terminare lo script.
pause > NUL