This guide will walk you through setting up Cloudflared on your system.
You need to have administrative (sudo) access to your system.
Here are the steps to install Cloudflared.
| # Before you use this script you need to configure your AWS SSO profile with `aws configure sso` | |
| # Usage: assume AWS_PROFILE | |
| assume () { | |
| aws sso login --profile $1 | |
| eval "$(aws configure export-credentials --profile $1 --format env)" | |
| } | |
| # This function provide autocompletion | |
| _assume() { |
| #!/usr/bin/env bash | |
| # A portable script for a powerline like prompt | |
| reset='\[\033[0m\]' | |
| bg='\[\033[48;2;48;48;48m\]' | |
| blue='\[\033[38;2;0;175;255m\]' | |
| green='\[\033[38;2;95;215;0m\]' | |
| grey='\[\033[38;2;88;88;88m\]' | |
| greydark='\[\033[38;2;48;48;48m\]' |
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "net/http" | |
| "time" | |
| "golang.org/x/time/rate" | |
| ) |
ASCI art characters for creating diagrams
| # get total requests by status code | |
| awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | |
| # get top requesters by IP | |
| awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}' | |
| # get top requesters by user agent | |
| awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | |
| # get top requests by URL |