michelgentile / Housekeep folder
0 j'aimes
0 forks
1 fichiers
Dernière activité 2 months ago
| 1 | #Remove files older than... |
| 2 | Get-ChildItem -File -Recurse | Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-180) } | Remove-Item -Force |
| 3 | |
| 4 | #Remove empty folders (may be repeated up to X times...) |
| 5 | Get-ChildItem -Directory -Recurse | Where-Object { -not (Get-ChildItem -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue) } | Remove-Item -Force |
michelgentile / Symbolic Link in Windows
0 j'aimes
0 forks
1 fichiers
Dernière activité 1 month ago
| 1 | pwsh -command "New-Item -ItemType SymbolicLink -Target 'c:\i\am\the\classic\folder' -Path 'c:\this\is\a\symbolic\link'" |
michelgentile / Windows Privilege Definition
0 j'aimes
0 forks
1 fichiers
Dernière activité 5 months ago
| 1 | icacls "C:\folder" /grant user:(OI)(CI)M /T |
| 2 | |
| 3 | REM (OI) = Object Inherit → Applies on files inside folders |
| 4 | REM (CI) = Container Inherit → Applies on FUTURE subfolders |
| 5 | REM M = Modify |
| 6 | REM /T = Applies on EXISTING subfolders |
michelgentile / Show runtime errors in PHP
0 j'aimes
0 forks
1 fichiers
Dernière activité 6 months ago
| 1 | <?php |
| 2 | ini_set( 'display_errors', 1 ); |
| 3 | ini_set( 'display_startup_errors', 1 ); |
| 4 | error_reporting( E_ALL ); |
michelgentile / Compute Hash with PowerShell
0 j'aimes
0 forks
1 fichiers
Dernière activité 6 months ago
| 1 | pwsh -command "( Get-FileHash -Algorithm SHA256 c:\folder\file ).Hash.ToLower()" |
michelgentile / Docker installation
0 j'aimes
0 forks
1 fichiers
Dernière activité 7 months ago
| 1 | #!/usr/bin/bash |
| 2 | dnf update -y |
| 3 | dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo |
| 4 | dnf install -y docker-ce docker-ce-cli containerd.io |
| 5 | systemctl start docker |
| 6 | systemctl enable docker |
Plus récent
Plus ancien