Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
#!/usr/bin/env bash | |
################################################################################ | |
# plantuml.sh - A script to wrap PlantUML jar execution | |
# | |
# Author: Firas AlShafei | |
# Created: 2024.07.20 | |
# Last Modified: 2024.07.20 | |
# | |
# Description: |
#!/usr/bin/env bash | |
################################################################################ | |
# encode_puml.sh - A script to find and encode PlantUML files | |
# | |
# Author: Firas AlShafei | |
# Created: 2024.07.20 | |
# Last Modified: 2024.07.20 | |
# | |
# Description: |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
PlantUML Encoder/Decoder | |
======================== | |
This script provides functions to encode and decode PlantUML text. The encoding | |
process compresses the text using zlib and then encodes it using a custom | |
base64-like encoding suitable for PlantUML servers. The decoding process | |
reverses these steps. It also allows extracting and decoding PlantUML text |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Vulnerability Report</title> | |
<!-- Template Metadata--> | |
<meta name="author" content="OnceUponALoop"> | |
<meta name="version" content="1.0.0"> |
# Root CA Bundle - autogenerate from Windows store | |
# Location of bundle | |
# I chose not to override the mingw64 store in /etc/ssl to avoid having to request admin elevation | |
CertFile=$HOME/.certs/ca-bundle.pem | |
# Only recreate once a day | |
if [ "$(date -r $HOME/.certs/ca-bundle.pem +%F 2>/dev/null)" != "$(date +%F)" ]; then | |
mkdir -p $HOME/.certs | |
ps_script=' | |
if (-not $ENV:CertFile) { $ENV:CertFile="$ENV:USERPROFILE\.certs\ca-bundle.pem" } |
if [ $(net session > /dev/null 2>&1; echo $?) -eq 0 ]; then | |
# Set Background Color | |
echo -ne '\e]11;#800F00\a' | |
# Set PS1 | |
export PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[7m\][Admin]\[\033[0m\] \[\033[32m\]\u \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n# ' | |
else | |
#Set PS1 | |
export PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ ' |
#-------------------------------- | |
# Set Admin Mode console colors | |
#-------------------------------- | |
# Check if running in admin mode | |
$IsElevated = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
Function Redraw-Screen{ | |
# Save current console content | |
$bufferWidth = $host.ui.rawui.BufferSize.Width |