Skip to content

Instantly share code, notes, and snippets.

@tevkar
tevkar / File_Size_With_Age.ps1
Last active February 20, 2021 16:32
Total size of files older than a specific number of days
# Provided by itefix.net
Param
(
[string]$path,
[int]$numberDays
)
$cutOffDate = (Get-Date).AddDays(-$numberDays)
$results =
@tevkar
tevkar / copssh-7.0.0-session.patch
Created August 27, 2019 23:41
Copssh OpenSSH session.c patch to avoid messages 'bad ownership or modes for chroot directory' (non-relevant in a Copssh setup)
--- session-old.c 2019-04-18 00:52:57.000000000 +0200
+++ session.c 2019-08-26 01:09:26.880631000 +0200
@@ -1333,10 +1333,12 @@
if (stat(component, &st) != 0)
fatal("%s: stat(\"%s\"): %s", __func__,
component, strerror(errno));
+/*
if (st.st_uid != 0 || (st.st_mode & 022) != 0)
fatal("bad ownership or modes for chroot "
"directory %s\"%s\"",