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() { |
| build_powerline_prompt() { | |
| # Capture the exit code of the last command immediately | |
| local EXIT="$?" | |
| # String where we accumulate everything | |
| local prompt="" | |
| # Define color palette | |
| local reset='\e[0m' |
| 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 |