Skip to content

Instantly share code, notes, and snippets.

View apharp's full-sized avatar

Andy Harp apharp

View GitHub Profile
# Define the file path
$filePath = "C:\Path\To\Your\File.ext"
# Get the current date
$today = Get-Date -Format "yyyy-MM-dd"
# Get the creation date of the file
$file = Get-Item $filePath
$creationDate = $file.CreationTime.Date
@apharp
apharp / call_script.sh
Last active March 3, 2023 20:22
Scripts to cleanup a Debian template
curl -L https://cleanup.aph.im | sh -s
history -c
history -w
sudo poweroff

Keybase proof

I hereby claim:

  • I am apharp on github.
  • I am apharp (https://keybase.io/apharp) on keybase.
  • I have a public key whose fingerprint is 650D 37BD 0B7E 17C1 1444 4896 A42C DF02 70CA 8FE1

To claim this, I am signing this object:

@apharp
apharp / QBTorrent_Extract_rar.ps1
Created April 21, 2019 04:16
Extract RAR files in torrents upon completion.
param (
$TPath
)
$rarFile = Get-ChildItem "$TPath\*" -Include "*.rar"
if ($rarFile.count -gt 0)
{
$rarFullName = $TPath + "\" + $rarFile.Name
# minimum size of USB stick 5.29GB
# Set here the path of your ISO file
$iso = "C:\path\to\Downloads\ISO\Server 2016\en_windows_server_2016_x64_dvd_9718492.iso"
# Clean ! will clear any plugged-in USB stick!!
Get-Disk | Where BusType -eq 'USB' |
Clear-Disk -RemoveData -Confirm:$true -PassThru
# Convert GPT