Skip to content

Instantly share code, notes, and snippets.

View arkag's full-sized avatar

Alexander Kagno arkag

  • Denver, CO, USA
View GitHub Profile
@arkag
arkag / state.tf
Created December 9, 2022 19:52
remote state in s3 resources
data "aws_iam_policy_document" "state" {
statement {
sid = "DenyIncorrectEncryptionHeader"
effect = "Deny"
principals {
identifiers = ["*"]
type = "AWS"
@arkag
arkag / sshhh.fish
Created September 29, 2021 21:09
Useful if you need to run a single command or one liner on many machines and you don't want to wear out your fancy new NovelKey Cream Launch Edition switches just yet...
# ssh, but t h i c c
function sshhh
set range_arr (string split '-' (string trim --chars=[] (string match -r "\[[0-9]*-[0-9]*\]" $argv[1])))
set range_start "$range_arr[1]"
set range_end "$range_arr[2]"
set base_hostname (string replace -r -a '\[[0-9]*-[0-9]*\]' '' $argv[1])
for target_host in (seq -f "$base_hostname%g" $range_start $range_end)
set argv[1] "$target_host"
command ssh $argv
end
@arkag
arkag / main.tf
Last active February 23, 2021 22:55
logic to clean out animal names that are less than safe for work
resource "random_pet" "server_name" {
count = 1000
length = 4
separator = local.name_sep
prefix = null
}
locals {
no_no_words = {
jackass = "hinny"
@arkag
arkag / syslog-ng.conf
Last active January 22, 2021 18:02
Relay to multiple hosts
@version: 3.30
@include "scl.conf"
options {
time-reap(30);
mark-freq(10);
keep-hostname(yes);
chain-hostnames(no);
};
source s_source { syslog( ip("0.0.0.0") transport("udp") ); };
$Array = if ($Var -eq "Something") {
@("One Element")
} else {
@("One Element","Two Elements")
}
for($i = 0; $i -lt $Array.length; $i++){
$Array[$i]
}
# vouch config
# you should probably start with one of the other configs in the example directory
# vouch proxy does a fairly good job of setting its config to sane defaults
# be aware of your indentation, the only top level elements are `vouch` and `oauth`.
vouch:
logLevel: debug
# logLevel: info
2020-01-22T20:07:09.114Z INFO testing: true, using development console logger
2020-01-22T20:07:09.114Z DEBUG logLevel set to debug
2020-01-22T20:07:09.114Z WARN setting `vouch.cookie.maxage` to `vouch.jwt.maxage` value of 240 minutes (curently set to 14400 minutes)
2020-01-22T20:07:09.114Z INFO configuring oidc OAuth with Endpoint https://dev-number-admin.okta.com/oauth2/default/v1/authorize
2020-01-22T20:07:09.114Z DEBUG vouch.jwt.secret is 50 characters long
2020-01-22T20:07:09.114Z DEBUG vouch.session.key is 50 characters long
2020-01-22T20:07:09.114Z DEBUG checking availability of tcp port: 0.0.0.0:9090
2020-01-22T20:07:09.128Z DEBUG viper settings map[oauth:map[auth_url:https://dev-number-admin.okta.com/oauth2/default/v1/authorize callback_url:https://sub.domain.com/stats/auth client_id:0oa11gjiqk1m5kYHD4x6 client_secret:I_LY1Rt6UiG8m6Q6mWjHOQkh920fqn_GgAChgv52 provider:oidc scopes:[openid email] token_url:https://dev-number-admin.okta.com/oauth2/default/v1/token user_info_url:https://dev-number-admin.ok
https://sub.domain.com:9090/login?url=https://sub.domain.com/stats/&vouch-failcount=&X-Vouch-Token=&error=2020-01-22T18:56:12.169Z DEBUG /login
2020-01-22T18:56:12.169Z WARN domain sub.domain.com:9090 not found in any domains []
2020-01-22T18:56:12.169Z DEBUG session state set to FgdHzxoCNmua3CYZf3AAJDOo1fns1m
2020-01-22T18:56:12.169Z DEBUG session requestedURL set to https://sub.domain.com/stats/
2020-01-22T18:56:12.169Z DEBUG saving session
2020-01-22T18:56:12.169Z WARN domain sub.domain.com:9090 not found in any domains []
2020-01-22T18:56:12.169Z DEBUG looking for redirect URL matching
2020-01-22T18:56:12.169Z DEBUG redirecting to oauthURL https://dev-number-admin.okta.com/oauth2/default/v1/authorize?client_id=secret&redirect_uri=https%3A%2F%2Fsub.domain.com%2Fauth&response_type=code&scope=openid+email&state=FgdHzxoCNmua3CYZf3AAJDOo1fns1m
2020-01-22T18:56:12.169Z DEBUG CaptureWriter.Write set w.StatusCode 200
2020-01-22T18:56:12.169Z DEBUG Request handled successfully: 200
# vouch config
# you should probably start with one of the other configs in the example directory
# vouch proxy does a fairly good job of setting its config to sane defaults
# be aware of your indentation, the only top level elements are `vouch` and `oauth`.
vouch:
logLevel: debug
# logLevel: info
[root@ip-192-168-###-### vouch-proxy-0.6.17]# ./vouch-proxy-0.6.17
2020-01-22T18:19:05.128Z INFO testing: true, using development console logger
2020-01-22T18:19:05.128Z DEBUG logLevel set to debug
2020-01-22T18:19:05.129Z WARN setting `vouch.cookie.maxage` to `vouch.jwt.maxage` value of 240 minutes (curently set to 14400 minutes)
2020-01-22T18:19:05.129Z INFO configuring oidc OAuth with Endpoint https://dev-number-admin.okta.com/oauth2/default/v1/authorize
2020-01-22T18:19:05.129Z DEBUG vouch.jwt.secret is 50 characters long
2020-01-22T18:19:05.129Z DEBUG vouch.session.key is 50 characters long
2020-01-22T18:19:05.129Z DEBUG checking availability of tcp port: 0.0.0.0:9090
2020-01-22T18:19:05.129Z DEBUG viper settings map[oauth:map[auth_url:https://dev-number-admin.okta.com/oauth2/default/v1/authorize callback_url:https://sub.domain.com/auth client_id:secret client_secret:secret provider:oidc scopes:[openid email] token_url:https://dev-number-admin.okta.com/oauth2/default/v1/token user_info_url:https://dev-nu