Skip to content

Instantly share code, notes, and snippets.

@NotTheDr01ds
NotTheDr01ds / fish_load_sudo_alias.fish
Created December 27, 2021 02:46
Fish `sudo` replacement function
function fish_load_sudo_alias
function sudo
if functions -q -- "$argv[1]"
# Create a string which quotes each of the original arguments
# so that they can be safely passed into the new fish
# instance that is called by sudo.
set cmdline (
for arg in $argv
printf "\"%s\" " $arg
end
@NotTheDr01ds
NotTheDr01ds / cli_mfa.json
Created December 28, 2019 05:06
AWS IAM Policy for requiring MFA token for CLI/Programmatic Access
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyAllWhenMFAIsNotPresent",
"Effect": "Deny",
"NotAction": [
"iam:ListMFADevices",
"sts:GetSessionToken"
],