2022-10-12 01:53:36 +00:00
|
|
|
SELECT
|
|
|
|
p.pid,
|
2022-09-24 15:12:23 +00:00
|
|
|
p.path,
|
|
|
|
p.name,
|
|
|
|
p.cmdline,
|
|
|
|
p.cwd,
|
|
|
|
p.euid,
|
|
|
|
p.parent,
|
|
|
|
pp.path AS parent_path,
|
|
|
|
pp.name AS parent_name,
|
|
|
|
pp.cmdline AS parent_cmdline,
|
|
|
|
pp.cwd AS parent_cwd,
|
|
|
|
pp.euid AS parent_euid,
|
2022-10-05 12:36:35 +00:00
|
|
|
hash.sha256,
|
|
|
|
REPLACE(p.cwd, u.directory, "~") AS dir,
|
2022-10-12 01:53:36 +00:00
|
|
|
CONCAT (
|
2022-10-05 12:36:35 +00:00
|
|
|
p.name,
|
|
|
|
",",
|
|
|
|
IIF(
|
2022-10-12 01:53:36 +00:00
|
|
|
REGEX_MATCH (
|
2022-10-05 12:36:35 +00:00
|
|
|
REPLACE(p.cwd, u.directory, "~"),
|
|
|
|
"([/~].*?/.*?/.*?)/",
|
|
|
|
1
|
|
|
|
) != "",
|
2022-10-12 01:53:36 +00:00
|
|
|
REGEX_MATCH (
|
2022-10-05 12:36:35 +00:00
|
|
|
REPLACE(p.cwd, u.directory, "~"),
|
|
|
|
"([/~].*?/.*?/.*?)/",
|
|
|
|
1
|
|
|
|
),
|
|
|
|
REPLACE(p.cwd, u.directory, "~")
|
|
|
|
)
|
|
|
|
) AS exception_key
|
2022-10-12 01:53:36 +00:00
|
|
|
FROM
|
|
|
|
processes p
|
2022-09-30 18:12:24 +00:00
|
|
|
LEFT JOIN processes pp ON p.parent = pp.pid
|
2022-10-05 12:36:35 +00:00
|
|
|
LEFT JOIN users u ON p.uid = u.uid
|
2022-09-24 15:12:23 +00:00
|
|
|
LEFT JOIN hash ON p.path = hash.path
|
2022-10-12 01:53:36 +00:00
|
|
|
WHERE
|
|
|
|
dir LIKE "%/.%"
|
2022-10-05 20:15:40 +00:00
|
|
|
AND NOT (
|
|
|
|
exception_key IN (
|
2022-10-07 20:19:18 +00:00
|
|
|
"bash,~/.local/share",
|
2022-10-05 20:15:40 +00:00
|
|
|
"bash,~/go/src",
|
2022-10-07 20:19:18 +00:00
|
|
|
"Electron,~/.vscode/extensions",
|
|
|
|
"fish,~/.local/share",
|
|
|
|
"git,~/.local/share",
|
2022-10-12 01:53:36 +00:00
|
|
|
"makepkg,~/.cache/yay",
|
|
|
|
"make,~/.cache/yay",
|
|
|
|
"java,~/.gradle/daemon",
|
|
|
|
"java,~/.local/share",
|
|
|
|
"rust-analyzer-p,~/.cargo/registry",
|
|
|
|
"as,~/.cache/yay",
|
|
|
|
"c++,~/.cache/yay",
|
|
|
|
"cc1plus,~/.cache/yay",
|
2022-10-07 20:19:18 +00:00
|
|
|
"mysqld,~/.local/share"
|
2022-10-05 20:15:40 +00:00
|
|
|
)
|
2022-10-12 01:53:36 +00:00
|
|
|
OR dir IN (
|
|
|
|
"~/.vim",
|
|
|
|
"~/.cache/yay",
|
|
|
|
"~/.local/share/chezmoi",
|
|
|
|
"~/.local/share/nvim",
|
|
|
|
"~/.gmailctl"
|
|
|
|
)
|
|
|
|
OR p.name IN (
|
|
|
|
"bindfs",
|
|
|
|
"vim",
|
|
|
|
"nvim",
|
|
|
|
"code",
|
|
|
|
"updatedb",
|
|
|
|
"git",
|
|
|
|
"gitsign",
|
|
|
|
"Code Helper"
|
|
|
|
)
|
|
|
|
OR dir LIKE "~/.dotfiles/%"
|
|
|
|
OR dir LIKE "~/.gradle/%"
|
|
|
|
OR dir LIKE "~/.local/share/kotlin/%"
|
2022-10-05 20:15:40 +00:00
|
|
|
OR dir LIKE "~/go/src/%"
|
2022-10-07 20:19:18 +00:00
|
|
|
OR dir LIKE "~/.local/share/nvim/%"
|
2022-10-12 01:53:36 +00:00
|
|
|
OR dir LIKE "~/.vscode/extensions/%"
|
2022-10-07 20:19:18 +00:00
|
|
|
OR dir LIKE "~/.local/share/fish/%"
|
2022-10-12 01:53:36 +00:00
|
|
|
OR dir LIKE "~/.cache/yay/%"
|
2022-10-07 20:19:18 +00:00
|
|
|
OR dir LIKE "/Library/Apple/System/Library/InstallerSandboxes/.PKInstallSandboxManager-SystemSoftware/%"
|
2022-10-05 20:15:40 +00:00
|
|
|
OR dir LIKE "~/src/%"
|
|
|
|
OR dir LIKE "~/%/.github%"
|
2022-10-12 01:53:36 +00:00
|
|
|
OR dir LIKE "~/.cargo/%"
|
|
|
|
OR dir LIKE "~/.local/share/JetBrains/%"
|
2022-10-07 20:19:18 +00:00
|
|
|
OR dir LIKE "~/code/%"
|
2022-10-12 01:53:36 +00:00
|
|
|
)
|