NetVPS 3 jaren geleden
commit
42d1e03090

+ 179 - 0
R9/Herramientas-main/module/module

@@ -0,0 +1,179 @@
+#!/bin/bash
+
+# interfas de colores
+msg(){
+  COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
+  COLOR[1]='\e[31m' #VERMELHO='\e[31m'
+  COLOR[2]='\e[32m' #VERDE='\e[32m'
+  COLOR[3]='\e[33m' #AMARELO='\e[33m'
+  COLOR[4]='\e[34m' #AZUL='\e[34m'
+  COLOR[5]='\e[91m' #MAGENTA='\e[35m'
+  COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
+  COLOR[7]='\e[36m' #teal='\e[36m'
+  COLOR[8]='\e[30m' #negro='\e[30m'
+  COLOR[9]='\033[34m' #blue='\033[1;34m'
+
+  NEGRITO='\e[1m'
+  SEMCOR='\e[0m'
+
+  case $1 in
+    -ne)   cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+    -nazu) cor="${COLOR[6]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+    -nverd)cor="${COLOR[2]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+    -nama) cor="${COLOR[3]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+    -ama)  cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -verm) cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
+    -verm2)cor="${COLOR[1]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -verm3)cor="${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
+    -teal) cor="${COLOR[7]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -teal2)cor="${COLOR[7]}" && echo -e "${cor}${2}${SEMCOR}";;
+    -blak) cor="${COLOR[8]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -blak2)cor="${COLOR[8]}" && echo -e "${cor}${2}${SEMCOR}";;
+    -azu)  cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -blu)  cor="${COLOR[9]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -blu1) cor="${COLOR[9]}" && echo -e "${cor}${2}${SEMCOR}";;
+    -verd) cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -bra)  cor="${COLOR[0]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+    -bar)  cor="${COLOR[1]}=====================================================" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+    -bar2) cor="${COLOR[7]}=====================================================" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+    -bar3) cor="${COLOR[1]}-----------------------------------------------------" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+    -bar4) cor="${COLOR[7]}-----------------------------------------------------" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+  esac
+}
+
+# centrado de texto
+print_center(){
+  if [[ -z $2 ]]; then
+    text="$1"
+  else
+    col="$1"
+    text="$2"
+  fi
+
+  while read line; do
+    unset space
+    x=$(( ( 54 - ${#line}) / 2))
+    for (( i = 0; i < $x; i++ )); do
+      space+=' '
+    done
+    space+="$line"
+    if [[ -z $2 ]]; then
+      msg -azu "$space"
+    else
+      msg "$col" "$space"
+    fi
+  done <<< $(echo -e "$text")
+}
+#print_center2(){
+#    local x
+#    local y
+#    #text="$*"
+#    text="$2"
+#    #x=$(( ($(tput cols) - ${#text}) / 2))
+#    x=$(( ( 54 - ${#text}) / 2))
+#    echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
+#    #echo -e "\033[${y};${x}f$*"
+#    msg "$1" "\033[${y};${x}f$2"
+#}
+
+# titulos y encabesados
+title(){
+    clear
+    msg -bar
+    if [[ -z $2 ]]; then
+      print_center -azu "$1"
+    else
+      print_center "$1" "$2"
+    fi
+    msg -bar
+ }
+
+# finalizacion de tareas
+ enter(){
+  msg -bar
+  text="►► Presione enter para continuar ◄◄"
+  if [[ -z $1 ]]; then
+    print_center -ama "$text"
+  else
+    print_center "$1" "$text"
+  fi
+  read
+ }
+
+# opcion, regresar volver/atras
+back(){
+    msg -bar
+    echo -ne "$(msg -verd " [0]") $(msg -verm2 ">") " && msg -bra "\033[1;41mVOLVER"
+    msg -bar
+ }
+
+# menu maker (opciones 1, 2, 3,.....)
+menu_func(){
+  local options=${#@}
+  local array
+  for((num=1; num<=$options; num++)); do
+    echo -ne "$(msg -verd " [$num]") $(msg -verm2 ">") "
+    array=(${!num})
+    case ${array[0]} in
+      "-vd")echo -e "\033[1;33m[!]\033[1;32m ${array[@]:1}";;
+      "-vm")echo -e "\033[1;33m[!]\033[1;31m ${array[@]:1}";;
+      "-fi")echo -e "${array[@]:2} ${array[1]}";;
+      -bar|-bar2|-bar3|-bar4)echo -e "\033[1;37m${array[@]:1}\n$(msg ${array[0]})";;
+      *)echo -e "\033[1;37m${array[@]}";;
+    esac
+  done
+ }
+
+# opcion de seleccion numerica
+selection_fun(){
+  local selection="null"
+  local range
+  if [[ -z $2 ]]; then
+    opcion=$1
+    col="-nazu"
+  else
+    opcion=$2
+    col=$1
+  fi
+  for((i=0; i<=$opcion; i++)); do range[$i]="$i "; done
+  while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
+    msg "$col" " Selecione una Opcion: " >&2
+    read selection
+    tput cuu1 >&2 && tput dl1 >&2
+  done
+  echo $selection
+}
+
+in_opcion(){
+  unset opcion
+  if [[ -z $2 ]]; then
+      msg -nazu " $1: " >&2
+  else
+      msg $1 " $2: " >&2
+  fi
+  read opcion
+  echo "$opcion"
+}
+
+in_opcion_down(){
+  dat=$1
+  length=${#dat}
+  cal=$(( 22 - $length / 2 ))
+  line=''
+  for (( i = 0; i < $cal; i++ )); do
+    line+='╼'
+  done
+  echo -e " $(msg -verm3 "╭$line╼[")$(msg -azu "$dat")$(msg -verm3 "]")"
+  echo -ne " $(msg -verm3 "╰╼")\033[37;1m> " && read opcion
+}
+
+export -f msg
+export -f selection_fun
+export -f menu_func
+export -f print_center
+export -f title
+export -f back
+export -f enter
+export -f in_opcion
+export -f in_opcion_down
+

+ 5655 - 0
R9/Herramientas-main/trans

@@ -0,0 +1,5655 @@
+#!/usr/bin/env bash
+exec 2>/dev/null
+export TRANS_ENTRY="$0"
+if [[ ! $LANG =~ (UTF|utf)-?8$ ]]; then export LANG=en_US.UTF-8; fi
+read -r -d '' TRANS_PROGRAM << 'EOF'
+BEGIN {
+Name        = "Translate Shell"
+Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc."
+Version     = "0.9.6.7"
+ReleaseDate = "2018-03-17"
+Command     = "trans"
+EntryPoint  = "translate.awk"
+EntryScript = "translate"
+}
+function initConst() {
+NULLSTR = ""
+TRUE = 1
+STDIN  = "/dev/stdin"
+STDOUT = "/dev/stdout"
+STDERR = "/dev/stderr"
+SUPOUT = " > /dev/null "
+SUPERR = " 2> /dev/null "
+PIPE = " | "
+}
+function anything(array,
+i) {
+for (i in array)
+if (array[i]) return 1
+return 0
+}
+function exists(value) {
+if (isarray(value))
+return anything(value)
+else
+return value ? 1 : 0
+}
+function belongsTo(element, array,
+i) {
+for (i in array)
+if (element == array[i]) return element
+return NULLSTR
+}
+function identical(x, y,
+i) {
+if (!isarray(x) && !isarray(y))
+return x == y
+else if (isarray(x) && isarray(y)) {
+if (length(x) != length(y)) return 0
+for (i in x)
+if (!identical(x[i], y[i])) return 0
+return 1
+} else
+return 0
+}
+function append(array, element) {
+array[anything(array) ? length(array) : 0] = element
+}
+function compareByIndexFields(i1, v1, i2, v2,
+t1, t2, tl, j) {
+split(i1, t1, SUBSEP)
+split(i2, t2, SUBSEP)
+tl = length(t1) < length(t2) ? length(t1) : length(t2)
+for (j = 1; j <= tl; j++) {
+if (t1[j] < t2[j])
+return -1
+else if (t1[j] > t2[j])
+return 1
+}
+return 0
+}
+function isnum(string) {
+return string == string + 0
+}
+function startsWithAny(string, substrings,
+i) {
+for (i in substrings)
+if (index(string, substrings[i]) == 1) return substrings[i]
+return NULLSTR
+}
+function matchesAny(string, patterns,
+i) {
+for (i in patterns)
+if (string ~ "^" patterns[i]) return patterns[i]
+return NULLSTR
+}
+function replicate(string, len,
+i, temp) {
+temp = NULLSTR
+for (i = 0; i < len; i++)
+temp = temp string
+return temp
+}
+function reverse(string,
+i, temp) {
+temp = NULLSTR
+for (i = length(string); i > 0; i--)
+temp = temp substr(string, i, 1);
+return temp
+}
+function join(array, separator, sortedIn, preserveNull,
+i, j, saveSortedIn, temp) {
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+temp = NULLSTR
+j = 0
+if (isarray(array)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = sortedIn
+for (i in array)
+if (preserveNull || array[i] != NULLSTR)
+temp = j++ ? temp separator array[i] : array[i]
+PROCINFO["sorted_in"] = saveSortedIn
+} else
+temp = array
+return temp
+}
+function explode(string, array) {
+split(string, array, NULLSTR)
+}
+function escapeChar(char) {
+switch (char) {
+case "b":
+return "\b"
+case "f":
+return "\f"
+case "n":
+return "\n"
+case "r":
+return "\r"
+case "t":
+return "\t"
+case "v":
+return "\v"
+case "u0026":
+return "&"
+case "u003c":
+return "<"
+case "u003e":
+return ">"
+default:
+return char
+}
+}
+function literal(string,
+c, cc, escaping, i, s) {
+if (string !~ /^".*"$/)
+return string
+explode(string, s)
+string = NULLSTR
+escaping = 0
+for (i = 2; i < length(s); i++) {
+c = s[i]
+if (escaping) {
+if (cc) {
+cc = cc c
+if (length(cc) == 5) {
+string = string escapeChar(cc)
+escaping = 0
+cc = NULLSTR
+}
+} else if (c == "u") {
+cc = c
+} else {
+string = string escapeChar(c)
+escaping = 0
+}
+} else {
+if (c == "\\")
+escaping = 1
+else
+string = string c
+}
+}
+return string
+}
+function escape(string) {
+gsub(/\\/, "\\\\", string)
+gsub(/"/, "\\\"", string)
+return string
+}
+function unescape(string) {
+gsub(/\\\"/, "\"", string)
+gsub(/\\\\/, "\\", string)
+return string
+}
+function parameterize(string, quotationMark) {
+if (!quotationMark)
+quotationMark = "'"
+if (quotationMark == "'") {
+gsub(/'/, "'\\''", string)
+return "'" string "'"
+} else {
+return "\"" escape(string) "\""
+}
+}
+function unparameterize(string,    temp) {
+match(string, /^'(.*)'$/, temp)
+if (temp[0]) {
+string = temp[1]
+gsub(/'\\''/, "'", string)
+return string
+}
+match(string, /^"(.*)"$/, temp)
+if (temp[0]) {
+string = temp[1]
+return unescape(string)
+}
+return string
+}
+function toString(value, inline, heredoc, valOnly, numSub, level, sortedIn,
+i, items, j, k, p, saveSortedIn, temp, v) {
+if (!level) level = 0
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+if (isarray(value)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = sortedIn
+p = 0
+for (i in value) {
+split(i, j, SUBSEP); k = join(j, ",")
+if (!numSub || !isnum(k)) k = parameterize(k, "\"")
+v = toString(value[i], inline, heredoc, valOnly, numSub, level + 1, sortedIn)
+if (!isarray(value[i])) v = parameterize(v, "\"")
+if (valOnly)
+items[p++] = inline ? v : (replicate("\t", level) v)
+else
+items[p++] = inline ? (k ": " v) :
+(replicate("\t", level) k "\t" v)
+}
+PROCINFO["sorted_in"] = saveSortedIn
+temp = inline ? join(items, ", ") :
+("\n" join(items, "\n") "\n" replicate("\t", level))
+temp = valOnly ? ("[" temp "]") : ("{" temp "}")
+return temp
+} else {
+if (heredoc)
+return "'''\n" value "\n'''"
+else
+return value
+}
+}
+function squeeze(line, preserveIndent) {
+if (!preserveIndent)
+gsub(/^[[:space:]]+/, NULLSTR, line)
+gsub(/^[[:space:]]*#.*$/, NULLSTR, line)
+gsub(/#[^"/]*$/, NULLSTR, line)
+gsub(/[[:space:]]+$/, NULLSTR, line)
+gsub(/[[:space:]]+\\$/, "\\", line)
+return line
+}
+function yn(string) {
+return (tolower(string) ~ /^([0fn]|off)/) ? 0 : 1
+}
+function initAnsiCode() {
+if (ENVIRON["TERM"] == "dumb") return
+AnsiCode["reset"]         = AnsiCode[0] = "\33[0m"
+AnsiCode["bold"]          = "\33[1m"
+AnsiCode["underline"]     = "\33[4m"
+AnsiCode["negative"]      = "\33[7m"
+AnsiCode["no bold"]       = "\33[22m"
+AnsiCode["no underline"]  = "\33[24m"
+AnsiCode["positive"]      = "\33[27m"
+AnsiCode["black"]         = "\33[30m"
+AnsiCode["red"]           = "\33[31m"
+AnsiCode["green"]         = "\33[32m"
+AnsiCode["yellow"]        = "\33[33m"
+AnsiCode["blue"]          = "\33[34m"
+AnsiCode["magenta"]       = "\33[35m"
+AnsiCode["cyan"]          = "\33[36m"
+AnsiCode["gray"]          = "\33[37m"
+AnsiCode["default"]       = "\33[39m"
+AnsiCode["dark gray"]     = "\33[90m"
+AnsiCode["light red"]     = "\33[91m"
+AnsiCode["light green"]   = "\33[92m"
+AnsiCode["light yellow"]  = "\33[93m"
+AnsiCode["light blue"]    = "\33[94m"
+AnsiCode["light magenta"] = "\33[95m"
+AnsiCode["light cyan"]    = "\33[96m"
+AnsiCode["white"]         = "\33[97m"
+}
+function ansi(code, text) {
+switch (code) {
+case "bold":
+return AnsiCode[code] text AnsiCode["no bold"]
+case "underline":
+return AnsiCode[code] text AnsiCode["no underline"]
+case "negative":
+return AnsiCode[code] text AnsiCode["positive"]
+default:
+return AnsiCode[code] text AnsiCode[0]
+}
+}
+function w(text) {
+print ansi("yellow", text) > STDERR
+}
+function e(text) {
+print ansi("bold", ansi("yellow", text)) > STDERR
+}
+function wtf(text) {
+print ansi("bold", ansi("red", text)) > STDERR
+}
+function d(text) {
+print ansi("gray", text) > STDERR
+}
+function da(value, name, inline, heredoc, valOnly, numSub, sortedIn,
+i, j, saveSortedIn) {
+if (!name)
+name = "_"
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+d(name " = " toString(value, inline, heredoc, valOnly, numSub, 0, sortedIn))
+}
+function assert(x, message) {
+if (!message)
+message = "[ERROR] Assertion failed."
+if (x)
+return x
+else
+e(message)
+}
+function initUrlEncoding() {
+UrlEncoding["\t"] = "%09"
+UrlEncoding["\n"] = "%0A"
+UrlEncoding[" "]  = "%20"
+UrlEncoding["!"]  = "%21"
+UrlEncoding["\""] = "%22"
+UrlEncoding["#"]  = "%23"
+UrlEncoding["$"]  = "%24"
+UrlEncoding["%"]  = "%25"
+UrlEncoding["&"]  = "%26"
+UrlEncoding["'"]  = "%27"
+UrlEncoding["("]  = "%28"
+UrlEncoding[")"]  = "%29"
+UrlEncoding["*"]  = "%2A"
+UrlEncoding["+"]  = "%2B"
+UrlEncoding[","]  = "%2C"
+UrlEncoding["-"]  = "%2D"
+UrlEncoding["."]  = "%2E"
+UrlEncoding["/"]  = "%2F"
+UrlEncoding[":"]  = "%3A"
+UrlEncoding[";"]  = "%3B"
+UrlEncoding["<"]  = "%3C"
+UrlEncoding["="]  = "%3D"
+UrlEncoding[">"]  = "%3E"
+UrlEncoding["?"]  = "%3F"
+UrlEncoding["@"]  = "%40"
+UrlEncoding["["]  = "%5B"
+UrlEncoding["\\"] = "%5C"
+UrlEncoding["]"]  = "%5D"
+UrlEncoding["^"]  = "%5E"
+UrlEncoding["_"]  = "%5F"
+UrlEncoding["`"]  = "%60"
+UrlEncoding["{"]  = "%7B"
+UrlEncoding["|"]  = "%7C"
+UrlEncoding["}"]  = "%7D"
+UrlEncoding["~"]  = "%7E"
+}
+function quote(string,    i, r, s) {
+r = NULLSTR
+explode(string, s)
+for (i = 1; i <= length(s); i++)
+r = r (s[i] in UrlEncoding ? UrlEncoding[s[i]] : s[i])
+return r
+}
+function unquote(string,    i, k, r, s, temp) {
+r = NULLSTR
+explode(string, s)
+temp = NULLSTR
+for (i = 1; i <= length(s); i++)
+if (temp) {
+temp = temp s[i]
+if (length(temp) > 2) {
+for (k in UrlEncoding)
+if (temp == UrlEncoding[k]) {
+r = r k
+temp = NULLSTR
+break
+}
+if (temp) {
+r = r temp
+temp = NULLSTR
+}
+}
+} else {
+if (s[i] != "%")
+r = r s[i]
+else
+temp = s[i]
+}
+if (temp)
+r = r temp
+return r
+}
+function initUriSchemes() {
+UriSchemes[0] = "file://"
+UriSchemes[1] = "http://"
+UriSchemes[2] = "https://"
+}
+function readFrom(file,    line, text) {
+if (!file) file = "/dev/stdin"
+text = NULLSTR
+while (getline line < file)
+text = (text ? text "\n" : NULLSTR) line
+return text
+}
+function writeTo(text, file) {
+if (!file) file = "/dev/stdout"
+print text > file
+}
+function getOutput(command,    content, line) {
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function fileExists(file) {
+return !system("test -f " parameterize(file))
+}
+function dirExists(file) {
+return !system("test -d " parameterize(file))
+}
+function detectProgram(prog, arg, returnOutput,    temp) {
+if (returnOutput) {
+prog " " arg SUPERR | getline temp
+return temp
+} else
+return (prog " " arg SUPERR | getline) ? prog : NULLSTR
+}
+function getGitHead(    line, group) {
+if (fileExists(".git/HEAD")) {
+getline line < ".git/HEAD"
+match(line, /^ref: (.*)$/, group)
+if (fileExists(".git/" group[1])) {
+getline line < (".git/" group[1])
+return substr(line, 1, 7)
+} else
+return NULLSTR
+} else
+return NULLSTR
+}
+BEGIN {
+initConst()
+initAnsiCode()
+initUrlEncoding()
+initUriSchemes()
+}
+function initGawk(    group) {
+Gawk = "gawk"
+GawkVersion = PROCINFO["version"]
+split(PROCINFO["version"], group, ".")
+if (group[1] < 4) {
+e("[ERROR] Oops! Your gawk (version " GawkVersion ") "\
+"appears to be too old.\n"\
+"        You need at least gawk 4.0.0 to run this program.")
+exit 1
+}
+}
+function initBiDi() {
+FriBidi = detectProgram("fribidi", "--version", 1)
+BiDiNoPad = FriBidi ? "fribidi --nopad" : "rev" SUPERR
+BiDi = FriBidi ? "fribidi --width %s" :
+"rev" SUPERR "| sed \"s/'/\\\\\\'/\" | xargs printf '%%s '"
+}
+function initRlwrap() {
+Rlwrap = detectProgram("rlwrap", "--version")
+}
+function initEmacs() {
+Emacs = detectProgram("emacs", "--version")
+}
+function initCurl() {
+Curl = detectProgram("curl", "--version")
+}
+function l(value, name, inline, heredoc, valOnly, numSub, sortedIn) {
+if (Option["debug"]) {
+if (name)
+da(value, name, inline, heredoc, valOnly, numSub, sortedIn)
+else
+d(value)
+}
+}
+function m(string) {
+if (Option["debug"])
+return ansi("cyan", string) RS
+}
+function newerVersion(ver1, ver2,    i, group1, group2) {
+split(ver1, group1, ".")
+split(ver2, group2, ".")
+for (i = 1; i <= 4; i++) {
+if (group1[i] + 0 > group2[i] + 0)
+return 1
+else if (group1[i] + 0 < group2[i] + 0)
+return 0
+}
+return 0
+}
+function rlwrapMe(    i, command) {
+initRlwrap()
+if (!Rlwrap) {
+l(">> not found: rlwrap")
+return 1
+}
+if (ENVIRON["TRANS_ENTRY"]) {
+command = Rlwrap " " ENVIRON["TRANS_ENTRY"] " "\
+parameterize("-no-rlwrap")
+} else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
+command = Rlwrap " sh "\
+parameterize(ENVIRON["TRANS_DIR"] "/" EntryScript)\
+" - " parameterize("-no-rlwrap")
+} else {
+l(">> not found: $TRANS_ENTRY or EntryPoint")
+return 1
+}
+for (i = 1; i < length(ARGV); i++)
+if (ARGV[i])
+command = command " " parameterize(ARGV[i])
+l(">> forking: " command)
+if (!system(command)) {
+l(">> process exited with code 0")
+exit ExitCode
+} else {
+l(">> process exited with non-zero return code")
+return 1
+}
+}
+function emacsMe(    i, params, el, command) {
+initEmacs()
+if (!Emacs) {
+l(">> not found: emacs")
+return 1
+}
+params = ""
+for (i = 1; i < length(ARGV); i++)
+if (ARGV[i])
+params = params " " parameterize(ARGV[i], "\"")
+if (ENVIRON["TRANS_ENTRY"]) {
+el = "(progn (setq explicit-shell-file-name \"" ENVIRON["TRANS_ENTRY"] "\") "\
+"(setq explicit-" Command "-args '(\"-I\" \"-no-rlwrap\"" params ")) "\
+"(command-execute 'shell) (rename-buffer \"" Name "\"))"
+} else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
+el = "(progn (setq explicit-shell-file-name \"" "sh" "\") "\
+"(setq explicit-" "sh" "-args '(\"" ENVIRON["TRANS_DIR"] "/" EntryScript "\" \"-I\" \"-no-rlwrap\"" params ")) "\
+"(command-execute 'shell) (rename-buffer \"" Name "\"))"
+} else {
+l(">> not found: $TRANS_ENTRY or EntryPoint")
+return 1
+}
+command = Emacs " --eval " parameterize(el)
+l(">> forking: " command)
+if (!system(command)) {
+l(">> process exited with code 0")
+exit ExitCode
+} else {
+l(">> process exited with non-zero return code")
+return 1
+}
+}
+function curl(url, output,    command, content, line) {
+initCurl()
+if (!Curl) {
+l(">> not found: curl")
+w("[WARNING] curl is not found.")
+return NULLSTR
+}
+command = Curl " --location --silent"
+if (Option["proxy"])
+command = command " --proxy " parameterize(Option["proxy"])
+if (Option["user-agent"])
+command = command " --user-agent " parameterize(Option["user-agent"])
+command = command " " parameterize(url)
+if (output) {
+command = command " --output " parameterize(output)
+system(command)
+return NULLSTR
+}
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function curlPost(url, data, output,    command, content, line) {
+initCurl()
+if (!Curl) {
+l(">> not found: curl")
+w("[WARNING] curl is not found.")
+return NULLSTR
+}
+command = Curl " --location --silent"
+if (Option["proxy"])
+command = command " --proxy " parameterize(Option["proxy"])
+if (Option["user-agent"])
+command = command " --user-agent " parameterize(Option["user-agent"])
+command = command " --request POST --data " parameterize(data)
+command = command " " parameterize(url)
+if (output) {
+command = command " --output " parameterize(output)
+system(command)
+return NULLSTR
+}
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function dump(text, group,    command, temp) {
+command = "hexdump" " -v -e'1/1 \"%03u\" \" \"'"
+("echo " parameterize(text) PIPE command) | getline temp
+split(temp, group, " ")
+return length(group) - 1
+}
+function base64(text,    command, temp) {
+command = "base64"
+("echo -n " parameterize(text) PIPE command) | getline temp
+return temp
+}
+function uprintf(text,    command, temp) {
+command = "echo -en " parameterize(text)
+("bash -c " parameterize(command, "\"")) | getline temp
+return temp
+}
+function initLocale(    i) {
+Locale["af"]["name"]               = "Afrikaans"
+Locale["af"]["endonym"]            = "Afrikaans"
+Locale["af"]["translations-of"]    = "Vertalings van %s"
+Locale["af"]["definitions-of"]     = "Definisies van %s"
+Locale["af"]["synonyms"]           = "Sinonieme"
+Locale["af"]["examples"]           = "Voorbeelde"
+Locale["af"]["see-also"]           = "Sien ook"
+Locale["af"]["family"]             = "Indo-European"
+Locale["af"]["iso"]                = "afr"
+Locale["af"]["glotto"]             = "afri1274"
+Locale["af"]["script"]             = "Latn"
+Locale["sq"]["name"]               = "Albanian"
+Locale["sq"]["endonym"]            = "Shqip"
+Locale["sq"]["translations-of"]    = "Përkthimet e %s"
+Locale["sq"]["definitions-of"]     = "Përkufizime të %s"
+Locale["sq"]["synonyms"]           = "Sinonime"
+Locale["sq"]["examples"]           = "Shembuj"
+Locale["sq"]["see-also"]           = "Shihni gjithashtu"
+Locale["sq"]["family"]             = "Indo-European"
+Locale["sq"]["iso"]                = "sqi"
+Locale["sq"]["glotto"]             = "alba1267"
+Locale["sq"]["script"]             = "Latn"
+Locale["am"]["name"]               = "Amharic"
+Locale["am"]["endonym"]            = "አማርኛ"
+Locale["am"]["translations-of"]    = "የ %s ትርጉሞች"
+Locale["am"]["definitions-of"]     = "የ %s ቃላት ፍችዎች"
+Locale["am"]["synonyms"]           = "ተመሳሳይ ቃላት"
+Locale["am"]["examples"]           = "ምሳሌዎች"
+Locale["am"]["see-also"]           = "የሚከተለውንም ይመልከቱ"
+Locale["am"]["family"]             = "Afro-Asiatic"
+Locale["am"]["iso"]                = "amh"
+Locale["am"]["glotto"]             = "amha1245"
+Locale["am"]["script"]             = "Ethi"
+Locale["ar"]["name"]               = "Arabic"
+Locale["ar"]["endonym"]            = "العربية"
+Locale["ar"]["translations-of"]    = "ترجمات %s"
+Locale["ar"]["definitions-of"]     = "تعريفات %s"
+Locale["ar"]["synonyms"]           = "مرادفات"
+Locale["ar"]["examples"]           = "أمثلة"
+Locale["ar"]["see-also"]           = "انظر أيضًا"
+Locale["ar"]["family"]             = "Afro-Asiatic"
+Locale["ar"]["iso"]                = "ara"
+Locale["ar"]["glotto"]             = "stan1318"
+Locale["ar"]["script"]             = "Arab"
+Locale["ar"]["rtl"]                = "true"
+Locale["hy"]["name"]               = "Armenian"
+Locale["hy"]["endonym"]            = "Հայերեն"
+Locale["hy"]["translations-of"]    = "%s-ի թարգմանությունները"
+Locale["hy"]["definitions-of"]     = "%s-ի սահմանումները"
+Locale["hy"]["synonyms"]           = "Հոմանիշներ"
+Locale["hy"]["examples"]           = "Օրինակներ"
+Locale["hy"]["see-also"]           = "Տես նաև"
+Locale["hy"]["family"]             = "Indo-European"
+Locale["hy"]["iso"]                = "hye"
+Locale["hy"]["glotto"]             = "nucl1235"
+Locale["hy"]["script"]             = "Armn"
+Locale["az"]["name"]               = "Azerbaijani"
+Locale["az"]["endonym"]            = "Azərbaycanca"
+Locale["az"]["translations-of"]    = "%s sözünün tərcüməsi"
+Locale["az"]["definitions-of"]     = "%s sözünün tərifləri"
+Locale["az"]["synonyms"]           = "Sinonimlər"
+Locale["az"]["examples"]           = "Nümunələr"
+Locale["az"]["see-also"]           = "Həmçinin, baxın:"
+Locale["az"]["family"]             = "Turkic"
+Locale["az"]["iso"]                = "aze"
+Locale["az"]["glotto"]             = "nort2697"
+Locale["az"]["script"]             = "Latn"
+Locale["eu"]["name"]               = "Basque"
+Locale["eu"]["endonym"]            = "Euskara"
+Locale["eu"]["translations-of"]    = "%s esapidearen itzulpena"
+Locale["eu"]["definitions-of"]     = "Honen definizioak: %s"
+Locale["eu"]["synonyms"]           = "Sinonimoak"
+Locale["eu"]["examples"]           = "Adibideak"
+Locale["eu"]["see-also"]           = "Ikusi hauek ere"
+Locale["eu"]["family"]             = "Language Isolate"
+Locale["eu"]["iso"]                = "eus"
+Locale["eu"]["glotto"]             = "basq1248"
+Locale["eu"]["script"]             = "Latn"
+Locale["be"]["name"]               = "Belarusian"
+Locale["be"]["endonym"]            = "беларуская"
+Locale["be"]["translations-of"]    = "Пераклады %s"
+Locale["be"]["definitions-of"]     = "Вызначэннi %s"
+Locale["be"]["synonyms"]           = "Сінонімы"
+Locale["be"]["examples"]           = "Прыклады"
+Locale["be"]["see-also"]           = "Гл. таксама"
+Locale["be"]["family"]             = "Indo-European"
+Locale["be"]["iso"]                = "bel"
+Locale["be"]["glotto"]             = "bela1254"
+Locale["be"]["script"]             = "Cyrl"
+Locale["bn"]["name"]               = "Bengali"
+Locale["bn"]["endonym"]            = "বাংলা"
+Locale["bn"]["translations-of"]    = "%s এর অনুবাদ"
+Locale["bn"]["definitions-of"]     = "%s এর সংজ্ঞা"
+Locale["bn"]["synonyms"]           = "প্রতিশব্দ"
+Locale["bn"]["examples"]           = "উদাহরণ"
+Locale["bn"]["see-also"]           = "আরো দেখুন"
+Locale["bn"]["family"]             = "Indo-European"
+Locale["bn"]["iso"]                = "ben"
+Locale["bn"]["glotto"]             = "beng1280"
+Locale["bn"]["script"]             = "Beng"
+Locale["bs"]["name"]               = "Bosnian"
+Locale["bs"]["endonym"]            = "Bosanski"
+Locale["bs"]["translations-of"]    = "Prijevod za: %s"
+Locale["bs"]["definitions-of"]     = "Definicije za %s"
+Locale["bs"]["synonyms"]           = "Sinonimi"
+Locale["bs"]["examples"]           = "Primjeri"
+Locale["bs"]["see-also"]           = "Pogledajte i"
+Locale["bs"]["family"]             = "Indo-European"
+Locale["bs"]["iso"]                = "bos"
+Locale["bs"]["glotto"]             = "bosn1245"
+Locale["bs"]["script"]             = "Latn"
+Locale["bg"]["name"]               = "Bulgarian"
+Locale["bg"]["endonym"]            = "български"
+Locale["bg"]["translations-of"]    = "Преводи на %s"
+Locale["bg"]["definitions-of"]     = "Дефиниции за %s"
+Locale["bg"]["synonyms"]           = "Синоними"
+Locale["bg"]["examples"]           = "Примери"
+Locale["bg"]["see-also"]           = "Вижте също"
+Locale["bg"]["family"]             = "Indo-European"
+Locale["bg"]["iso"]                = "bul"
+Locale["bg"]["glotto"]             = "bulg1262"
+Locale["bg"]["script"]             = "Cyrl"
+Locale["ca"]["name"]               = "Catalan"
+Locale["ca"]["endonym"]            = "Català"
+Locale["ca"]["translations-of"]    = "Traduccions per a %s"
+Locale["ca"]["definitions-of"]     = "Definicions de: %s"
+Locale["ca"]["synonyms"]           = "Sinònims"
+Locale["ca"]["examples"]           = "Exemples"
+Locale["ca"]["see-also"]           = "Vegeu també"
+Locale["ca"]["family"]             = "Indo-European"
+Locale["ca"]["iso"]                = "cat"
+Locale["ca"]["glotto"]             = "stan1289"
+Locale["ca"]["script"]             = "Latn"
+Locale["ceb"]["name"]              = "Cebuano"
+Locale["ceb"]["endonym"]           = "Cebuano"
+Locale["ceb"]["translations-of"]   = "%s Mga Paghubad sa PULONG_O_HUGPONG SA PAMULONG"
+Locale["ceb"]["definitions-of"]    = "Mga kahulugan sa %s"
+Locale["ceb"]["synonyms"]          = "Mga Kapulong"
+Locale["ceb"]["examples"]          = "Mga pananglitan:"
+Locale["ceb"]["see-also"]          = "Kitaa pag-usab"
+Locale["ceb"]["family"]            = "Austronesian"
+Locale["ceb"]["iso"]               = "ceb"
+Locale["ceb"]["glotto"]            = "cebu1242"
+Locale["ceb"]["script"]            = "Latn"
+Locale["ny"]["name"]               = "Chichewa"
+Locale["ny"]["endonym"]            = "Nyanja"
+Locale["ny"]["translations-of"]    = "Matanthauzidwe a %s"
+Locale["ny"]["definitions-of"]     = "Mamasulidwe a %s"
+Locale["ny"]["synonyms"]           = "Mau ofanana"
+Locale["ny"]["examples"]           = "Zitsanzo"
+Locale["ny"]["see-also"]           = "Onaninso"
+Locale["ny"]["family"]             = "Atlantic-Congo"
+Locale["ny"]["iso"]                = "nya"
+Locale["ny"]["glotto"]             = "nyan1308"
+Locale["ny"]["script"]             = "Latn"
+Locale["zh-CN"]["name"]            = "Chinese Simplified"
+Locale["zh-CN"]["endonym"]         = "简体中文"
+Locale["zh-CN"]["translations-of"] = "%s 的翻译"
+Locale["zh-CN"]["definitions-of"]  = "%s的定义"
+Locale["zh-CN"]["synonyms"]        = "同义词"
+Locale["zh-CN"]["examples"]        = "示例"
+Locale["zh-CN"]["see-also"]        = "另请参阅"
+Locale["zh-CN"]["family"]          = "Sino-Tibetan"
+Locale["zh-CN"]["iso"]             = "zho-CN"
+Locale["zh-CN"]["glotto"]          = "mand1415"
+Locale["zh-CN"]["script"]          = "Hans"
+Locale["zh-CN"]["dictionary"]      = "true"
+Locale["zh-TW"]["name"]            = "Chinese Traditional"
+Locale["zh-TW"]["endonym"]         = "正體中文"
+Locale["zh-TW"]["translations-of"] = "「%s」的翻譯"
+Locale["zh-TW"]["definitions-of"]  = "「%s」的定義"
+Locale["zh-TW"]["synonyms"]        = "同義詞"
+Locale["zh-TW"]["examples"]        = "例句"
+Locale["zh-TW"]["see-also"]        = "另請參閱"
+Locale["zh-TW"]["family"]          = "Sino-Tibetan"
+Locale["zh-TW"]["iso"]             = "zho-TW"
+Locale["zh-TW"]["glotto"]          = "mand1415"
+Locale["zh-TW"]["script"]          = "Hant"
+Locale["zh-TW"]["dictionary"]      = "true"
+Locale["co"]["name"]               = "Corsican"
+Locale["co"]["endonym"]            = "Corsu"
+Locale["co"]["translations-of"]    = "Traductions de %s"
+Locale["co"]["definitions-of"]     = "Définitions de %s"
+Locale["co"]["synonyms"]           = "Synonymes"
+Locale["co"]["examples"]           = "Exemples"
+Locale["co"]["see-also"]           = "Voir aussi"
+Locale["co"]["family"]             = "Indo-European"
+Locale["co"]["iso"]                = "cos"
+Locale["co"]["glotto"]             = "cors1242"
+Locale["co"]["script"]             = "Latn"
+Locale["hr"]["name"]               = "Croatian"
+Locale["hr"]["endonym"]            = "Hrvatski"
+Locale["hr"]["translations-of"]    = "Prijevodi riječi ili izraza %s"
+Locale["hr"]["definitions-of"]     = "Definicije riječi ili izraza %s"
+Locale["hr"]["synonyms"]           = "Sinonimi"
+Locale["hr"]["examples"]           = "Primjeri"
+Locale["hr"]["see-also"]           = "Također pogledajte"
+Locale["hr"]["family"]             = "Indo-European"
+Locale["hr"]["iso"]                = "hrv"
+Locale["hr"]["glotto"]             = "croa1245"
+Locale["hr"]["script"]             = "Latn"
+Locale["cs"]["name"]               = "Czech"
+Locale["cs"]["endonym"]            = "Čeština"
+Locale["cs"]["translations-of"]    = "Překlad výrazu %s"
+Locale["cs"]["definitions-of"]     = "Definice výrazu %s"
+Locale["cs"]["synonyms"]           = "Synonyma"
+Locale["cs"]["examples"]           = "Příklady"
+Locale["cs"]["see-also"]           = "Viz také"
+Locale["cs"]["family"]             = "Indo-European"
+Locale["cs"]["iso"]                = "ces"
+Locale["cs"]["glotto"]             = "czec1258"
+Locale["cs"]["script"]             = "Latn"
+Locale["da"]["name"]               = "Danish"
+Locale["da"]["endonym"]            = "Dansk"
+Locale["da"]["translations-of"]    = "Oversættelser af %s"
+Locale["da"]["definitions-of"]     = "Definitioner af %s"
+Locale["da"]["synonyms"]           = "Synonymer"
+Locale["da"]["examples"]           = "Eksempler"
+Locale["da"]["see-also"]           = "Se også"
+Locale["da"]["family"]             = "Indo-European"
+Locale["da"]["iso"]                = "dan"
+Locale["da"]["glotto"]             = "dani1285"
+Locale["da"]["script"]             = "Latn"
+Locale["nl"]["name"]               = "Dutch"
+Locale["nl"]["endonym"]            = "Nederlands"
+Locale["nl"]["translations-of"]    = "Vertalingen van %s"
+Locale["nl"]["definitions-of"]     = "Definities van %s"
+Locale["nl"]["synonyms"]           = "Synoniemen"
+Locale["nl"]["examples"]           = "Voorbeelden"
+Locale["nl"]["see-also"]           = "Zie ook"
+Locale["nl"]["family"]             = "Indo-European"
+Locale["nl"]["iso"]                = "nld"
+Locale["nl"]["glotto"]             = "dutc1256"
+Locale["nl"]["script"]             = "Latn"
+Locale["nl"]["dictionary"]         = "true"
+Locale["en"]["name"]               = "English"
+Locale["en"]["endonym"]            = "English"
+Locale["en"]["translations-of"]    = "Translations of %s"
+Locale["en"]["definitions-of"]     = "Definitions of %s"
+Locale["en"]["synonyms"]           = "Synonyms"
+Locale["en"]["examples"]           = "Examples"
+Locale["en"]["see-also"]           = "See also"
+Locale["en"]["family"]             = "Indo-European"
+Locale["en"]["iso"]                = "eng"
+Locale["en"]["glotto"]             = "stan1293"
+Locale["en"]["script"]             = "Latn"
+Locale["en"]["dictionary"]         = "true"
+Locale["eo"]["name"]               = "Esperanto"
+Locale["eo"]["endonym"]            = "Esperanto"
+Locale["eo"]["translations-of"]    = "Tradukoj de %s"
+Locale["eo"]["definitions-of"]     = "Difinoj de %s"
+Locale["eo"]["synonyms"]           = "Sinonimoj"
+Locale["eo"]["examples"]           = "Ekzemploj"
+Locale["eo"]["see-also"]           = "Vidu ankaŭ"
+Locale["eo"]["family"]             = "Artificial Language"
+Locale["eo"]["iso"]                = "epo"
+Locale["eo"]["glotto"]             = "espe1235"
+Locale["eo"]["script"]             = "Latn"
+Locale["et"]["name"]               = "Estonian"
+Locale["et"]["endonym"]            = "Eesti"
+Locale["et"]["translations-of"]    = "Sõna(de) %s tõlked"
+Locale["et"]["definitions-of"]     = "Sõna(de) %s definitsioonid"
+Locale["et"]["synonyms"]           = "Sünonüümid"
+Locale["et"]["examples"]           = "Näited"
+Locale["et"]["see-also"]           = "Vt ka"
+Locale["et"]["family"]             = "Uralic"
+Locale["et"]["iso"]                = "est"
+Locale["et"]["glotto"]             = "esto1258"
+Locale["et"]["script"]             = "Latn"
+Locale["tl"]["name"]               = "Filipino"
+Locale["tl"]["endonym"]            = "Tagalog"
+Locale["tl"]["translations-of"]    = "Mga pagsasalin ng %s"
+Locale["tl"]["definitions-of"]     = "Mga kahulugan ng %s"
+Locale["tl"]["synonyms"]           = "Mga Kasingkahulugan"
+Locale["tl"]["examples"]           = "Mga Halimbawa"
+Locale["tl"]["see-also"]           = "Tingnan rin ang"
+Locale["tl"]["family"]             = "Austronesian"
+Locale["tl"]["iso"]                = "tgl"
+Locale["tl"]["glotto"]             = "taga1270"
+Locale["tl"]["script"]             = "Latn"
+Locale["fi"]["name"]               = "Finnish"
+Locale["fi"]["endonym"]            = "Suomi"
+Locale["fi"]["translations-of"]    = "Käännökset tekstille %s"
+Locale["fi"]["definitions-of"]     = "Määritelmät kohteelle %s"
+Locale["fi"]["synonyms"]           = "Synonyymit"
+Locale["fi"]["examples"]           = "Esimerkkejä"
+Locale["fi"]["see-also"]           = "Katso myös"
+Locale["fi"]["family"]             = "Uralic"
+Locale["fi"]["iso"]                = "fin"
+Locale["fi"]["glotto"]             = "finn1318"
+Locale["fi"]["script"]             = "Latn"
+Locale["fr"]["name"]               = "French"
+Locale["fr"]["endonym"]            = "Français"
+Locale["fr"]["translations-of"]    = "Traductions de %s"
+Locale["fr"]["definitions-of"]     = "Définitions de %s"
+Locale["fr"]["synonyms"]           = "Synonymes"
+Locale["fr"]["examples"]           = "Exemples"
+Locale["fr"]["see-also"]           = "Voir aussi"
+Locale["fr"]["family"]             = "Indo-European"
+Locale["fr"]["iso"]                = "fra"
+Locale["fr"]["glotto"]             = "stan1290"
+Locale["fr"]["script"]             = "Latn"
+Locale["fr"]["dictionary"]         = "true"
+Locale["gl"]["name"]               = "Galician"
+Locale["gl"]["endonym"]            = "Galego"
+Locale["gl"]["translations-of"]    = "Traducións de %s"
+Locale["gl"]["definitions-of"]     = "Definicións de %s"
+Locale["gl"]["synonyms"]           = "Sinónimos"
+Locale["gl"]["examples"]           = "Exemplos"
+Locale["gl"]["see-also"]           = "Ver tamén"
+Locale["gl"]["family"]             = "Indo-European"
+Locale["gl"]["iso"]                = "glg"
+Locale["gl"]["glotto"]             = "gali1258"
+Locale["gl"]["script"]             = "Latn"
+Locale["ka"]["name"]               = "Georgian"
+Locale["ka"]["endonym"]            = "ქართული"
+Locale["ka"]["translations-of"]    = "%s-ის თარგმანები"
+Locale["ka"]["definitions-of"]     = "%s-ის განსაზღვრებები"
+Locale["ka"]["synonyms"]           = "სინონიმები"
+Locale["ka"]["examples"]           = "მაგალითები"
+Locale["ka"]["see-also"]           = "ასევე იხილეთ"
+Locale["ka"]["family"]             = "Kartvelian"
+Locale["ka"]["iso"]                = "kat"
+Locale["ka"]["glotto"]             = "nucl1302"
+Locale["ka"]["script"]             = "Geor"
+Locale["de"]["name"]               = "German"
+Locale["de"]["endonym"]            = "Deutsch"
+Locale["de"]["translations-of"]    = "Übersetzungen für %s"
+Locale["de"]["definitions-of"]     = "Definitionen von %s"
+Locale["de"]["synonyms"]           = "Synonyme"
+Locale["de"]["examples"]           = "Beispiele"
+Locale["de"]["see-also"]           = "Siehe auch"
+Locale["de"]["family"]             = "Indo-European"
+Locale["de"]["iso"]                = "deu"
+Locale["de"]["glotto"]             = "stan1295"
+Locale["de"]["script"]             = "Latn"
+Locale["de"]["dictionary"]         = "true"
+Locale["el"]["name"]               = "Greek"
+Locale["el"]["endonym"]            = "Ελληνικά"
+Locale["el"]["translations-of"]    = "Μεταφράσεις του %s"
+Locale["el"]["definitions-of"]     = "Όρισμοί %s"
+Locale["el"]["synonyms"]           = "Συνώνυμα"
+Locale["el"]["examples"]           = "Παραδείγματα"
+Locale["el"]["see-also"]           = "Δείτε επίσης"
+Locale["el"]["family"]             = "Indo-European"
+Locale["el"]["iso"]                = "ell"
+Locale["el"]["glotto"]             = "mode1248"
+Locale["el"]["script"]             = "Grek"
+Locale["gu"]["name"]               = "Gujarati"
+Locale["gu"]["endonym"]            = "ગુજરાતી"
+Locale["gu"]["translations-of"]    = "%s ના અનુવાદ"
+Locale["gu"]["definitions-of"]     = "%s ની વ્યાખ્યાઓ"
+Locale["gu"]["synonyms"]           = "સમાનાર્થી"
+Locale["gu"]["examples"]           = "ઉદાહરણો"
+Locale["gu"]["see-also"]           = "આ પણ જુઓ"
+Locale["gu"]["family"]             = "Indo-European"
+Locale["gu"]["iso"]                = "guj"
+Locale["gu"]["glotto"]             = "guja1252"
+Locale["gu"]["script"]             = "Gujr"
+Locale["ht"]["name"]               = "Haitian Creole"
+Locale["ht"]["endonym"]            = "Kreyòl Ayisyen"
+Locale["ht"]["translations-of"]    = "Tradiksyon %s"
+Locale["ht"]["definitions-of"]     = "Definisyon nan %s"
+Locale["ht"]["synonyms"]           = "Sinonim"
+Locale["ht"]["examples"]           = "Egzanp:"
+Locale["ht"]["see-also"]           = "Wè tou"
+Locale["ht"]["family"]             = "Indo-European"
+Locale["ht"]["iso"]                = "hat"
+Locale["ht"]["glotto"]             = "hait1244"
+Locale["ht"]["script"]             = "Latn"
+Locale["haw"]["name"]              = "Hawaiian"
+Locale["haw"]["endonym"]           = "ʻŌlelo Hawaiʻi"
+Locale["haw"]["family"]            = "Austronesian"
+Locale["haw"]["iso"]               = "haw"
+Locale["haw"]["glotto"]            = "hawa1245"
+Locale["haw"]["script"]            = "Latn"
+Locale["ha"]["name"]               = "Hausa"
+Locale["ha"]["endonym"]            = "Hausa"
+Locale["ha"]["translations-of"]    = "Fassarar %s"
+Locale["ha"]["definitions-of"]     = "Ma'anoni na %s"
+Locale["ha"]["synonyms"]           = "Masu kamancin ma'ana"
+Locale["ha"]["examples"]           = "Misalai"
+Locale["ha"]["see-also"]           = "Duba kuma"
+Locale["ha"]["family"]             = "Afro-Asiatic"
+Locale["ha"]["iso"]                = "hau"
+Locale["ha"]["glotto"]             = "haus1257"
+Locale["ha"]["script"]             = "Latn"
+Locale["he"]["name"]               = "Hebrew"
+Locale["he"]["endonym"]            = "עִבְרִית"
+Locale["he"]["translations-of"]    = "תרגומים של %s"
+Locale["he"]["definitions-of"]     = "הגדרות של %s"
+Locale["he"]["synonyms"]           = "מילים נרדפות"
+Locale["he"]["examples"]           = "דוגמאות"
+Locale["he"]["see-also"]           = "ראה גם"
+Locale["he"]["family"]             = "Afro-Asiatic"
+Locale["he"]["iso"]                = "heb"
+Locale["he"]["glotto"]             = "hebr1245"
+Locale["he"]["script"]             = "Hebr"
+Locale["he"]["rtl"]                = "true"
+Locale["hi"]["name"]               = "Hindi"
+Locale["hi"]["endonym"]            = "हिन्दी"
+Locale["hi"]["translations-of"]    = "%s के अनुवाद"
+Locale["hi"]["definitions-of"]     = "%s की परिभाषाएं"
+Locale["hi"]["synonyms"]           = "समानार्थी"
+Locale["hi"]["examples"]           = "उदाहरण"
+Locale["hi"]["see-also"]           = "यह भी देखें"
+Locale["hi"]["family"]             = "Indo-European"
+Locale["hi"]["iso"]                = "hin"
+Locale["hi"]["glotto"]             = "hind1269"
+Locale["hi"]["script"]             = "Deva"
+Locale["hmn"]["name"]              = "Hmong"
+Locale["hmn"]["endonym"]           = "Hmoob"
+Locale["hmn"]["translations-of"]   = "Lus txhais: %s"
+Locale["hmn"]["family"]            = "Hmong-Mien"
+Locale["hmn"]["iso"]               = "hmn"
+Locale["hmn"]["glotto"]            = "firs1234"
+Locale["hmn"]["script"]            = "Latn"
+Locale["hu"]["name"]               = "Hungarian"
+Locale["hu"]["endonym"]            = "Magyar"
+Locale["hu"]["translations-of"]    = "%s fordításai"
+Locale["hu"]["definitions-of"]     = "%s jelentései"
+Locale["hu"]["synonyms"]           = "Szinonimák"
+Locale["hu"]["examples"]           = "Példák"
+Locale["hu"]["see-also"]           = "Lásd még"
+Locale["hu"]["family"]             = "Uralic"
+Locale["hu"]["iso"]                = "hun"
+Locale["hu"]["glotto"]             = "hung1274"
+Locale["hu"]["script"]             = "Latn"
+Locale["is"]["name"]               = "Icelandic"
+Locale["is"]["endonym"]            = "Íslenska"
+Locale["is"]["translations-of"]    = "Þýðingar á %s"
+Locale["is"]["definitions-of"]     = "Skilgreiningar á"
+Locale["is"]["synonyms"]           = "Samheiti"
+Locale["is"]["examples"]           = "Dæmi"
+Locale["is"]["see-also"]           = "Sjá einnig"
+Locale["is"]["family"]             = "Indo-European"
+Locale["is"]["iso"]                = "isl"
+Locale["is"]["glotto"]             = "icel1247"
+Locale["is"]["script"]             = "Latn"
+Locale["ig"]["name"]               = "Igbo"
+Locale["ig"]["endonym"]            = "Igbo"
+Locale["ig"]["translations-of"]    = "Ntụgharị asụsụ nke %s"
+Locale["ig"]["definitions-of"]     = "Nkọwapụta nke %s"
+Locale["ig"]["synonyms"]           = "Okwu oyiri"
+Locale["ig"]["examples"]           = "Ọmụmaatụ"
+Locale["ig"]["see-also"]           = "Hụkwuo"
+Locale["ig"]["family"]             = "Atlantic-Congo"
+Locale["ig"]["iso"]                = "ibo"
+Locale["ig"]["glotto"]             = "nucl1417"
+Locale["ig"]["script"]             = "Latn"
+Locale["id"]["name"]               = "Indonesian"
+Locale["id"]["endonym"]            = "Bahasa Indonesia"
+Locale["id"]["translations-of"]    = "Terjemahan dari %s"
+Locale["id"]["definitions-of"]     = "Definisi %s"
+Locale["id"]["synonyms"]           = "Sinonim"
+Locale["id"]["examples"]           = "Contoh"
+Locale["id"]["see-also"]           = "Lihat juga"
+Locale["id"]["family"]             = "Austronesian"
+Locale["id"]["iso"]                = "ind"
+Locale["id"]["glotto"]             = "indo1316"
+Locale["id"]["script"]             = "Latn"
+Locale["ga"]["name"]               = "Irish"
+Locale["ga"]["endonym"]            = "Gaeilge"
+Locale["ga"]["translations-of"]    = "Aistriúcháin ar %s"
+Locale["ga"]["definitions-of"]     = "Sainmhínithe ar %s"
+Locale["ga"]["synonyms"]           = "Comhchiallaigh"
+Locale["ga"]["examples"]           = "Samplaí"
+Locale["ga"]["see-also"]           = "féach freisin"
+Locale["ga"]["family"]             = "Indo-European"
+Locale["ga"]["iso"]                = "gle"
+Locale["ga"]["glotto"]             = "iris1253"
+Locale["ga"]["script"]             = "Latn"
+Locale["it"]["name"]               = "Italian"
+Locale["it"]["endonym"]            = "Italiano"
+Locale["it"]["translations-of"]    = "Traduzioni di %s"
+Locale["it"]["definitions-of"]     = "Definizioni di %s"
+Locale["it"]["synonyms"]           = "Sinonimi"
+Locale["it"]["examples"]           = "Esempi"
+Locale["it"]["see-also"]           = "Vedi anche"
+Locale["it"]["family"]             = "Indo-European"
+Locale["it"]["iso"]                = "ita"
+Locale["it"]["glotto"]             = "ital1282"
+Locale["it"]["script"]             = "Latn"
+Locale["it"]["dictionary"]         = "true"
+Locale["ja"]["name"]               = "Japanese"
+Locale["ja"]["endonym"]            = "日本語"
+Locale["ja"]["translations-of"]    = "「%s」の翻訳"
+Locale["ja"]["definitions-of"]     = "%s の定義"
+Locale["ja"]["synonyms"]           = "同義語"
+Locale["ja"]["examples"]           = "例"
+Locale["ja"]["see-also"]           = "関連項目"
+Locale["ja"]["family"]             = "Japonic"
+Locale["ja"]["iso"]                = "jpn"
+Locale["ja"]["glotto"]             = "nucl1643"
+Locale["ja"]["script"]             = "Jpan"
+Locale["ja"]["dictionary"]         = "true"
+Locale["jv"]["name"]               = "Javanese"
+Locale["jv"]["endonym"]            = "Basa Jawa"
+Locale["jv"]["translations-of"]    = "Terjemahan %s"
+Locale["jv"]["definitions-of"]     = "Arti %s"
+Locale["jv"]["synonyms"]           = "Sinonim"
+Locale["jv"]["examples"]           = "Conto"
+Locale["jv"]["see-also"]           = "Deleng uga"
+Locale["jv"]["family"]             = "Austronesian"
+Locale["jv"]["iso"]                = "jav"
+Locale["jv"]["glotto"]             = "java1254"
+Locale["jv"]["script"]             = "Latn"
+Locale["kn"]["name"]               = "Kannada"
+Locale["kn"]["endonym"]            = "ಕನ್ನಡ"
+Locale["kn"]["translations-of"]    = "%s ನ ಅನುವಾದಗಳು"
+Locale["kn"]["definitions-of"]     = "%s ನ ವ್ಯಾಖ್ಯಾನಗಳು"
+Locale["kn"]["synonyms"]           = "ಸಮಾನಾರ್ಥಕಗಳು"
+Locale["kn"]["examples"]           = "ಉದಾಹರಣೆಗಳು"
+Locale["kn"]["see-also"]           = "ಇದನ್ನೂ ಗಮನಿಸಿ"
+Locale["kn"]["family"]             = "Dravidian"
+Locale["kn"]["iso"]                = "kan"
+Locale["kn"]["glotto"]             = "nucl1305"
+Locale["kn"]["script"]             = "Knda"
+Locale["kk"]["name"]               = "Kazakh"
+Locale["kk"]["endonym"]            = "Қазақ тілі"
+Locale["kk"]["translations-of"]    = "%s аудармалары"
+Locale["kk"]["definitions-of"]     = "%s анықтамалары"
+Locale["kk"]["synonyms"]           = "Синонимдер"
+Locale["kk"]["examples"]           = "Мысалдар"
+Locale["kk"]["see-also"]           = "Келесі тізімді де көріңіз:"
+Locale["kk"]["family"]             = "Turkic"
+Locale["kk"]["iso"]                = "kaz"
+Locale["kk"]["glotto"]             = "kaza1248"
+Locale["kk"]["script"]             = "Cyrl"
+Locale["km"]["name"]               = "Khmer"
+Locale["km"]["endonym"]            = "ភាសាខ្មែរ"
+Locale["km"]["translations-of"]    = "ការ​បក​ប្រែ​នៃ %s"
+Locale["km"]["definitions-of"]     = "និយមន័យ​នៃ​ %s"
+Locale["km"]["synonyms"]           = "សទិសន័យ"
+Locale["km"]["examples"]           = "ឧទាហរណ៍"
+Locale["km"]["see-also"]           = "មើល​ផង​ដែរ"
+Locale["km"]["family"]             = "Austroasiatic"
+Locale["km"]["iso"]                = "khm"
+Locale["km"]["glotto"]             = "cent1989"
+Locale["km"]["script"]             = "Khmr"
+Locale["ko"]["name"]               = "Korean"
+Locale["ko"]["endonym"]            = "한국어"
+Locale["ko"]["translations-of"]    = "%s의 번역"
+Locale["ko"]["definitions-of"]     = "%s의 정의"
+Locale["ko"]["synonyms"]           = "동의어"
+Locale["ko"]["examples"]           = "예문"
+Locale["ko"]["see-also"]           = "참조"
+Locale["ko"]["family"]             = "Koreanic"
+Locale["ko"]["iso"]                = "kor"
+Locale["ko"]["glotto"]             = "kore1280"
+Locale["ko"]["script"]             = "Kore"
+Locale["ko"]["dictionary"]         = "true"
+Locale["ku"]["name"]               = "Kurdish"
+Locale["ku"]["endonym"]            = "Kurdî"
+Locale["ku"]["family"]             = "Indo-European"
+Locale["ku"]["iso"]                = "kur"
+Locale["ku"]["glotto"]             = "kurd1259"
+Locale["ku"]["script"]             = "Latn"
+Locale["ky"]["name"]               = "Kyrgyz"
+Locale["ky"]["endonym"]            = "Кыргызча"
+Locale["ky"]["translations-of"]    = "%s котормосу"
+Locale["ky"]["definitions-of"]     = "%s аныктамасы"
+Locale["ky"]["synonyms"]           = "Синонимдер"
+Locale["ky"]["examples"]           = "Мисалдар"
+Locale["ky"]["see-also"]           = "Дагы караңыз"
+Locale["ky"]["family"]             = "Turkic"
+Locale["ky"]["iso"]                = "kir"
+Locale["ky"]["glotto"]             = "kirg1245"
+Locale["ky"]["script"]             = "Cyrl"
+Locale["lo"]["name"]               = "Lao"
+Locale["lo"]["endonym"]            = "ລາວ"
+Locale["lo"]["translations-of"]    = "ຄຳ​ແປ​ສຳລັບ %s"
+Locale["lo"]["definitions-of"]     = "ຄວາມໝາຍຂອງ %s"
+Locale["lo"]["synonyms"]           = "ຄຳທີ່ຄ້າຍກັນ %s"
+Locale["lo"]["examples"]           = "ຕົວຢ່າງ"
+Locale["lo"]["see-also"]           = "ເບິ່ງ​ເພີ່ມ​ເຕີມ"
+Locale["lo"]["family"]             = "Tai-Kadai"
+Locale["lo"]["iso"]                = "lao"
+Locale["lo"]["glotto"]             = "laoo1244"
+Locale["lo"]["script"]             = "Laoo"
+Locale["la"]["name"]               = "Latin"
+Locale["la"]["endonym"]            = "Latina"
+Locale["la"]["translations-of"]    = "Versio de %s"
+Locale["la"]["family"]             = "Indo-European"
+Locale["la"]["iso"]                = "lat"
+Locale["la"]["glotto"]             = "lati1261"
+Locale["la"]["script"]             = "Latn"
+Locale["lv"]["name"]               = "Latvian"
+Locale["lv"]["endonym"]            = "Latviešu"
+Locale["lv"]["translations-of"]    = "%s tulkojumi"
+Locale["lv"]["definitions-of"]     = "%s definīcijas"
+Locale["lv"]["synonyms"]           = "Sinonīmi"
+Locale["lv"]["examples"]           = "Piemēri"
+Locale["lv"]["see-also"]           = "Skatiet arī"
+Locale["lv"]["family"]             = "Indo-European"
+Locale["lv"]["iso"]                = "lav"
+Locale["lv"]["glotto"]             = "latv1249"
+Locale["lv"]["script"]             = "Latn"
+Locale["lt"]["name"]               = "Lithuanian"
+Locale["lt"]["endonym"]            = "Lietuvių"
+Locale["lt"]["translations-of"]    = "„%s“ vertimai"
+Locale["lt"]["definitions-of"]     = "„%s“ apibrėžimai"
+Locale["lt"]["synonyms"]           = "Sinonimai"
+Locale["lt"]["examples"]           = "Pavyzdžiai"
+Locale["lt"]["see-also"]           = "Taip pat žiūrėkite"
+Locale["lt"]["family"]             = "Indo-European"
+Locale["lt"]["iso"]                = "lit"
+Locale["lt"]["glotto"]             = "lith1251"
+Locale["lt"]["script"]             = "Latn"
+Locale["lb"]["name"]               = "Luxembourgish"
+Locale["lb"]["endonym"]            = "Lëtzebuergesch"
+Locale["lb"]["family"]             = "Indo-European"
+Locale["lb"]["iso"]                = "ltz"
+Locale["lb"]["glotto"]             = "luxe1241"
+Locale["lb"]["script"]             = "Latn"
+Locale["mk"]["name"]               = "Macedonian"
+Locale["mk"]["endonym"]            = "Македонски"
+Locale["mk"]["translations-of"]    = "Преводи на %s"
+Locale["mk"]["definitions-of"]     = "Дефиниции на %s"
+Locale["mk"]["synonyms"]           = "Синоними"
+Locale["mk"]["examples"]           = "Примери"
+Locale["mk"]["see-also"]           = "Види и"
+Locale["mk"]["family"]             = "Indo-European"
+Locale["mk"]["iso"]                = "mkd"
+Locale["mk"]["glotto"]             = "mace1250"
+Locale["mk"]["script"]             = "Cyrl"
+Locale["mg"]["name"]               = "Malagasy"
+Locale["mg"]["endonym"]            = "Malagasy"
+Locale["mg"]["translations-of"]    = "Dikan'ny %s"
+Locale["mg"]["definitions-of"]     = "Famaritana ny %s"
+Locale["mg"]["synonyms"]           = "Mitovy hevitra"
+Locale["mg"]["examples"]           = "Ohatra"
+Locale["mg"]["see-also"]           = "Jereo ihany koa"
+Locale["mg"]["family"]             = "Austronesian"
+Locale["mg"]["iso"]                = "mlg"
+Locale["mg"]["glotto"]             = "plat1254"
+Locale["mg"]["script"]             = "Latn"
+Locale["ms"]["name"]               = "Malay"
+Locale["ms"]["endonym"]            = "Bahasa Melayu"
+Locale["ms"]["translations-of"]    = "Terjemahan %s"
+Locale["ms"]["definitions-of"]     = "Takrif %s"
+Locale["ms"]["synonyms"]           = "Sinonim"
+Locale["ms"]["examples"]           = "Contoh"
+Locale["ms"]["see-also"]           = "Lihat juga"
+Locale["ms"]["family"]             = "Austronesian"
+Locale["ms"]["iso"]                = "msa"
+Locale["ms"]["glotto"]             = "stan1306"
+Locale["ms"]["script"]             = "Latn"
+Locale["ml"]["name"]               = "Malayalam"
+Locale["ml"]["endonym"]            = "മലയാളം"
+Locale["ml"]["translations-of"]    = "%s എന്നതിന്റെ വിവർത്തനങ്ങൾ"
+Locale["ml"]["definitions-of"]     = "%s എന്നതിന്റെ നിർവ്വചനങ്ങൾ"
+Locale["ml"]["synonyms"]           = "പര്യായങ്ങള്‍"
+Locale["ml"]["examples"]           = "ഉദാഹരണങ്ങള്‍"
+Locale["ml"]["see-also"]           = "ഇതും കാണുക"
+Locale["ml"]["family"]             = "Dravidian"
+Locale["ml"]["iso"]                = "mal"
+Locale["ml"]["glotto"]             = "mala1464"
+Locale["ml"]["script"]             = "Mlym"
+Locale["mt"]["name"]               = "Maltese"
+Locale["mt"]["endonym"]            = "Malti"
+Locale["mt"]["translations-of"]    = "Traduzzjonijiet ta' %s"
+Locale["mt"]["definitions-of"]     = "Definizzjonijiet ta' %s"
+Locale["mt"]["synonyms"]           = "Sinonimi"
+Locale["mt"]["examples"]           = "Eżempji"
+Locale["mt"]["see-also"]           = "Ara wkoll"
+Locale["mt"]["family"]             = "Afro-Asiatic"
+Locale["mt"]["iso"]                = "mlt"
+Locale["mt"]["glotto"]             = "malt1254"
+Locale["mt"]["script"]             = "Latn"
+Locale["mi"]["name"]               = "Maori"
+Locale["mi"]["endonym"]            = "Māori"
+Locale["mi"]["translations-of"]    = "Ngā whakamāoritanga o %s"
+Locale["mi"]["definitions-of"]     = "Ngā whakamārama o %s"
+Locale["mi"]["synonyms"]           = "Ngā Kupu Taurite"
+Locale["mi"]["examples"]           = "Ngā Tauira:"
+Locale["mi"]["see-also"]           = "Tiro hoki:"
+Locale["mi"]["family"]             = "Austronesian"
+Locale["mi"]["iso"]                = "mri"
+Locale["mi"]["glotto"]             = "maor1246"
+Locale["mi"]["script"]             = "Latn"
+Locale["mr"]["name"]               = "Marathi"
+Locale["mr"]["endonym"]            = "मराठी"
+Locale["mr"]["translations-of"]    = "%s ची भाषांतरे"
+Locale["mr"]["definitions-of"]     = "%s च्या व्याख्या"
+Locale["mr"]["synonyms"]           = "समानार्थी शब्द"
+Locale["mr"]["examples"]           = "उदाहरणे"
+Locale["mr"]["see-also"]           = "हे देखील पहा"
+Locale["mr"]["family"]             = "Indo-European"
+Locale["mr"]["iso"]                = "mar"
+Locale["mr"]["glotto"]             = "mara1378"
+Locale["mr"]["script"]             = "Deva"
+Locale["mn"]["name"]               = "Mongolian"
+Locale["mn"]["endonym"]            = "Монгол"
+Locale["mn"]["translations-of"]    = "%s-н орчуулга"
+Locale["mn"]["definitions-of"]     = "%s үгийн тодорхойлолт"
+Locale["mn"]["synonyms"]           = "Ойролцоо утгатай"
+Locale["mn"]["examples"]           = "Жишээнүүд"
+Locale["mn"]["see-also"]           = "Мөн харах"
+Locale["mn"]["family"]             = "Mongolic"
+Locale["mn"]["iso"]                = "mon"
+Locale["mn"]["glotto"]             = "mong1331"
+Locale["mn"]["script"]             = "Cyrl"
+Locale["my"]["name"]               = "Myanmar"
+Locale["my"]["endonym"]            = "မြန်မာစာ"
+Locale["my"]["translations-of"]    = "%s၏ ဘာသာပြန်ဆိုချက်များ"
+Locale["my"]["definitions-of"]     = "%s၏ အနက်ဖွင့်ဆိုချက်များ"
+Locale["my"]["synonyms"]           = "ကြောင်းတူသံကွဲများ"
+Locale["my"]["examples"]           = "ဥပမာ"
+Locale["my"]["see-also"]           = "ဖော်ပြပါများကိုလဲ ကြည့်ပါ"
+Locale["my"]["family"]             = "Sino-Tibetan"
+Locale["my"]["iso"]                = "mya"
+Locale["my"]["glotto"]             = "nucl1310"
+Locale["my"]["script"]             = "Mymr"
+Locale["ne"]["name"]               = "Nepali"
+Locale["ne"]["endonym"]            = "नेपाली"
+Locale["ne"]["translations-of"]    = "%sका अनुवाद"
+Locale["ne"]["definitions-of"]     = "%sको परिभाषा"
+Locale["ne"]["synonyms"]           = "समानार्थीहरू"
+Locale["ne"]["examples"]           = "उदाहरणहरु"
+Locale["ne"]["see-also"]           = "यो पनि हेर्नुहोस्"
+Locale["ne"]["family"]             = "Indo-European"
+Locale["ne"]["iso"]                = "nep"
+Locale["ne"]["glotto"]             = "nepa1254"
+Locale["ne"]["script"]             = "Deva"
+Locale["no"]["name"]               = "Norwegian"
+Locale["no"]["endonym"]            = "Norsk"
+Locale["no"]["translations-of"]    = "Oversettelser av %s"
+Locale["no"]["definitions-of"]     = "Definisjoner av %s"
+Locale["no"]["synonyms"]           = "Synonymer"
+Locale["no"]["examples"]           = "Eksempler"
+Locale["no"]["see-also"]           = "Se også"
+Locale["no"]["family"]             = "Indo-European"
+Locale["no"]["iso"]                = "nor"
+Locale["no"]["glotto"]             = "norw1258"
+Locale["no"]["script"]             = "Latn"
+Locale["ps"]["name"]               = "Pashto"
+Locale["ps"]["endonym"]            = "پښتو"
+Locale["ps"]["translations-of"]    = "د %sژباړې"
+Locale["ps"]["definitions-of"]     = "د%s تعریفونه"
+Locale["ps"]["synonyms"]           = "مترادف لغتونه"
+Locale["ps"]["examples"]           = "بېلګې"
+Locale["ps"]["see-also"]           = "دا هم ووینئ"
+Locale["ps"]["family"]             = "Indo-European"
+Locale["ps"]["iso"]                = "pus"
+Locale["ps"]["glotto"]             = "pash1269"
+Locale["ps"]["script"]             = "Arab"
+Locale["ps"]["rtl"]                = "true"
+Locale["fa"]["name"]               = "Persian"
+Locale["fa"]["endonym"]            = "فارسی"
+Locale["fa"]["translations-of"]    = "ترجمه‌های %s"
+Locale["fa"]["definitions-of"]     = "تعریف‌های %s"
+Locale["fa"]["synonyms"]           = "مترادف‌ها"
+Locale["fa"]["examples"]           = "مثال‌ها"
+Locale["fa"]["see-also"]           = "همچنین مراجعه کنید به"
+Locale["fa"]["family"]             = "Indo-European"
+Locale["fa"]["iso"]                = "fas"
+Locale["fa"]["glotto"]             = "west2369"
+Locale["fa"]["script"]             = "Arab"
+Locale["fa"]["rtl"]                = "true"
+Locale["pl"]["name"]               = "Polish"
+Locale["pl"]["endonym"]            = "Polski"
+Locale["pl"]["translations-of"]    = "Tłumaczenia %s"
+Locale["pl"]["definitions-of"]     = "%s – definicje"
+Locale["pl"]["synonyms"]           = "Synonimy"
+Locale["pl"]["examples"]           = "Przykłady"
+Locale["pl"]["see-also"]           = "Zobacz też"
+Locale["pl"]["family"]             = "Indo-European"
+Locale["pl"]["iso"]                = "pol"
+Locale["pl"]["glotto"]             = "poli1260"
+Locale["pl"]["script"]             = "Latn"
+Locale["pt"]["name"]               = "Portuguese"
+Locale["pt"]["endonym"]            = "Português"
+Locale["pt"]["translations-of"]    = "Traduções de %s"
+Locale["pt"]["definitions-of"]     = "Definições de %s"
+Locale["pt"]["synonyms"]           = "Sinônimos"
+Locale["pt"]["examples"]           = "Exemplos"
+Locale["pt"]["see-also"]           = "Veja também"
+Locale["pt"]["family"]             = "Indo-European"
+Locale["pt"]["iso"]                = "por"
+Locale["pt"]["glotto"]             = "port1283"
+Locale["pt"]["script"]             = "Latn"
+Locale["pt"]["dictionary"]         = "true"
+Locale["pa"]["name"]               = "Punjabi"
+Locale["pa"]["endonym"]            = "ਪੰਜਾਬੀ"
+Locale["pa"]["translations-of"]    = "ਦੇ ਅਨੁਵਾਦ%s"
+Locale["pa"]["definitions-of"]     = "ਦੀਆਂ ਪਰਿਭਾਸ਼ਾ %s"
+Locale["pa"]["synonyms"]           = "ਸਮਾਨਾਰਥਕ ਸ਼ਬਦ"
+Locale["pa"]["examples"]           = "ਉਦਾਹਰਣਾਂ"
+Locale["pa"]["see-also"]           = "ਇਹ ਵੀ ਵੇਖੋ"
+Locale["pa"]["family"]             = "Indo-European"
+Locale["pa"]["iso"]                = "pan"
+Locale["pa"]["glotto"]             = "panj1256"
+Locale["pa"]["script"]             = "Guru"
+Locale["ro"]["name"]               = "Romanian"
+Locale["ro"]["endonym"]            = "Română"
+Locale["ro"]["translations-of"]    = "Traduceri pentru %s"
+Locale["ro"]["definitions-of"]     = "Definiții pentru %s"
+Locale["ro"]["synonyms"]           = "Sinonime"
+Locale["ro"]["examples"]           = "Exemple"
+Locale["ro"]["see-also"]           = "Vedeți și"
+Locale["ro"]["family"]             = "Indo-European"
+Locale["ro"]["iso"]                = "ron"
+Locale["ro"]["glotto"]             = "roma1327"
+Locale["ro"]["script"]             = "Latn"
+Locale["ru"]["name"]               = "Russian"
+Locale["ru"]["endonym"]            = "Русский"
+Locale["ru"]["translations-of"]    = "%s: варианты перевода"
+Locale["ru"]["definitions-of"]     = "%s – определения"
+Locale["ru"]["synonyms"]           = "Синонимы"
+Locale["ru"]["examples"]           = "Примеры"
+Locale["ru"]["see-also"]           = "Похожие слова"
+Locale["ru"]["family"]             = "Indo-European"
+Locale["ru"]["iso"]                = "rus"
+Locale["ru"]["glotto"]             = "russ1263"
+Locale["ru"]["script"]             = "Cyrl"
+Locale["ru"]["dictionary"]         = "true"
+Locale["sm"]["name"]               = "Samoan"
+Locale["sm"]["endonym"]            = "Gagana Sāmoa"
+Locale["sm"]["family"]             = "Austronesian"
+Locale["sm"]["iso"]                = "smo"
+Locale["sm"]["glotto"]             = "samo1305"
+Locale["sm"]["script"]             = "Latn"
+Locale["gd"]["name"]               = "Scots Gaelic"
+Locale["gd"]["endonym"]            = "Gàidhlig"
+Locale["gd"]["translations-of"]    = "Eadar-theangachadh airson %s"
+Locale["gd"]["definitions-of"]     = "Deifiniseanan airson %s"
+Locale["gd"]["synonyms"]           = "Co-fhaclan"
+Locale["gd"]["examples"]           = "Buill-eisimpleir"
+Locale["gd"]["see-also"]           = "Faic na leanas cuideachd"
+Locale["gd"]["family"]             = "Indo-European"
+Locale["gd"]["iso"]                = "gla"
+Locale["gd"]["glotto"]             = "scot1245"
+Locale["gd"]["script"]             = "Latn"
+Locale["sr-Cyrl"]["name"]          = "Serbian (Cyrillic)"
+Locale["sr-Cyrl"]["endonym"]       = "српски"
+Locale["sr-Cyrl"]["translations-of"] = "Преводи за „%s“"
+Locale["sr-Cyrl"]["definitions-of"]  = "Дефиниције за %s"
+Locale["sr-Cyrl"]["synonyms"]      = "Синоними"
+Locale["sr-Cyrl"]["examples"]      = "Примери"
+Locale["sr-Cyrl"]["see-also"]      = "Погледајте такође"
+Locale["sr-Cyrl"]["family"]        = "Indo-European"
+Locale["sr-Cyrl"]["iso"]           = "srp-Cyrl"
+Locale["sr-Cyrl"]["glotto"]        = "serb1264"
+Locale["sr-Cyrl"]["script"]        = "Cyrl"
+Locale["sr-Latn"]["name"]          = "Serbian (Latin)"
+Locale["sr-Latn"]["endonym"]       = "srpski"
+Locale["sr-Latn"]["translations-of"] = "Prevodi za „%s“"
+Locale["sr-Latn"]["definitions-of"]  = "Definicije za %s"
+Locale["sr-Latn"]["synonyms"]      = "Sinonimi"
+Locale["sr-Latn"]["examples"]      = "Primeri"
+Locale["sr-Latn"]["see-also"]      = "Pogledajte takođe"
+Locale["sr-Latn"]["family"]        = "Indo-European"
+Locale["sr-Latn"]["iso"]           = "srp-Latn"
+Locale["sr-Latn"]["glotto"]        = "serb1264"
+Locale["sr-Latn"]["script"]        = "Latn"
+Locale["st"]["name"]               = "Sesotho"
+Locale["st"]["endonym"]            = "Sesotho"
+Locale["st"]["translations-of"]    = "Liphetolelo tsa %s"
+Locale["st"]["definitions-of"]     = "Meelelo ea %s"
+Locale["st"]["synonyms"]           = "Mantsoe a tšoanang ka moelelo"
+Locale["st"]["examples"]           = "Mehlala"
+Locale["st"]["see-also"]           = "Bona hape"
+Locale["st"]["family"]             = "Atlantic-Congo"
+Locale["st"]["iso"]                = "sot"
+Locale["st"]["glotto"]             = "sout2807"
+Locale["st"]["script"]             = "Latn"
+Locale["sn"]["name"]               = "Shona"
+Locale["sn"]["endonym"]            = "chiShona"
+Locale["sn"]["translations-of"]    = "Shanduro dze %s"
+Locale["sn"]["definitions-of"]     = "Zvinoreva %s"
+Locale["sn"]["synonyms"]           = "Mashoko anoreva zvakafana nemamwe"
+Locale["sn"]["examples"]           = "Mienzaniso"
+Locale["sn"]["see-also"]           = "Onawo"
+Locale["sn"]["family"]             = "Atlantic-Congo"
+Locale["sn"]["iso"]                = "sna"
+Locale["sn"]["glotto"]             = "core1255"
+Locale["sn"]["script"]             = "Latn"
+Locale["sd"]["name"]               = "Sindhi"
+Locale["sd"]["endonym"]            = "سنڌي"
+Locale["sd"]["translations-of"]    = "%s جو ترجمو"
+Locale["sd"]["definitions-of"]     = "%s جون وصفون"
+Locale["sd"]["synonyms"]           = "هم معني"
+Locale["sd"]["examples"]           = "مثالون"
+Locale["sd"]["see-also"]           = "به ڏسو"
+Locale["sd"]["family"]             = "Indo-European"
+Locale["sd"]["iso"]                = "snd"
+Locale["sd"]["glotto"]             = "sind1272"
+Locale["sd"]["script"]             = "Arab"
+Locale["sd"]["rtl"]                = "true"
+Locale["si"]["name"]               = "Sinhala"
+Locale["si"]["endonym"]            = "සිංහල"
+Locale["si"]["translations-of"]    = "%s හි පරිවර්තන"
+Locale["si"]["definitions-of"]     = "%s හි නිර්වචන"
+Locale["si"]["synonyms"]           = "සමානාර්ථ පද"
+Locale["si"]["examples"]           = "උදාහරණ"
+Locale["si"]["see-also"]           = "මෙයත් බලන්න"
+Locale["si"]["family"]             = "Indo-European"
+Locale["si"]["iso"]                = "sin"
+Locale["si"]["glotto"]             = "sinh1246"
+Locale["si"]["script"]             = "Sinh"
+Locale["sk"]["name"]               = "Slovak"
+Locale["sk"]["endonym"]            = "Slovenčina"
+Locale["sk"]["translations-of"]    = "Preklady výrazu: %s"
+Locale["sk"]["definitions-of"]     = "Definície výrazu %s"
+Locale["sk"]["synonyms"]           = "Synonymá"
+Locale["sk"]["examples"]           = "Príklady"
+Locale["sk"]["see-also"]           = "Pozrite tiež"
+Locale["sk"]["family"]             = "Indo-European"
+Locale["sk"]["iso"]                = "slk"
+Locale["sk"]["glotto"]             = "slov1269"
+Locale["sk"]["script"]             = "Latn"
+Locale["sl"]["name"]               = "Slovenian"
+Locale["sl"]["endonym"]            = "Slovenščina"
+Locale["sl"]["translations-of"]    = "Prevodi za %s"
+Locale["sl"]["definitions-of"]     = "Razlage za %s"
+Locale["sl"]["synonyms"]           = "Sopomenke"
+Locale["sl"]["examples"]           = "Primeri"
+Locale["sl"]["see-also"]           = "Glejte tudi"
+Locale["sl"]["family"]             = "Indo-European"
+Locale["sl"]["iso"]                = "slv"
+Locale["sl"]["glotto"]             = "slov1268"
+Locale["sl"]["script"]             = "Latn"
+Locale["so"]["name"]               = "Somali"
+Locale["so"]["endonym"]            = "Soomaali"
+Locale["so"]["translations-of"]    = "Turjumaada %s"
+Locale["so"]["definitions-of"]     = "Qeexitaannada %s"
+Locale["so"]["synonyms"]           = "La micne ah"
+Locale["so"]["examples"]           = "Tusaalooyin"
+Locale["so"]["see-also"]           = "Sidoo kale eeg"
+Locale["so"]["family"]             = "Afro-Asiatic"
+Locale["so"]["iso"]                = "som"
+Locale["so"]["glotto"]             = "soma1255"
+Locale["so"]["script"]             = "Latn"
+Locale["es"]["name"]               = "Spanish"
+Locale["es"]["endonym"]            = "Español"
+Locale["es"]["translations-of"]    = "Traducciones de %s"
+Locale["es"]["definitions-of"]     = "Definiciones de %s"
+Locale["es"]["synonyms"]           = "Sinónimos"
+Locale["es"]["examples"]           = "Ejemplos"
+Locale["es"]["see-also"]           = "Ver también"
+Locale["es"]["family"]             = "Indo-European"
+Locale["es"]["iso"]                = "spa"
+Locale["es"]["glotto"]             = "stan1288"
+Locale["es"]["script"]             = "Latn"
+Locale["es"]["dictionary"]         = "true"
+Locale["su"]["name"]               = "Sundanese"
+Locale["su"]["endonym"]            = "Basa Sunda"
+Locale["su"]["translations-of"]    = "Tarjamahan tina %s"
+Locale["su"]["definitions-of"]     = "Panjelasan tina %s"
+Locale["su"]["synonyms"]           = "Sinonim"
+Locale["su"]["examples"]           = "Conto"
+Locale["su"]["see-also"]           = "Tingali ogé"
+Locale["su"]["family"]             = "Austronesian"
+Locale["su"]["iso"]                = "sun"
+Locale["su"]["glotto"]             = "sund1252"
+Locale["su"]["script"]             = "Latn"
+Locale["sw"]["name"]               = "Swahili"
+Locale["sw"]["endonym"]            = "Kiswahili"
+Locale["sw"]["translations-of"]    = "Tafsiri ya %s"
+Locale["sw"]["definitions-of"]     = "Ufafanuzi wa %s"
+Locale["sw"]["synonyms"]           = "Visawe"
+Locale["sw"]["examples"]           = "Mifano"
+Locale["sw"]["see-also"]           = "Angalia pia"
+Locale["sw"]["family"]             = "Atlantic-Congo"
+Locale["sw"]["iso"]                = "swa"
+Locale["sw"]["glotto"]             = "swah1253"
+Locale["sw"]["script"]             = "Latn"
+Locale["sv"]["name"]               = "Swedish"
+Locale["sv"]["endonym"]            = "Svenska"
+Locale["sv"]["translations-of"]    = "Översättningar av %s"
+Locale["sv"]["definitions-of"]     = "Definitioner av %s"
+Locale["sv"]["synonyms"]           = "Synonymer"
+Locale["sv"]["examples"]           = "Exempel"
+Locale["sv"]["see-also"]           = "Se även"
+Locale["sv"]["family"]             = "Indo-European"
+Locale["sv"]["iso"]                = "swe"
+Locale["sv"]["glotto"]             = "swed1254"
+Locale["sv"]["script"]             = "Latn"
+Locale["tg"]["name"]               = "Tajik"
+Locale["tg"]["endonym"]            = "Тоҷикӣ"
+Locale["tg"]["translations-of"]    = "Тарҷумаҳои %s"
+Locale["tg"]["definitions-of"]     = "Таърифҳои %s"
+Locale["tg"]["synonyms"]           = "Муродифҳо"
+Locale["tg"]["examples"]           = "Намунаҳо:"
+Locale["tg"]["see-also"]           = "Ҳамчунин Бинед"
+Locale["tg"]["family"]             = "Indo-European"
+Locale["tg"]["iso"]                = "tgk"
+Locale["tg"]["glotto"]             = "taji1245"
+Locale["tg"]["script"]             = "Cyrl"
+Locale["ta"]["name"]               = "Tamil"
+Locale["ta"]["endonym"]            = "தமிழ்"
+Locale["ta"]["translations-of"]    = "%s இன் மொழிபெயர்ப்புகள்"
+Locale["ta"]["definitions-of"]     = "%s இன் வரையறைகள்"
+Locale["ta"]["synonyms"]           = "இணைச்சொற்கள்"
+Locale["ta"]["examples"]           = "எடுத்துக்காட்டுகள்"
+Locale["ta"]["see-also"]           = "இதையும் காண்க"
+Locale["ta"]["family"]             = "Dravidian"
+Locale["ta"]["iso"]                = "tam"
+Locale["ta"]["glotto"]             = "tami1289"
+Locale["ta"]["script"]             = "Taml"
+Locale["te"]["name"]               = "Telugu"
+Locale["te"]["endonym"]            = "తెలుగు"
+Locale["te"]["translations-of"]    = "%s యొక్క అనువాదాలు"
+Locale["te"]["definitions-of"]     = "%s యొక్క నిర్వచనాలు"
+Locale["te"]["synonyms"]           = "పర్యాయపదాలు"
+Locale["te"]["examples"]           = "ఉదాహరణలు"
+Locale["te"]["see-also"]           = "వీటిని కూడా చూడండి"
+Locale["te"]["family"]             = "Dravidian"
+Locale["te"]["iso"]                = "tel"
+Locale["te"]["glotto"]             = "telu1262"
+Locale["te"]["script"]             = "Telu"
+Locale["th"]["name"]               = "Thai"
+Locale["th"]["endonym"]            = "ไทย"
+Locale["th"]["translations-of"]    = "คำแปลของ %s"
+Locale["th"]["definitions-of"]     = "คำจำกัดความของ %s"
+Locale["th"]["synonyms"]           = "คำพ้องความหมาย"
+Locale["th"]["examples"]           = "ตัวอย่าง"
+Locale["th"]["see-also"]           = "ดูเพิ่มเติม"
+Locale["th"]["family"]             = "Tai-Kadai"
+Locale["th"]["iso"]                = "tha"
+Locale["th"]["glotto"]             = "thai1261"
+Locale["th"]["script"]             = "Thai"
+Locale["tr"]["name"]               = "Turkish"
+Locale["tr"]["endonym"]            = "Türkçe"
+Locale["tr"]["translations-of"]    = "%s çevirileri"
+Locale["tr"]["definitions-of"]     = "%s için tanımlar"
+Locale["tr"]["synonyms"]           = "Eş anlamlılar"
+Locale["tr"]["examples"]           = "Örnekler"
+Locale["tr"]["see-also"]           = "Ayrıca bkz."
+Locale["tr"]["family"]             = "Turkic"
+Locale["tr"]["iso"]                = "tur"
+Locale["tr"]["glotto"]             = "nucl1301"
+Locale["tr"]["script"]             = "Latn"
+Locale["uk"]["name"]               = "Ukrainian"
+Locale["uk"]["endonym"]            = "Українська"
+Locale["uk"]["translations-of"]    = "Переклади слова або виразу \"%s\""
+Locale["uk"]["definitions-of"]     = "\"%s\" – визначення"
+Locale["uk"]["synonyms"]           = "Синоніми"
+Locale["uk"]["examples"]           = "Приклади"
+Locale["uk"]["see-also"]           = "Дивіться також"
+Locale["uk"]["family"]             = "Indo-European"
+Locale["uk"]["iso"]                = "ukr"
+Locale["uk"]["glotto"]             = "ukra1253"
+Locale["uk"]["script"]             = "Cyrl"
+Locale["ur"]["name"]               = "Urdu"
+Locale["ur"]["endonym"]            = "اُردُو"
+Locale["ur"]["translations-of"]    = "کے ترجمے %s"
+Locale["ur"]["definitions-of"]     = "کی تعریفات %s"
+Locale["ur"]["synonyms"]           = "مترادفات"
+Locale["ur"]["examples"]           = "مثالیں"
+Locale["ur"]["see-also"]           = "نیز دیکھیں"
+Locale["ur"]["family"]             = "Indo-European"
+Locale["ur"]["iso"]                = "urd"
+Locale["ur"]["glotto"]             = "urdu1245"
+Locale["ur"]["script"]             = "Arab"
+Locale["ur"]["rtl"]                = "true"
+Locale["uz"]["name"]               = "Uzbek"
+Locale["uz"]["endonym"]            = "Oʻzbek tili"
+Locale["uz"]["translations-of"]    = "%s: tarjima variantlari"
+Locale["uz"]["definitions-of"]     = "%s – ta’riflar"
+Locale["uz"]["synonyms"]           = "Sinonimlar"
+Locale["uz"]["examples"]           = "Namunalar"
+Locale["uz"]["see-also"]           = "O‘xshash so‘zlar"
+Locale["uz"]["family"]             = "Turkic"
+Locale["uz"]["iso"]                = "uzb"
+Locale["uz"]["glotto"]             = "uzbe1247"
+Locale["uz"]["script"]             = "Latn"
+Locale["vi"]["name"]               = "Vietnamese"
+Locale["vi"]["endonym"]            = "Tiếng Việt"
+Locale["vi"]["translations-of"]    = "Bản dịch của %s"
+Locale["vi"]["definitions-of"]     = "Nghĩa của %s"
+Locale["vi"]["synonyms"]           = "Từ đồng nghĩa"
+Locale["vi"]["examples"]           = "Ví dụ"
+Locale["vi"]["see-also"]           = "Xem thêm"
+Locale["vi"]["family"]             = "Austroasiatic"
+Locale["vi"]["iso"]                = "vie"
+Locale["vi"]["glotto"]             = "viet1252"
+Locale["vi"]["script"]             = "Latn"
+Locale["cy"]["name"]               = "Welsh"
+Locale["cy"]["endonym"]            = "Cymraeg"
+Locale["cy"]["translations-of"]    = "Cyfieithiadau %s"
+Locale["cy"]["definitions-of"]     = "Diffiniadau %s"
+Locale["cy"]["synonyms"]           = "Cyfystyron"
+Locale["cy"]["examples"]           = "Enghreifftiau"
+Locale["cy"]["see-also"]           = "Gweler hefyd"
+Locale["cy"]["family"]             = "Indo-European"
+Locale["cy"]["iso"]                = "cym"
+Locale["cy"]["glotto"]             = "wels1247"
+Locale["cy"]["script"]             = "Latn"
+Locale["fy"]["name"]               = "Frisian"
+Locale["fy"]["endonym"]            = "Frysk"
+Locale["fy"]["translations-of"]    = "Oersettings fan %s"
+Locale["fy"]["definitions-of"]     = "Definysjes fan %s"
+Locale["fy"]["synonyms"]           = "Synonimen"
+Locale["fy"]["examples"]           = "Foarbylden"
+Locale["fy"]["see-also"]           = "Sjoch ek"
+Locale["fy"]["family"]             = "Indo-European"
+Locale["fy"]["iso"]                = "fry"
+Locale["fy"]["glotto"]             = "west2354"
+Locale["fy"]["script"]             = "Latn"
+Locale["xh"]["name"]               = "Xhosa"
+Locale["xh"]["endonym"]            = "isiXhosa"
+Locale["xh"]["translations-of"]    = "Iinguqulelo zika-%s"
+Locale["xh"]["definitions-of"]     = "Iingcaciso zika-%s"
+Locale["xh"]["synonyms"]           = "Izithethantonye"
+Locale["xh"]["examples"]           = "Imizekelo"
+Locale["xh"]["see-also"]           = "Kwakhona bona"
+Locale["xh"]["family"]             = "Atlantic-Congo"
+Locale["xh"]["iso"]                = "xho"
+Locale["xh"]["glotto"]             = "xhos1239"
+Locale["xh"]["script"]             = "Latn"
+Locale["yi"]["name"]               = "Yiddish"
+Locale["yi"]["endonym"]            = "ייִדיש"
+Locale["yi"]["translations-of"]    = "איבערזעצונגען פון %s"
+Locale["yi"]["definitions-of"]     = "דפיניציונען %s"
+Locale["yi"]["synonyms"]           = "סינאָנימען"
+Locale["yi"]["examples"]           = "ביישפילע"
+Locale["yi"]["see-also"]           = "זייען אויך"
+Locale["yi"]["family"]             = "Indo-European"
+Locale["yi"]["iso"]                = "yid"
+Locale["yi"]["glotto"]             = "yidd1255"
+Locale["yi"]["script"]             = "Hebr"
+Locale["yi"]["rtl"]                = "true"
+Locale["yo"]["name"]               = "Yoruba"
+Locale["yo"]["endonym"]            = "Yorùbá"
+Locale["yo"]["translations-of"]    = "Awọn itumọ ti %s"
+Locale["yo"]["definitions-of"]     = "Awọn itumọ ti %s"
+Locale["yo"]["synonyms"]           = "Awọn ọrọ onitumọ"
+Locale["yo"]["examples"]           = "Awọn apẹrẹ"
+Locale["yo"]["see-also"]           = "Tun wo"
+Locale["yo"]["family"]             = "Atlantic-Congo"
+Locale["yo"]["iso"]                = "yor"
+Locale["yo"]["glotto"]             = "yoru1245"
+Locale["yo"]["script"]             = "Latn"
+Locale["zu"]["name"]               = "Zulu"
+Locale["zu"]["endonym"]            = "isiZulu"
+Locale["zu"]["translations-of"]    = "Ukuhumusha i-%s"
+Locale["zu"]["definitions-of"]     = "Izincazelo ze-%s"
+Locale["zu"]["synonyms"]           = "Amagama afanayo"
+Locale["zu"]["examples"]           = "Izibonelo"
+Locale["zu"]["see-also"]           = "Bheka futhi"
+Locale["zu"]["family"]             = "Atlantic-Congo"
+Locale["zu"]["iso"]                = "zul"
+Locale["zu"]["glotto"]             = "zulu1248"
+Locale["zu"]["script"]             = "Latn"
+Locale["yue"]["support"]           = "bing-only"
+Locale["yue"]["name"]              = "Cantonese"
+Locale["yue"]["endonym"]           = "粵語"
+Locale["yue"]["family"]            = "Sino-Tibetan"
+Locale["yue"]["iso"]               = "yue"
+Locale["yue"]["glotto"]            = "cant1236"
+Locale["yue"]["script"]            = "Hant"
+Locale["fj"]["support"]           = "bing-only"
+Locale["fj"]["name"]              = "Fijian"
+Locale["fj"]["endonym"]           = "Vosa Vakaviti"
+Locale["fj"]["family"]            = "Austronesian"
+Locale["fj"]["iso"]               = "fij"
+Locale["fj"]["glotto"]            = "fiji1243"
+Locale["fj"]["script"]            = "Latn"
+Locale["mww"]["support"]           = "bing-only"
+Locale["mww"]["name"]              = "Hmong Daw"
+Locale["mww"]["endonym"]           = "Hmoob Daw"
+Locale["mww"]["family"]            = "Hmong-Mien"
+Locale["mww"]["iso"]               = "mww"
+Locale["mww"]["glotto"]            = "hmon1333"
+Locale["mww"]["script"]            = "Latn"
+Locale["otq"]["support"]           = "bing-only"
+Locale["otq"]["name"]              = "Querétaro Otomi"
+Locale["otq"]["endonym"]           = "Hñąñho"
+Locale["otq"]["family"]            = "Oto-Manguean"
+Locale["otq"]["iso"]               = "otq"
+Locale["otq"]["glotto"]            = "quer1236"
+Locale["otq"]["script"]            = "Latn"
+Locale["ty"]["support"]           = "bing-only"
+Locale["ty"]["name"]              = "Tahitian"
+Locale["ty"]["endonym"]           = "Reo Tahiti"
+Locale["ty"]["family"]            = "Austronesian"
+Locale["ty"]["iso"]               = "tah"
+Locale["ty"]["glotto"]            = "tahi1242"
+Locale["ty"]["script"]            = "Latn"
+Locale["to"]["support"]           = "bing-only"
+Locale["to"]["name"]              = "Tongan"
+Locale["to"]["endonym"]           = "Lea faka-Tonga"
+Locale["to"]["family"]            = "Austronesian"
+Locale["to"]["iso"]               = "ton"
+Locale["to"]["glotto"]            = "tong1325"
+Locale["to"]["script"]            = "Latn"
+Locale["yua"]["support"]           = "bing-only"
+Locale["yua"]["name"]              = "Yucatec Maya"
+Locale["yua"]["endonym"]           = "Màaya T'àan"
+Locale["yua"]["family"]            = "Mayan"
+Locale["yua"]["iso"]               = "yua"
+Locale["yua"]["glotto"]            = "yuca1254"
+Locale["yua"]["script"]            = "Latn"
+Locale["tlh"]["support"]           = "bing-only"
+Locale["tlh"]["name"]              = "Klingon"
+Locale["tlh"]["endonym"]           = "tlhIngan Hol"
+Locale["tlh"]["family"]            = "Artificial Language"
+Locale["tlh"]["iso"]               = "tlh"
+Locale["tlh"]["script"]            = "Latn"
+Locale["tlh-Qaak"]["support"]      = "bing-only"
+Locale["tlh-Qaak"]["name"]         = "Klingon (pIqaD)"
+Locale["tlh-Qaak"]["endonym"]      = " "
+Locale["tlh-Qaak"]["family"]       = "Artificial Language"
+Locale["tlh-Qaak"]["iso"]          = "tlh"
+Locale["tlh-Qaak"]["script"]       = "Piqd"
+Locale["as"]["support"]            = "unstable"
+Locale["as"]["name"]               = "Assamese"
+Locale["as"]["endonym"]            = "অসমীয়া"
+Locale["as"]["family"]             = "Indo-European"
+Locale["as"]["iso"]                = "asm"
+Locale["as"]["glotto"]             = "assa1263"
+Locale["as"]["script"]             = "Beng"
+Locale["ba"]["support"]            = "yandex-only"
+Locale["ba"]["name"]               = "Bashkir"
+Locale["ba"]["endonym"]            = "башҡорт теле"
+Locale["ba"]["family"]             = "Turkic"
+Locale["ba"]["iso"]                = "bak"
+Locale["ba"]["glotto"]             = "bash1264"
+Locale["ba"]["script"]             = "Cyrl"
+Locale["br"]["support"]            = "unstable"
+Locale["br"]["name"]               = "Breton"
+Locale["br"]["endonym"]            = "Brezhoneg"
+Locale["br"]["family"]             = "Indo-European"
+Locale["br"]["iso"]                = "bre"
+Locale["br"]["glotto"]             = "bret1244"
+Locale["br"]["script"]             = "Latn"
+Locale["dz"]["support"]            = "unstable"
+Locale["dz"]["name"]               = "Dzongkha"
+Locale["dz"]["endonym"]            = "རྫོང་ཁ"
+Locale["dz"]["family"]             = "Sino-Tibetan"
+Locale["dz"]["iso"]                = "dzo"
+Locale["dz"]["glotto"]             = "nucl1307"
+Locale["dz"]["script"]             = "Tibt"
+Locale["mhr"]["support"]           = "yandex-only"
+Locale["mhr"]["name"]              = "Eastern Mari"
+Locale["mhr"]["endonym"]           = "Олык марий"
+Locale["mhr"]["family"]            = "Uralic"
+Locale["mhr"]["iso"]               = "mhr"
+Locale["mhr"]["glotto"]            = "east2328"
+Locale["mhr"]["script"]            = "Cyrl"
+Locale["fo"]["support"]            = "unstable"
+Locale["fo"]["name"]               = "Faroese"
+Locale["fo"]["endonym"]            = "Føroyskt"
+Locale["fo"]["family"]             = "Indo-European"
+Locale["fo"]["iso"]                = "fao"
+Locale["fo"]["glotto"]             = "faro1244"
+Locale["fo"]["script"]             = "Latn"
+Locale["gn"]["support"]            = "unstable"
+Locale["gn"]["name"]               = "Guarani"
+Locale["gn"]["endonym"]            = "Avañe'ẽ"
+Locale["gn"]["family"]             = "Tupian"
+Locale["gn"]["iso"]                = "grn"
+Locale["gn"]["glotto"]             = "para1311"
+Locale["gn"]["script"]             = "Latn"
+Locale["mrj"]["support"]           = "yandex-only"
+Locale["mrj"]["name"]              = "Hill Mari"
+Locale["mrj"]["endonym"]           = "Кырык мары"
+Locale["mrj"]["family"]            = "Uralic"
+Locale["mrj"]["iso"]               = "mrj"
+Locale["mrj"]["glotto"]            = "west2392"
+Locale["mrj"]["script"]            = "Cyrl"
+Locale["ie"]["support"]            = "unstable"
+Locale["ie"]["name"]               = "Interlingue"
+Locale["ie"]["endonym"]            = "Interlingue"
+Locale["ie"]["family"]             = "Artificial Language"
+Locale["ie"]["iso"]                = "ile"
+Locale["ie"]["glotto"]             = "occi1241"
+Locale["ie"]["script"]             = "Latn"
+Locale["rw"]["support"]            = "unstable"
+Locale["rw"]["name"]               = "Kinyarwanda"
+Locale["rw"]["endonym"]            = "Ikinyarwanda"
+Locale["rw"]["family"]             = "Atlantic-Congo"
+Locale["rw"]["iso"]                = "kin"
+Locale["rw"]["glotto"]             = "kiny1244"
+Locale["rw"]["script"]             = "Latn"
+Locale["oc"]["support"]            = "unstable"
+Locale["oc"]["name"]               = "Occitan"
+Locale["oc"]["endonym"]            = "Occitan"
+Locale["oc"]["family"]             = "Indo-European"
+Locale["oc"]["iso"]                = "oci"
+Locale["oc"]["glotto"]             = "occi1239"
+Locale["oc"]["script"]             = "Latn"
+Locale["om"]["support"]            = "unstable"
+Locale["om"]["name"]               = "Oromo"
+Locale["om"]["endonym"]            = "Afaan Oromoo"
+Locale["om"]["family"]             = "Afro-Asiatic"
+Locale["om"]["iso"]                = "orm"
+Locale["om"]["glotto"]             = "nucl1736"
+Locale["om"]["script"]             = "Latn"
+Locale["or"]["support"]            = "unstable"
+Locale["or"]["name"]               = "Oriya"
+Locale["or"]["endonym"]            = "ଓଡ଼ିଆ"
+Locale["or"]["family"]             = "Indo-European"
+Locale["or"]["iso"]                = "ori"
+Locale["or"]["glotto"]             = "macr1269"
+Locale["or"]["script"]             = "Orya"
+Locale["pap"]["support"]           = "yandex-only"
+Locale["pap"]["name"]              = "Papiamento"
+Locale["pap"]["endonym"]           = "Papiamentu"
+Locale["pap"]["family"]            = "Indo-European"
+Locale["pap"]["iso"]               = "pap"
+Locale["pap"]["glotto"]            = "papi1253"
+Locale["pap"]["script"]            = "Latn"
+Locale["rm"]["support"]            = "unstable"
+Locale["rm"]["name"]               = "Romansh"
+Locale["rm"]["endonym"]            = "Rumantsch"
+Locale["rm"]["family"]             = "Indo-European"
+Locale["rm"]["iso"]                = "roh"
+Locale["rm"]["glotto"]             = "roma1326"
+Locale["rm"]["script"]             = "Latn"
+Locale["ti"]["support"]            = "unstable"
+Locale["ti"]["name"]               = "Tigrinya"
+Locale["ti"]["endonym"]            = "ትግርኛ"
+Locale["ti"]["family"]             = "Afro-Asiatic"
+Locale["ti"]["iso"]                = "tir"
+Locale["ti"]["glotto"]             = "tigr1271"
+Locale["ti"]["script"]             = "Ethi"
+Locale["bo"]["support"]            = "unstable"
+Locale["bo"]["name"]               = "Tibetan"
+Locale["bo"]["endonym"]            = "བོད་ཡིག"
+Locale["bo"]["family"]             = "Sino-Tibetan"
+Locale["bo"]["iso"]                = "bod"
+Locale["bo"]["glotto"]             = "tibe1272"
+Locale["bo"]["script"]             = "Tibt"
+Locale["tk"]["support"]            = "unstable"
+Locale["tk"]["name"]               = "Turkmen"
+Locale["tk"]["endonym"]            = "Türkmen"
+Locale["tk"]["family"]             = "Turkic"
+Locale["tk"]["iso"]                = "tuk"
+Locale["tk"]["glotto"]             = "turk1304"
+Locale["tk"]["script"]             = "Latn"
+Locale["tt"]["support"]            = "yandex-only"
+Locale["tt"]["name"]               = "Tatar"
+Locale["tt"]["endonym"]            = "татарча"
+Locale["tt"]["family"]             = "Turkic"
+Locale["tt"]["iso"]                = "tat"
+Locale["tt"]["glotto"]             = "tata1255"
+Locale["tt"]["script"]             = "Cyrl"
+Locale["udm"]["support"]           = "yandex-only"
+Locale["udm"]["name"]              = "Udmurt"
+Locale["udm"]["endonym"]           = "удмурт"
+Locale["udm"]["family"]            = "Uralic"
+Locale["udm"]["iso"]               = "udm"
+Locale["udm"]["glotto"]            = "udmu1245"
+Locale["udm"]["script"]            = "Cyrl"
+Locale["ug"]["support"]            = "unstable"
+Locale["ug"]["name"]               = "Uyghur"
+Locale["ug"]["endonym"]            = "ئۇيغۇر تىلى"
+Locale["ug"]["family"]             = "Turkic"
+Locale["ug"]["iso"]                = "uig"
+Locale["ug"]["glotto"]             = "uigh1240"
+Locale["ug"]["script"]             = "Arab"
+Locale["ug"]["rtl"]                = "true"
+Locale["vo"]["support"]            = "unstable"
+Locale["vo"]["name"]               = "Volapük"
+Locale["vo"]["endonym"]            = "Volapük"
+Locale["vo"]["family"]             = "Artificial Language"
+Locale["vo"]["iso"]                = "vol"
+Locale["vo"]["script"]             = "Latn"
+Locale["wo"]["support"]            = "unstable"
+Locale["wo"]["name"]               = "Wolof"
+Locale["wo"]["endonym"]            = "Wollof"
+Locale["wo"]["family"]             = "Atlantic-Congo"
+Locale["wo"]["iso"]                = "wol"
+Locale["wo"]["glotto"]             = "wolo1247"
+Locale["wo"]["script"]             = "Latn"
+Locale["chr"]["support"]           = "unstable"
+Locale["chr"]["name"]              = "Cherokee"
+Locale["chr"]["endonym"]           = "ᏣᎳᎩ"
+Locale["chr"]["family"]            = "Iroquoian"
+Locale["chr"]["iso"]               = "chr"
+Locale["chr"]["glotto"]            = "cher1273"
+Locale["chr"]["script"]            = "Cher"
+for (i in Locale) {
+Locale[i]["display"] = show(Locale[i]["endonym"], i)
+LocaleAlias[Locale[i]["iso"]] = i
+LocaleAlias[tolower(Locale[i]["name"])] = i
+LocaleAlias[tolower(Locale[i]["endonym"])] = i
+}
+LocaleAlias["in"] = "id"
+LocaleAlias["iw"] = "he"
+LocaleAlias["ji"] = "yi"
+LocaleAlias["jw"] = "jv"
+LocaleAlias["mo"] = "ro"
+LocaleAlias["nb"] = "no"
+LocaleAlias["nn"] = "no"
+LocaleAlias["sh"]      = "sr-Cyrl"
+LocaleAlias["sr"]      = "sr-Cyrl"
+LocaleAlias["srp"]     = "sr-Cyrl"
+LocaleAlias["serbian"] = "sr-Cyrl"
+LocaleAlias["zh"]      = "zh-CN"
+LocaleAlias["zh-CHS"]  = "zh-CN"
+LocaleAlias["zh-CHT"]  = "zh-TW"
+LocaleAlias["zho"]     = "zh-CN"
+LocaleAlias["chinese"] = "zh-CN"
+LocaleAlias["tlh-Latn"] = "tlh"
+LocaleAlias["tlh-Piqd"] = "tlh-Qaak"
+}
+function getCode(code,    group) {
+if (code == "auto" || code in Locale)
+return code
+else if (code in LocaleAlias)
+return LocaleAlias[code]
+else if (tolower(code) in LocaleAlias)
+return LocaleAlias[tolower(code)]
+match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group)
+if (group[1])
+return group[1]
+return
+}
+function getName(code) {
+return Locale[getCode(code)]["name"]
+}
+function getEndonym(code) {
+return Locale[getCode(code)]["endonym"]
+}
+function getDisplay(code) {
+return Locale[getCode(code)]["display"]
+}
+function showTranslationsOf(code, text,    fmt) {
+fmt = Locale[getCode(code)]["translations-of"]
+if (!fmt) fmt = Locale["en"]["translations-of"]
+return sprintf(fmt, text)
+}
+function showDefinitionsOf(code, text,    fmt) {
+fmt = Locale[getCode(code)]["definitions-of"]
+if (!fmt) fmt = Locale["en"]["definitions-of"]
+return sprintf(fmt, text)
+}
+function showSynonyms(code,    tmp) {
+tmp = Locale[getCode(code)]["synonyms"]
+if (!tmp) tmp = Locale["en"]["synonyms"]
+return tmp
+}
+function showExamples(code,    tmp) {
+tmp = Locale[getCode(code)]["examples"]
+if (!tmp) tmp = Locale["en"]["examples"]
+return tmp
+}
+function showSeeAlso(code,    tmp) {
+tmp = Locale[getCode(code)]["see-also"]
+if (!tmp) tmp = Locale["en"]["see-also"]
+return tmp
+}
+function getFamily(code) {
+return Locale[getCode(code)]["family"]
+}
+function getISO(code) {
+return Locale[getCode(code)]["iso"]
+}
+function getGlotto(code) {
+return Locale[getCode(code)]["glotto"]
+}
+function getScript(code) {
+return Locale[getCode(code)]["script"]
+}
+function isRTL(code) {
+return Locale[getCode(code)]["rtl"] ? 1 : 0
+}
+function hasDictionary(code) {
+return Locale[getCode(code)]["dictionary"] ? 1 : 0
+}
+function compName(i1, v1, i2, v2) {
+if (getName(i1) < getName(i2))
+return -1
+else
+return (getName(i1) != getName(i2))
+}
+function scriptName(code) {
+switch (code) {
+case "Arab": return "Arabic"
+case "Armn": return "Armenian"
+case "Beng": return "Bengali"
+case "Cher": return "Cherokee"
+case "Cyrl": return "Cyrillic"
+case "Deva": return "Devanagari"
+case "Ethi": return "Ethiopic (Geʻez)"
+case "Geor": return "Georgian (Mkhedruli)"
+case "Grek": return "Greek"
+case "Gujr": return "Gujarati"
+case "Guru": return "Gurmukhi"
+case "Hani": return "Han"
+case "Hans": return "Han (Simplified)"
+case "Hant": return "Han (Traditional)"
+case "Hebr": return "Hebrew"
+case "Jpan": return "Japanese (Han + Hiragana + Katakana)"
+case "Khmr": return "Khmer"
+case "Knda": return "Kannada"
+case "Kore": return "Korean (Hangul + Han)"
+case "Laoo": return "Lao"
+case "Latn": return "Latin"
+case "Mlym": return "Malayalam"
+case "Mymr": return "Myanmar"
+case "Orya": return "Oriya"
+case "Piqd": return "Klingon (pIqaD)"
+case "Sinh": return "Sinhala"
+case "Taml": return "Tamil"
+case "Telu": return "Telugu"
+case "Thai": return "Thai"
+case "Tibt": return "Tibetan"
+default: return "Unknown"
+}
+}
+function getDetails(code,    group, iso, language, script) {
+if (code == "auto" || !getCode(code)) {
+e("[ERROR] Language not found: " code "\n"\
+"        Run '-reference / -R' to see a list of available languages.")
+exit 1
+}
+script = scriptName(getScript(code))
+if (isRTL(code)) script = script " (R-to-L)"
+split(getISO(code), group, "-")
+iso = group[1]
+split(getName(code), group, " ")
+language = length(group) == 1 ? group[1] "_language" :
+group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_")
+return ansi("bold", sprintf("%s\n", getDisplay(code)))\
+sprintf("%-22s%s\n", "Name", ansi("bold", getName(code)))\
+sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code)))\
+sprintf("%-22s%s\n", "Writing system", ansi("bold", script))\
+sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code)))\
+sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso))\
+sprintf("%-22s%s\n", "SIL", ansi("bold", "http://www-01.sil.org/iso639-3/documentation.asp?id=" iso))\
+sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ?
+ansi("bold", "http://glottolog.org/resource/languoid/id/" getGlotto(code)) : "")\
+sprintf("%-22s%s", "Wikipedia", ansi("bold", "http://en.wikipedia.org/wiki/" language))
+}
+function showPhonetics(phonetics, code) {
+if (code && getCode(code) == "en")
+return "/" phonetics "/"
+else
+return "(" phonetics ")"
+}
+function show(text, code,    temp) {
+if (!code || isRTL(code)) {
+if (Cache[text][0])
+return Cache[text][0]
+else {
+if ((FriBidi || (code && isRTL(code))) && BiDiNoPad)
+("echo " parameterize(text) PIPE BiDiNoPad) | getline temp
+else
+temp = text
+return Cache[text][0] = temp
+}
+} else
+return text
+}
+function s(text, code, width,    temp) {
+if (!code || isRTL(code)) {
+if (!width) width = Option["width"]
+if (Cache[text][width])
+return Cache[text][width]
+else {
+if ((FriBidi || (code && isRTL(code))) && BiDi)
+("echo " parameterize(text) PIPE sprintf(BiDi, width)) | getline temp
+else
+temp = text
+return Cache[text][width] = temp
+}
+} else
+return text
+}
+function ins(level, text, code, width,    i, temp) {
+if (code && isRTL(code)) {
+if (!width) width = Option["width"]
+return s(text, code, width - Option["indent"] * level)
+} else
+return replicate(" ", Option["indent"] * level) text
+}
+function parseLang(lang,    code, group) {
+match(lang, /^([a-z][a-z][a-z]?)(_|$)/, group)
+code = getCode(group[1])
+if (lang ~ /^zh_(CN|SG)/) code = "zh-CN"
+else if (lang ~ /^zh_(TW|HK)/) code = "zh-TW"
+if (!code) code = "en"
+return code
+}
+function initUserLang(    lang, utf) {
+if (lang = ENVIRON["LANGUAGE"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (lang = ENVIRON["LC_ALL"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (lang = ENVIRON["LANG"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (!UserLocale) {
+UserLocale = "en_US.UTF-8"
+utf = 1
+}
+if (!utf)
+w("[WARNING] Your locale codeset (" UserLocale ") is not UTF-8.")
+UserLang = parseLang(UserLocale)
+}
+function getVersion(    build, gitHead, platform) {
+initAudioPlayer()
+initPager()
+platform = detectProgram("uname", "-s", 1)
+if (ENVIRON["TRANS_BUILD"])
+build = "-" ENVIRON["TRANS_BUILD"]
+else {
+gitHead = getGitHead()
+build = gitHead ? "-git:" gitHead : ""
+}
+return ansi("bold", sprintf("%-22s%s%s\n\n", Name, Version, build))\
+sprintf("%-22s%s\n", "platform", platform)\
+sprintf("%-22s%s\n", "gawk (GNU Awk)", PROCINFO["version"])\
+sprintf("%s\n", FriBidi ? FriBidi :
+"fribidi (GNU FriBidi) [NOT INSTALLED]")\
+sprintf("%-22s%s\n", "audio player", AudioPlayer ? AudioPlayer :
+"[NOT INSTALLED]")\
+sprintf("%-22s%s\n", "terminal pager", Pager ? Pager :
+"[NOT INSTALLED]")\
+sprintf("%-22s%s\n", "terminal type", ENVIRON["TERM"])\
+sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang))\
+sprintf("%-22s%s\n", "home language", Option["hl"])\
+sprintf("%-22s%s\n", "source language", Option["sl"])\
+sprintf("%-22s%s\n", "target language", join(Option["tl"], "+"))\
+sprintf("%-22s%s\n", "translation engine", Option["engine"])\
+sprintf("%-22s%s\n", "proxy", Option["proxy"] ? Option["proxy"] :
+"[NONE]")\
+sprintf("%-22s%s\n", "user-agent", Option["user-agent"] ? Option["user-agent"] :
+"[NONE]")\
+sprintf("%-22s%s\n", "theme", Option["theme"])\
+sprintf("%-22s%s\n", "init file", InitScript ? InitScript : "[NONE]")\
+sprintf("\n%-22s%s", "Report bugs to:", "https://github.com/soimort/translate-shell/issues")
+}
+function getHelp() {
+return "Usage:  " ansi("bold", Command)\
+" [" ansi("underline", "OPTIONS") "]"\
+" [" ansi("underline", "SOURCE") "]"\
+":[" ansi("underline", "TARGETS") "]"\
+" [" ansi("underline", "TEXT") "]..." RS\
+RS "Information options:" RS\
+ins(1, ansi("bold", "-V") ", " ansi("bold", "-version")) RS\
+ins(2, "Print version and exit.") RS\
+ins(1, ansi("bold", "-H") ", " ansi("bold", "-help")) RS\
+ins(2, "Print help message and exit.") RS\
+ins(1, ansi("bold", "-M") ", " ansi("bold", "-man")) RS\
+ins(2, "Show man page and exit.") RS\
+ins(1, ansi("bold", "-T") ", " ansi("bold", "-reference")) RS\
+ins(2, "Print reference table of languages and exit.") RS\
+ins(1, ansi("bold", "-R") ", " ansi("bold", "-reference-english")) RS\
+ins(2, "Print reference table of languages (in English names) and exit.") RS\
+ins(1, ansi("bold", "-L ") ansi("underline", "CODES")\
+", " ansi("bold", "-list ") ansi("underline", "CODES")) RS\
+ins(2, "Print details of languages and exit.") RS\
+ins(1, ansi("bold", "-S") ", " ansi("bold", "-list-engines")) RS\
+ins(2, "List available translation engines and exit.") RS\
+ins(1, ansi("bold", "-U") ", " ansi("bold", "-upgrade")) RS\
+ins(2, "Check for upgrade of this program.") RS\
+RS "Translator options:" RS\
+ins(1, ansi("bold", "-e ") ansi("underline", "ENGINE")\
+", " ansi("bold", "-engine ") ansi("underline", "ENGINE")) RS\
+ins(2, "Specify the translation engine to use.") RS\
+RS "Display options:" RS\
+ins(1, ansi("bold", "-verbose")) RS\
+ins(2, "Verbose mode. (default)") RS\
+ins(1, ansi("bold", "-b") ", " ansi("bold", "-brief")) RS\
+ins(2, "Brief mode.") RS\
+ins(1, ansi("bold", "-d") ", " ansi("bold", "-dictionary")) RS\
+ins(2, "Dictionary mode.") RS\
+ins(1, ansi("bold", "-identify")) RS\
+ins(2, "Language identification.") RS\
+ins(1, ansi("bold", "-show-original ") ansi("underline", "Y/n")) RS\
+ins(2, "Show original text or not.") RS\
+ins(1, ansi("bold", "-show-original-phonetics ") ansi("underline", "Y/n")) RS\
+ins(2, "Show phonetic notation of original text or not.") RS\
+ins(1, ansi("bold", "-show-translation ") ansi("underline", "Y/n")) RS\
+ins(2, "Show translation or not.") RS\
+ins(1, ansi("bold", "-show-translation-phonetics ") ansi("underline", "Y/n")) RS\
+ins(2, "Show phonetic notation of translation or not.") RS\
+ins(1, ansi("bold", "-show-prompt-message ") ansi("underline", "Y/n")) RS\
+ins(2, "Show prompt message or not.") RS\
+ins(1, ansi("bold", "-show-languages ") ansi("underline", "Y/n")) RS\
+ins(2, "Show source and target languages or not.") RS\
+ins(1, ansi("bold", "-show-original-dictionary ") ansi("underline", "y/N")) RS\
+ins(2, "Show dictionary entry of original text or not.") RS\
+ins(1, ansi("bold", "-show-dictionary ") ansi("underline", "Y/n")) RS\
+ins(2, "Show dictionary entry of translation or not.") RS\
+ins(1, ansi("bold", "-show-alternatives ") ansi("underline", "Y/n")) RS\
+ins(2, "Show alternative translations or not.") RS\
+ins(1, ansi("bold", "-w ") ansi("underline", "NUM")\
+", " ansi("bold", "-width ") ansi("underline", "NUM")) RS\
+ins(2, "Specify the screen width for padding.") RS\
+ins(1, ansi("bold", "-indent ") ansi("underline", "NUM")) RS\
+ins(2, "Specify the size of indent (number of spaces).") RS\
+ins(1, ansi("bold", "-theme ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the theme to use.") RS\
+ins(1, ansi("bold", "-no-theme")) RS\
+ins(2, "Do not use any other theme than default.") RS\
+ins(1, ansi("bold", "-no-ansi")) RS\
+ins(2, "Do not use ANSI escape codes.") RS\
+ins(1, ansi("bold", "-no-autocorrect")) RS\
+ins(2, "Do not autocorrect. (if defaulted by the translation engine)") RS\
+ins(1, ansi("bold", "-no-bidi")) RS\
+ins(2, "Do not convert bidirectional texts.") RS\
+ins(1, ansi("bold", "-no-warn")) RS\
+ins(2, "Do not write warning messages to stderr.") RS\
+ins(1, ansi("bold", "-dump")) RS\
+ins(2, "Print raw API response instead.") RS\
+RS "Audio options:" RS\
+ins(1, ansi("bold", "-p, -play")) RS\
+ins(2, "Listen to the translation.") RS\
+ins(1, ansi("bold", "-speak")) RS\
+ins(2, "Listen to the original text.") RS\
+ins(1, ansi("bold", "-n ") ansi("underline", "VOICE")\
+", " ansi("bold", "-narrator ") ansi("underline", "VOICE")) RS\
+ins(2, "Specify the narrator, and listen to the translation.") RS\
+ins(1, ansi("bold", "-player ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the audio player to use, and listen to the translation.") RS\
+ins(1, ansi("bold", "-no-play")) RS\
+ins(2, "Do not listen to the translation.") RS\
+ins(1, ansi("bold", "-no-translate")) RS\
+ins(2, "Do not translate anything when using -speak.") RS\
+ins(1, ansi("bold", "-download-audio")) RS\
+ins(2, "Download the audio to the current directory.") RS\
+ins(1, ansi("bold", "-download-audio-as ") ansi("underline", "FILENAME")) RS\
+ins(2, "Download the audio to the specified file.") RS\
+RS "Terminal paging and browsing options:" RS\
+ins(1, ansi("bold", "-v") ", " ansi("bold", "-view")) RS\
+ins(2, "View the translation in a terminal pager.") RS\
+ins(1, ansi("bold", "-pager ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the terminal pager to use, and view the translation.") RS\
+ins(1, ansi("bold", "-no-view")) RS\
+ins(2, "Do not view the translation in a terminal pager.") RS\
+ins(1, ansi("bold", "-browser ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the web browser to use.") RS\
+RS "Networking options:" RS\
+ins(1, ansi("bold", "-x ") ansi("underline", "HOST:PORT")\
+", " ansi("bold", "-proxy ") ansi("underline", "HOST:PORT")) RS\
+ins(2, "Use HTTP proxy on given port.") RS\
+ins(1, ansi("bold", "-u ") ansi("underline", "STRING")\
+", " ansi("bold", "-user-agent ") ansi("underline", "STRING")) RS\
+ins(2, "Specify the User-Agent to identify as.") RS\
+RS "Interactive shell options:" RS\
+ins(1, ansi("bold", "-I") ", " ansi("bold", "-interactive") ", " ansi("bold", "-shell")) RS\
+ins(2, "Start an interactive shell.") RS\
+ins(1, ansi("bold", "-E") ", " ansi("bold", "-emacs")) RS\
+ins(2, "Start the GNU Emacs front-end for an interactive shell.") RS\
+ins(1, ansi("bold", "-no-rlwrap")) RS\
+ins(2, "Do not invoke rlwrap when starting an interactive shell.") RS\
+RS "I/O options:" RS\
+ins(1, ansi("bold", "-i ") ansi("underline", "FILENAME")\
+", " ansi("bold", "-input ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the input file.") RS\
+ins(1, ansi("bold", "-o ") ansi("underline", "FILENAME")\
+", " ansi("bold", "-output ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the output file.") RS\
+RS "Language preference options:" RS\
+ins(1, ansi("bold", "-l ") ansi("underline", "CODE")\
+", " ansi("bold", "-hl ") ansi("underline", "CODE")\
+", " ansi("bold", "-lang ") ansi("underline", "CODE")) RS\
+ins(2, "Specify your home language.") RS\
+ins(1, ansi("bold", "-s ") ansi("underline", "CODE")\
+", " ansi("bold", "-sl ") ansi("underline", "CODE")\
+", " ansi("bold", "-source ") ansi("underline", "CODE")\
+", " ansi("bold", "-from ") ansi("underline", "CODE")) RS\
+ins(2, "Specify the source language.") RS\
+ins(1, ansi("bold", "-t ") ansi("underline", "CODES")\
+", " ansi("bold", "-tl ") ansi("underline", "CODE")\
+", " ansi("bold", "-target ") ansi("underline", "CODES")\
+", " ansi("bold", "-to ") ansi("underline", "CODES")) RS\
+ins(2, "Specify the target language(s), joined by '+'.") RS\
+RS "Other options:" RS\
+ins(1, ansi("bold", "-no-init")) RS\
+ins(2, "Do not load any initialization script.") RS\
+RS "See the man page " Command "(1) for more information."
+}
+function showMan(    temp) {
+if (ENVIRON["TRANS_MANPAGE"]) {
+initPager()
+Groff = detectProgram("groff", "--version")
+if (Pager && Groff) {
+temp = "echo -E \"${TRANS_MANPAGE}\""
+temp = temp PIPE\
+Groff " -Wall -mtty-char -mandoc -Tutf8 "\
+"-rLL=" Option["width"] "n -rLT=" Option["width"] "n"
+switch (Pager) {
+case "less":
+temp = temp PIPE\
+Pager " -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\""
+break
+case "most":
+temp = temp PIPE Pager " -Cs"
+break
+default:
+temp = temp PIPE Pager
+}
+system(temp)
+return
+}
+}
+if (fileExists(ENVIRON["TRANS_DIR"] "/man/" Command ".1"))
+system("man " parameterize(ENVIRON["TRANS_DIR"] "/man/" Command ".1") SUPERR)
+else if (system("man " Command SUPERR))
+print getHelp()
+}
+function getReference(displayName,
+code, col, cols, i, j, name, num, r, rows, saveSortedIn,
+t1, t2) {
+num = 0
+for (code in Locale)
+if (Locale[code]["support"] != "unstable")
+num++
+rows = int(num / 3) + (num % 3 ? 1 : 0)
+cols[0][0] = cols[1][0] = cols[2][0] = NULLSTR
+i = 0
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = displayName == "endonym" ? "@ind_num_asc" :
+"compName"
+for (code in Locale) {
+if (Locale[code]["support"] != "unstable") {
+col = int(i / rows)
+append(cols[col], code)
+i++
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+if (displayName == "endonym") {
+r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+for (i = 0; i < rows; i++) {
+r = r "│"
+for (j = 0; j < 3; j++) {
+if (cols[j][i]) {
+t1 = getDisplay(cols[j][i])
+switch (cols[j][i]) {
+case "he":
+t1 = sprintf(" %-18s", t1)
+break
+case "ur":
+t1 = sprintf(" %-17s", t1)
+break
+case "hi": case "gu": case "km": case "kn":
+case "my": case "ne": case "pa": case "si":
+case "ta": case "te": case "yi":
+t1 = sprintf(" %-16s", t1)
+break
+case "yue":
+t1 = sprintf(" %-13s", t1)
+break
+case "ja": case "ko":
+t1 = sprintf(" %-12s", t1)
+break
+case "zh-CN": case "zh-TW":
+t1 = sprintf(" %-11s", t1)
+break
+default:
+if (length(t1) <= 15)
+t1 = sprintf(" %-15s", t1)
+}
+switch (length(cols[j][i])) {
+case 1: case 2: case 3: case 4:
+t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i])))
+break
+case 5:
+t2 = sprintf("- %s│", ansi("bold", cols[j][i]))
+break
+case 6:
+t2 = sprintf("-%s│", ansi("bold", cols[j][i]))
+break
+case 7:
+t2 = sprintf("-%s", ansi("bold", cols[j][i]))
+break
+default:
+t2 = ansi("bold", cols[j][i])
+}
+r = r t1 t2
+} else
+r = r sprintf("%23s│", NULLSTR)
+}
+r = r RS
+}
+r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+} else {
+r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+for (i = 0; i < rows; i++) {
+r = r "│"
+for (j = 0; j < 3; j++) {
+if (cols[j][i]) {
+t1 = getName(cols[j][i])
+if (length(t1) > 15)
+t1 = substr(t1, 1, 12) "..."
+t1 = sprintf(" %-15s", t1)
+switch (length(cols[j][i])) {
+case 1: case 2: case 3: case 4:
+t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i])))
+break
+case 5:
+t2 = sprintf("- %s│", ansi("bold", cols[j][i]))
+break
+case 6:
+t2 = sprintf("-%s│", ansi("bold", cols[j][i]))
+break
+case 7:
+t2 = sprintf("-%s", ansi("bold", cols[j][i]))
+break
+default:
+t2 = ansi("bold", cols[j][i])
+}
+r = r t1 t2
+} else
+r = r sprintf("%23s│", NULLSTR)
+}
+r = r RS
+}
+r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+}
+return r
+}
+function getList(codes,    code, i, r, saveSortedIn) {
+r = NULLSTR
+if (!isarray(codes))
+r = getDetails(codes)
+else if (anything(codes)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in codes)
+r = (r ? r RS prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])) RS\
+: r) getDetails(codes[i])
+PROCINFO["sorted_in"] = saveSortedIn
+} else
+r = getDetails(Option["hl"])
+return r
+}
+function tokenize(returnTokens, string,
+delimiters,
+newlines,
+quotes,
+escapeChars,
+leftBlockComments,
+rightBlockComments,
+lineComments,
+reservedOperators,
+reservedPatterns,
+blockCommenting,
+c,
+currentToken,
+escaping,
+i,
+lineCommenting,
+p,
+quoting,
+r,
+s,
+tempGroup,
+tempPattern,
+tempString) {
+if (!delimiters[0]) {
+delimiters[0] = " "
+delimiters[1] = "\t"
+delimiters[2] = "\v"
+}
+if (!newlines[0]) {
+newlines[0] = "\n"
+newlines[1] = "\r"
+}
+if (!quotes[0]) {
+quotes[0] = "\""
+}
+if (!escapeChars[0]) {
+escapeChars[0] = "\\"
+}
+if (!leftBlockComments[0]) {
+leftBlockComments[0] = "#|"
+leftBlockComments[1] = "/*"
+leftBlockComments[2] = "(*"
+}
+if (!rightBlockComments[0]) {
+rightBlockComments[0] = "|#"
+rightBlockComments[1] = "*/"
+rightBlockComments[2] = "*)"
+}
+if (!lineComments[0]) {
+lineComments[0] = ";"
+lineComments[1] = "//"
+lineComments[2] = "#"
+}
+if (!reservedOperators[0]) {
+reservedOperators[0] = "("
+reservedOperators[1] = ")"
+reservedOperators[2] = "["
+reservedOperators[3] = "]"
+reservedOperators[4] = "{"
+reservedOperators[5] = "}"
+reservedOperators[6] = ","
+}
+if (!reservedPatterns[0]) {
+reservedPatterns[0] = "[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?"
+reservedPatterns[1] = "[+-]?0[0-7]+([.][0-7]*)?"
+reservedPatterns[2] = "[+-]?0[Xx][0-9A-Fa-f]+([.][0-9A-Fa-f]*)?"
+}
+split(string, s, "")
+currentToken = ""
+quoting = escaping = blockCommenting = lineCommenting = 0
+p = 0
+i = 1
+while (i <= length(s)) {
+c = s[i]
+r = substr(string, i)
+if (blockCommenting) {
+if (tempString = startsWithAny(r, rightBlockComments))
+blockCommenting = 0
+i++
+} else if (lineCommenting) {
+if (belongsTo(c, newlines))
+lineCommenting = 0
+i++
+} else if (quoting) {
+currentToken = currentToken c
+if (escaping) {
+escaping = 0
+} else {
+if (belongsTo(c, quotes)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+quoting = 0
+} else if (belongsTo(c, escapeChars)) {
+escaping = 1
+} else {
+}
+}
+i++
+} else {
+if (belongsTo(c, delimiters) || belongsTo(c, newlines)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+i++
+} else if (belongsTo(c, quotes)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+}
+currentToken = c
+quoting = 1
+i++
+} else if (tempString = startsWithAny(r, leftBlockComments)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+blockCommenting = 1
+i += length(tempString)
+} else if (tempString = startsWithAny(r, lineComments)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+lineCommenting = 1
+i += length(tempString)
+} else if (tempString = startsWithAny(r, reservedOperators)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+returnTokens[p++] = tempString
+i += length(tempString)
+} else if (tempPattern = matchesAny(r, reservedPatterns)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+match(r, "^" tempPattern, tempGroup)
+returnTokens[p++] = tempGroup[0]
+i += length(tempGroup[0])
+} else {
+currentToken = currentToken c
+i++
+}
+}
+}
+if (currentToken)
+returnTokens[p++] = currentToken
+}
+function parseJsonArray(returnAST, tokens,
+leftBrackets,
+rightBrackets,
+separators,
+i, j, key, p, stack, token) {
+if (!leftBrackets[0]) {
+leftBrackets[0] = "("
+leftBrackets[1] = "["
+leftBrackets[2] = "{"
+}
+if (!rightBrackets[0]) {
+rightBrackets[0] = ")"
+rightBrackets[1] = "]"
+rightBrackets[2] = "}"
+}
+if (!separators[0]) {
+separators[0] = ","
+}
+stack[p = 0] = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, leftBrackets))
+stack[++p] = 0
+else if (belongsTo(token, rightBrackets))
+--p
+else if (belongsTo(token, separators))
+stack[p]++
+else {
+key = stack[0]
+for (j = 1; j <= p; j++)
+key = key SUBSEP stack[j]
+returnAST[key] = token
+}
+}
+}
+function parseJson(returnAST, tokens,
+arrayStartTokens, arrayEndTokens,
+objectStartTokens, objectEndTokens,
+commas, colons,
+flag, i, j, key, name, p, stack, token) {
+if (!arrayStartTokens[0])  arrayStartTokens[0]  = "["
+if (!arrayEndTokens[0])    arrayEndTokens[0]    = "]"
+if (!objectStartTokens[0]) objectStartTokens[0] = "{"
+if (!objectEndTokens[0])   objectEndTokens[0]   = "}"
+if (!commas[0])            commas[0]            = ","
+if (!colons[0])            colons[0]            = ":"
+stack[p = 0] = 0
+flag = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, arrayStartTokens)) {
+stack[++p] = 0
+} else if (belongsTo(token, objectStartTokens)) {
+stack[++p] = NULLSTR
+flag = 0
+} else if (belongsTo(token, objectEndTokens) ||
+belongsTo(token, arrayEndTokens)) {
+--p
+} else if (belongsTo(token, commas)) {
+if (isnum(stack[p]))
+stack[p]++
+else
+flag = 0
+} else if (belongsTo(token, colons)) {
+flag = 1
+} else if (isnum(stack[p]) || flag) {
+key = stack[0]
+for (j = 1; j <= p; j++)
+key = key SUBSEP stack[j]
+returnAST[key] = token
+flag = 0
+} else {
+stack[p] = unparameterize(token)
+}
+}
+}
+function parseList(returnAST, tokens,
+leftBrackets,
+rightBrackets,
+separators,
+i, j, key, p, stack, token) {
+if (!leftBrackets[0]) {
+leftBrackets[0] = "("
+leftBrackets[1] = "["
+leftBrackets[2] = "{"
+}
+if (!rightBrackets[0]) {
+rightBrackets[0] = ")"
+rightBrackets[1] = "]"
+rightBrackets[2] = "}"
+}
+if (!separators[0]) {
+separators[0] = ","
+}
+stack[p = 0] = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, leftBrackets)) {
+stack[++p] = 0
+} else if (belongsTo(token, rightBrackets)) {
+stack[--p]++
+} else if (belongsTo(token, separators)) {
+} else {
+key = NULLSTR
+if (p > 0) {
+for (j = 0; j < p - 1; j++)
+key = key SUBSEP stack[j]
+returnAST[key][stack[p - 1]] = NULLSTR
+key = key SUBSEP stack[p - 1]
+}
+returnAST[key][stack[p]] = token
+stack[p]++
+}
+}
+}
+function prettify(name, string,    i, temp) {
+temp = string
+if ("sgr-" name in Option)
+if (isarray(Option["sgr-" name]))
+for (i in Option["sgr-" name])
+temp = ansi(Option["sgr-" name][i], temp)
+else
+temp = ansi(Option["sgr-" name], temp)
+return temp
+}
+function randomColor(    i) {
+i = int(5 * rand())
+switch (i) {
+case 0: return "green"
+case 1: return "yellow"
+case 2: return "blue"
+case 3: return "magenta"
+case 4: return "cyan"
+default: return "default"
+}
+}
+function setRandomTheme(    i, n, temp) {
+srand(systime())
+for (i = 0; i < 3; i++) {
+do temp = randomColor(); while (belongsTo(temp, n))
+n[i] = temp
+}
+Option["sgr-prompt-message"] = Option["sgr-languages"] = n[0]
+Option["sgr-original-dictionary-detailed-word-class"][1] = n[0]
+Option["sgr-original-dictionary-detailed-word-class"][2] = "bold"
+Option["sgr-original-dictionary-synonyms"] = n[0]
+Option["sgr-original-dictionary-synonyms-word-class"][1] = n[0]
+Option["sgr-original-dictionary-synonyms-word-class"][2] = "bold"
+Option["sgr-original-dictionary-examples"] = n[0]
+Option["sgr-original-dictionary-see-also"] = n[0]
+Option["sgr-dictionary-word-class"][1] = n[0]
+Option["sgr-dictionary-word-class"][2] = "bold"
+Option["sgr-original"][1] = Option["sgr-original-phonetics"][1] = n[1]
+Option["sgr-original"][2] = Option["sgr-original-phonetics"][2] = "bold"
+Option["sgr-prompt-message-original"][1] = n[1]
+Option["sgr-prompt-message-original"][2] = "bold"
+Option["sgr-languages-sl"] = n[1]
+Option["sgr-original-dictionary-detailed-explanation"][1] = n[1]
+Option["sgr-original-dictionary-detailed-explanation"][2] = "bold"
+Option["sgr-original-dictionary-detailed-example"] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms"] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms-item"][1] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms-item"][2] = "bold"
+Option["sgr-original-dictionary-synonyms-synonyms"] = n[1]
+Option["sgr-original-dictionary-synonyms-synonyms-item"][1] = n[1]
+Option["sgr-original-dictionary-synonyms-synonyms-item"][2] = "bold"
+Option["sgr-original-dictionary-examples-example"] = n[1]
+Option["sgr-original-dictionary-examples-original"][1] = n[1]
+Option["sgr-original-dictionary-examples-original"][2] = "bold"
+Option["sgr-original-dictionary-examples-original"][3] = "underline"
+Option["sgr-original-dictionary-see-also-phrases"] = n[1]
+Option["sgr-original-dictionary-see-also-phrases-item"][1] = n[1]
+Option["sgr-original-dictionary-see-also-phrases-item"][2] = "bold"
+Option["sgr-dictionary-explanation"] = n[1]
+Option["sgr-dictionary-explanation-item"][1] = n[1]
+Option["sgr-dictionary-explanation-item"][2] = "bold"
+Option["sgr-alternatives-original"][1] = n[1]
+Option["sgr-alternatives-original"][2] = "bold"
+Option["sgr-translation"][1] = Option["sgr-translation-phonetics"][1] = n[2]
+Option["sgr-translation"][2] = Option["sgr-translation-phonetics"][2] = "bold"
+Option["sgr-languages-tl"] = n[2]
+Option["sgr-dictionary-word"][1] = n[2]
+Option["sgr-dictionary-word"][2] = "bold"
+Option["sgr-alternatives-translations"] = n[2]
+Option["sgr-alternatives-translations-item"][1] = n[2]
+Option["sgr-alternatives-translations-item"][2] = "bold"
+Option["sgr-brief-translation"][1] = Option["sgr-brief-translation-phonetics"][1] = n[2]
+Option["sgr-brief-translation"][2] = Option["sgr-brief-translation-phonetics"][2] = "bold"
+Option["fmt-welcome-message"] = Name
+Option["sgr-welcome-message"][1] = n[0]
+Option["sgr-welcome-message"][2] = "bold"
+Option["fmt-welcome-submessage"] = "(:q to quit)"
+Option["sgr-welcome-submessage"] = n[0]
+Option["fmt-prompt"] = "%s> "
+Option["sgr-prompt"][1] = n[1]
+Option["sgr-prompt"][2] = "bold"
+}
+function setDefaultTheme() {
+Option["sgr-translation"] = Option["sgr-translation-phonetics"] = "bold"
+Option["sgr-prompt-message-original"] = "underline"
+Option["sgr-languages-sl"] = "underline"
+Option["sgr-languages-tl"] = "bold"
+Option["sgr-original-dictionary-detailed-explanation"] = "bold"
+Option["sgr-original-dictionary-detailed-synonyms-item"] = "bold"
+Option["sgr-original-dictionary-synonyms-synonyms-item"] = "bold"
+Option["sgr-original-dictionary-examples-original"][1] = "bold"
+Option["sgr-original-dictionary-examples-original"][2] = "underline"
+Option["sgr-original-dictionary-see-also-phrases-item"] = "bold"
+Option["sgr-dictionary-word"] = "bold"
+Option["sgr-alternatives-original"] = "underline"
+Option["sgr-alternatives-translations-item"] = "bold"
+Option["fmt-welcome-message"] = Name
+Option["sgr-welcome-message"] = "bold"
+Option["fmt-welcome-submessage"] = "(:q to quit)"
+Option["fmt-prompt"] = "%s> "
+Option["sgr-prompt"] = "bold"
+}
+function setTheme(    file, line, script) {
+if (Option["theme"] && Option["theme"] != "default"\
+&& Option["theme"] != "none" && Option["theme"] != "random") {
+file = Option["theme"]
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.translate-shell/" Option["theme"]
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.config/translate-shell/" Option["theme"]
+if (!fileExists(file)) return
+}
+}
+}
+if (file && fileExists(file)) {
+script = NULLSTR
+while (getline line < file)
+script = script "\n" line
+loadOptions(script)
+} else if (Option["theme"] == "none")
+;
+else if (Option["theme"] == "random")
+setRandomTheme()
+else
+setDefaultTheme()
+}
+function provides(engineName) {
+Translator[tolower(engineName)] = TRUE
+}
+function engineMethod(methodName,    engine, translator) {
+if (!Translator[Option["engine"]]) {
+engine = tolower(Option["engine"])
+if (!Translator[engine])
+for (translator in Translator)
+if (Translator[translator] &&
+translator ~ "^"engine) {
+engine = translator
+break
+}
+if (!Translator[engine]) {
+e("[ERROR] Translator not found: " Option["engine"] "\n"\
+"        Run '-list-engines / -S' to see a list of available engines.")
+exit 1
+}
+Option["engine"] = engine
+}
+return Option["engine"] methodName
+}
+function initAudioPlayer() {
+AudioPlayer = !system("mpv" SUPOUT SUPERR) ?
+"mpv --loop-file=no" :
+(!system("mplayer" SUPOUT SUPERR) ?
+"mplayer" :
+(!system("mpg123 --version" SUPOUT SUPERR) ?
+"mpg123" :
+""))
+}
+function initSpeechSynthesizer() {
+SpeechSynthesizer = !system("say ''" SUPOUT SUPERR) ?
+"say" :
+(!system("espeak ''" SUPOUT SUPERR) ?
+"espeak" :
+"")
+}
+function initPager() {
+Pager = !system("less -V" SUPOUT SUPERR) ?
+"less" :
+(!system("more -V" SUPOUT SUPERR) ?
+"more" :
+(!system("most" SUPOUT SUPERR) ?
+"most" :
+""))
+}
+function initHttpService() {
+_Init()
+if (Option["proxy"]) {
+match(Option["proxy"], /^(http:\/*)?(([^:]+):([^@]+)@)?([^\/]*):([^\/:]*)/, HttpProxySpec)
+HttpAuthUser = HttpProxySpec[3]
+HttpAuthPass = HttpProxySpec[4]
+HttpAuthCredentials = base64(unquote(HttpAuthUser) ":" HttpAuthPass)
+HttpService = "/inet/tcp/0/" HttpProxySpec[5] "/" HttpProxySpec[6]
+HttpPathPrefix = HttpProtocol HttpHost
+} else {
+HttpService = "/inet/tcp/0/" HttpHost "/" HttpPort
+HttpPathPrefix = ""
+}
+}
+function preprocess(text) {
+return quote(text)
+}
+function postprocess(text) {
+text = gensub(/ ([.,;:?!"])/, "\\1", "g", text)
+text = gensub(/(["]) /, "\\1", "g", text)
+return text
+}
+function getResponse(text, sl, tl, hl,
+content, header, isBody, url, group, status, location) {
+url = _RequestUrl(text, sl, tl, hl)
+header = "GET " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+if (HttpAuthUser && HttpAuthPass)
+header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
+content = NULLSTR; isBody = 0
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), $0))
+}
+close(HttpService)
+if ((status == "301" || status == "302") && location)
+content = curl(location)
+return assert(content, "[ERROR] Null response.")
+}
+function postResponse(text, sl, tl, hl, type,
+content, contentLength, contentType, group,
+header, isBody, reqBody, url, status, location) {
+url = _PostRequestUrl(text, sl, tl, hl, type)
+contentType = _PostRequestContentType(text, sl, tl, hl, type)
+reqBody = _PostRequestBody(text, sl, tl, hl, type)
+if (DumpContentengths[reqBody])
+contentLength = DumpContentengths[reqBody]
+else
+contentLength = DumpContentengths[reqBody] = dump(reqBody, group)
+header = "POST " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"\
+"Content-Length: " contentLength "\r\n"\
+"Content-Type: " contentType "\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+if (HttpAuthUser && HttpAuthPass)
+header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
+content = NULLSTR; isBody = 0
+print (header "\r\n" reqBody) |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), $0))
+}
+close(HttpService)
+if (status == "404") {
+e("[ERROR] 404 Not Found")
+exit 1
+}
+if ((status == "301" || status == "302") && location) {
+url = "https" substr(url, 5)
+content = curlPost(url, reqBody)
+}
+return content
+}
+function p(string) {
+if (Option["view"])
+print string | Option["pager"]
+else
+print string > Option["output"]
+}
+function play(text, tl,    url) {
+url = _TTSUrl(text, tl)
+system(Option["player"] " " parameterize(url) SUPOUT SUPERR)
+}
+function download_audio(text, tl,    url, output) {
+url = _TTSUrl(text, tl)
+if (Option["download-audio-as"])
+output = Option["download-audio-as"]
+else
+output = text " [" Option["engine"] "] (" Option["narrator"] ").ts"
+if (url ~ /^\//)
+system("mv -- " parameterize(url) " " parameterize(output))
+else
+curl(url, output)
+}
+function getTranslation(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return _Translate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl)
+}
+function fileTranslation(uri,    group, temp1, temp2) {
+temp1 = Option["input"]
+temp2 = Option["verbose"]
+match(uri, /^file:\/\/(.*)/, group)
+Option["input"] = group[1]
+Option["verbose"] = 0
+translateMain()
+Option["input"] = temp1
+Option["verbose"] = temp2
+}
+function webTranslation(uri, sl, tl, hl) {
+system(Option["browser"] " "\
+parameterize(_WebTranslateUrl(uri, sl, tl, hl)) "&")
+}
+function translate(text, inline,
+i, j, playlist, il, saveSortedIn) {
+if (!getCode(Option["hl"])) {
+w("[WARNING] Unknown language code: " Option["hl"] ", fallback to English: en")
+Option["hl"] = "en"
+} else if (isRTL(Option["hl"])) {
+if (!FriBidi)
+w("[WARNING] " getName(Option["hl"]) " is a right-to-left language, but FriBidi is not found.")
+}
+if (!getCode(Option["sl"])) {
+w("[WARNING] Unknown source language code: " Option["sl"])
+} else if (isRTL(Option["sl"])) {
+if (!FriBidi)
+w("[WARNING] " getName(Option["sl"]) " is a right-to-left language, but FriBidi is not found.")
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in Option["tl"]) {
+if (!Option["interactive"])
+if (Option["verbose"] && i > 1)
+p(prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])))
+if (inline &&
+startsWithAny(text, UriSchemes) == "file://") {
+fileTranslation(text)
+} else if (inline &&
+startsWithAny(text, UriSchemes) == "http://" ||
+startsWithAny(text, UriSchemes) == "https://") {
+webTranslation(text, Option["sl"], Option["tl"][i], Option["hl"])
+} else {
+if (!Option["no-translate"])
+p(getTranslation(text, Option["sl"], Option["tl"][i], Option["hl"], Option["verbose"], Option["play"] || Option["download-audio"], playlist, il))
+else
+il[0] = Option["sl"] == "auto" ? "en" : Option["sl"]
+if (Option["play"] == 1) {
+if (Option["player"])
+for (j in playlist)
+play(playlist[j]["text"], playlist[j]["tl"])
+else if (SpeechSynthesizer)
+for (j in playlist)
+print playlist[j]["text"] | SpeechSynthesizer
+} else if (Option["play"] == 2) {
+if (Option["player"])
+play(text, il[0])
+else if (SpeechSynthesizer)
+print text | SpeechSynthesizer
+}
+if (Option["download-audio"] == 1) {
+if (Option["play"] != 2 && !Option["no-translate"])
+download_audio(playlist[length(playlist) - 1]["text"],\
+playlist[length(playlist) - 1]["tl"])
+else
+download_audio(text, il[0])
+}
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+}
+function translateMain(    i, line) {
+if (Option["interactive"])
+prompt()
+if (Option["input"] == STDIN || fileExists(Option["input"])) {
+i = 0
+while (getline line < Option["input"])
+if (line) {
+if (!Option["interactive"])
+if (Option["verbose"] && i++ > 0)
+p(prettify("source-seperator",
+replicate(Option["chr-source-seperator"],
+Option["width"])))
+if (Option["interactive"])
+repl(line)
+else
+translate(line)
+} else {
+if (!Option["interactive"])
+if (!Option["verbose"])
+p(line)
+}
+} else
+e("[ERROR] File not found: " Option["input"])
+}
+function _Init(    vm) {
+vm = engineMethod("Init")
+return @vm()
+}
+function _RequestUrl(text, sl, tl, hl,    vm) {
+vm = engineMethod("RequestUrl")
+return @vm(text, sl, tl, hl)
+}
+function _PostRequestUrl(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestUrl")
+return @vm(text, sl, tl, hl, type)
+}
+function _PostRequestContentType(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestContentType")
+return @vm(text, sl, tl, hl, type)
+}
+function _PostRequestBody(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestBody")
+return @vm(text, sl, tl, hl, type)
+}
+function _TTSUrl(text, tl,    vm) {
+vm = engineMethod("TTSUrl")
+return @vm(text, tl)
+}
+function _WebTranslateUrl(uri, sl, tl, hl,    vm) {
+vm = engineMethod("WebTranslateUrl")
+return @vm(uri, sl, tl, hl)
+}
+function _Translate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+vm) {
+vm = engineMethod("Translate")
+return @vm(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl)
+}
+BEGIN { provides("google") }
+function genRL(a, x,
+b, c, d, i, y) {
+tokenize(y, x)
+parseList(b, y)
+i = SUBSEP 0
+for (c = 0; c < length(b[i]) - 2; c += 3) {
+d = b[i][c + 2]
+d = d >= 97 ? d - 87 :
+d - 48
+d = b[i][c + 1] == 43 ? rshift(a, d) : lshift(a, d)
+a = b[i][c] == 43 ? and(a + d, 4294967295) : xor(a, d)
+}
+return a
+}
+function genTK(text,
+a, d, dLen, e, tkk, ub, vb) {
+if (TK[text]) return TK[text]
+tkk = systime() / 3600
+ub = "[43,45,51,94,43,98,43,45,102]"
+vb = "[43,45,97,94,43,54]"
+dLen = dump(text, d)
+a = tkk
+for (e = 1; e <= dLen; e++)
+a = genRL(a + d[e], vb)
+a = genRL(a, ub)
+0 > a && (a = and(a, 2147483647) + 2147483648)
+a %= 1e6
+TK[text] = a "." xor(a, tkk)
+l(text, "text")
+l(tkk, "tkk")
+l(TK[text], "tk")
+return TK[text]
+}
+function googleInit() {
+HttpProtocol = "http://"
+HttpHost = "translate.googleapis.com"
+HttpPort = 80
+}
+function googleRequestUrl(text, sl, tl, hl,    qc) {
+qc = Option["no-autocorrect"] ? "qc" : "qca";
+return HttpPathPrefix "/translate_a/single?client=gtx"\
+"&ie=UTF-8&oe=UTF-8"\
+"&dt=bd&dt=ex&dt=ld&dt=md&dt=rw&dt=rm&dt=ss&dt=t&dt=at"\
+"&dt=" qc "&sl=" sl "&tl=" tl "&hl=" hl\
+"&q=" preprocess(text)
+}
+function googleTTSUrl(text, tl) {
+return HttpProtocol HttpHost "/translate_tts?ie=UTF-8&client=gtx"\
+"&tl=" tl "&q=" preprocess(text)
+}
+function googleWebTranslateUrl(uri, sl, tl, hl) {
+return "https://translate.google.com/translate?"\
+"hl=" hl "&sl=" sl "&tl=" tl "&u=" uri
+}
+function googleTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, ils, isPhonetic,
+article, example, explanation, ref, word,
+translation, translations, phonetics,
+wordClasses, words, segments, altTranslations,
+original, oPhonetics, oWordClasses, oWords,
+oRefs, oSynonymClasses, oSynonyms,
+oExamples, oSeeAlso,
+wShowOriginal, wShowOriginalPhonetics,
+wShowTranslation, wShowTranslationPhonetics,
+wShowPromptMessage, wShowLanguages,
+wShowOriginalDictionary, wShowDictionary,
+wShowAlternatives,
+hasWordClasses, hasAltTranslations,
+i, j, k, group, temp, saveSortedIn) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJsonArray(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "compareByIndexFields"
+for (i in ast) {
+if (ast[i] == "null") continue
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "0$")
+append(translations, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "1$")
+append(original, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "2$")
+append(phonetics, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "3$")
+append(oPhonetics, literal(ast[i]))
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+wordClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "([[:digit:]]+)$", group))
+words[group[1]][group[2]][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)$", group))
+words[group[1]][group[2]]["1"][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group)) {
+segments[group[1]] = literal(ast[i])
+altTranslations[group[1]][0] = ""
+}
+if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+altTranslations[group[1]][group[2]] = literal(ast[i])
+if (i ~ "^0" SUBSEP "7" SUBSEP "5$") {
+if (ast[i] == "true")
+w("Showing translation for:  (use -no-auto to disable autocorrect)")
+else
+w("Did you mean: "\
+ansi("bold", unparameterize(ast["0" SUBSEP "7" SUBSEP "1"])))
+}
+if (i ~ "^0" SUBSEP "8" SUBSEP "0" SUBSEP "[[:digit:]]+$" ||
+i ~ "^0" SUBSEP "2$")
+append(ils, literal(ast[i]))
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oSynonymClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
+if (ast[i]) {
+oRefs[literal(ast[i])][1] = group[1]
+oRefs[literal(ast[i])][2] = group[2]
+}
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
+oSynonyms[group[1]][group[2]][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oWordClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oWords[group[1]][group[2]][0] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
+oWords[group[1]][group[2]][1] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2$", group))
+oWords[group[1]][group[2]][2] = literal(ast[i])
+if (match(i, "^0" SUBSEP "13" SUBSEP "0" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oExamples[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "14" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
+oSeeAlso[group[1]] = literal(ast[i])
+}
+PROCINFO["sorted_in"] = saveSortedIn
+translation = join(translations)
+returnIl[0] = il = !anything(ils) || belongsTo(sl, ils) ? sl : ils[0]
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = isPhonetic && anything(phonetics) ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+} else {
+wShowOriginal = Option["show-original"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+wShowTranslation = Option["show-translation"]
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+wShowPromptMessage = Option["show-prompt-message"]
+wShowLanguages = Option["show-languages"]
+wShowOriginalDictionary = Option["show-original-dictionary"]
+wShowDictionary = Option["show-dictionary"]
+wShowAlternatives = Option["show-alternatives"]
+if (!anything(oPhonetics)) wShowOriginalPhonetics = 0
+if (!anything(phonetics)) wShowTranslationPhonetics = 0
+if (getCode(il) == getCode(tl) &&\
+(isarray(oWordClasses) || isarray(oSynonymClasses) ||\
+isarray(oExamples) || isarray(oSeeAlso))) {
+wShowOriginalDictionary = 1
+wShowTranslation = 0
+}
+hasWordClasses = exists(wordClasses)
+hasAltTranslations = exists(altTranslations[0])
+if (!hasWordClasses && !hasAltTranslations)
+wShowPromptMessage = wShowLanguages = 0
+if (!hasWordClasses) wShowDictionary = 0
+if (!hasAltTranslations) wShowAlternatives = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text & phonetics")
+r = r prettify("original", s(join(original, " "), il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation & phonetics")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowPromptMessage || wShowLanguages)
+if (r) r = r RS
+if (wShowPromptMessage) {
+if (hasWordClasses) {
+if (r) r = r RS
+r = r m("-- display prompt message (Definitions of ...)")
+if (isRTL(hl))
+r = r prettify("prompt-message", s(showDefinitionsOf(hl, join(original, " "))))
+else {
+split(showDefinitionsOf(hl, "\0%s\0"), group, "\0")
+for (i = 1; i <= length(group); i++) {
+if (group[i] == "%s")
+r = r prettify("prompt-message-original", show(join(original, " "), il))
+else
+r = r prettify("prompt-message", group[i])
+}
+}
+} else if (hasAltTranslations) {
+if (r) r = r RS
+r = r m("-- display prompt message (Translations of ...)")
+if (isRTL(hl))
+r = r prettify("prompt-message", s(showTranslationsOf(hl, join(original, " "))))
+else {
+split(showTranslationsOf(hl, "\0%s\0"), group, "\0")
+for (i = 1; i <= length(group); i++) {
+if (group[i] == "%s")
+r = r prettify("prompt-message-original", show(join(original, " "), il))
+else
+r = r prettify("prompt-message", group[i])
+}
+}
+}
+}
+if (wShowLanguages) {
+if (r) r = r RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowOriginalDictionary) {
+if (exists(oWordClasses)) {
+if (r) r = r RS
+r = r m("-- display original dictionary (detailed explanations)")
+for (i = 0; i < length(oWordClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("original-dictionary-detailed-word-class", s(oWordClasses[i], hl))
+for (j = 0; j < length(oWords[i]); j++) {
+explanation = oWords[i][j][0]
+ref = oWords[i][j][1]
+example = oWords[i][j][2]
+r = (j > 0 ? r RS : r) RS prettify("original-dictionary-detailed-explanation", ins(1, explanation, il))
+if (example)
+r = r RS prettify("original-dictionary-detailed-example", ins(2, "- \"" example "\"", il))
+if (ref && isarray(oRefs[ref])) {
+temp = prettify("original-dictionary-detailed-synonyms", ins(1, show(showSynonyms(hl), hl) ": "))
+temp = temp prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][0], il))
+for (k = 1; k < length(oSynonyms[oRefs[ref][1]][oRefs[ref][2]]); k++)
+temp = temp prettify("original-dictionary-detailed-synonyms", ", ")\
+prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][k], il))
+r = r RS temp
+}
+}
+}
+}
+if (exists(oSynonymClasses)) {
+r = r RS RS
+r = r m("-- display original dictionary (synonyms)")
+r = r prettify("original-dictionary-synonyms", s(showSynonyms(hl), hl))
+for (i = 0; i < length(oSynonymClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("original-dictionary-synonyms-word-class", ins(1, oSynonymClasses[i], hl))
+for (j = 0; j < length(oSynonyms[i]); j++) {
+temp = prettify("original-dictionary-synonyms-synonyms", ins(2, "- "))
+temp = temp prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][0], il))
+for (k = 1; k < length(oSynonyms[i][j]); k++)
+temp = temp prettify("original-dictionary-synonyms-synonyms", ", ")\
+prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][k], il))
+r = r RS temp
+}
+}
+}
+if (exists(oExamples)) {
+r = r RS RS
+r = r m("-- display original dictionary (examples)")
+r = r prettify("original-dictionary-examples", s(showExamples(hl), hl))
+for (i = 0; i < length(oExamples); i++) {
+example = oExamples[i]
+temp = prettify("original-dictionary-examples-example", ins(1, "- "))
+split(example, group, /(<b>|<\/b>)/)
+if (group[3] ~ / [[:punct:].]/)
+group[3] = substr(group[3], 2)
+if (isRTL(il))
+temp = temp show(group[1] group[2] group[3], il)
+else
+temp = temp prettify("original-dictionary-examples-example", group[1])\
+prettify("original-dictionary-examples-original", group[2])\
+prettify("original-dictionary-examples-example", group[3])
+r = (i > 0 ? r RS : r) RS temp
+}
+}
+if (exists(oSeeAlso)) {
+r = r RS RS
+r = r m("-- display original dictionary (see also)")
+r = r prettify("original-dictionary-see-also", s(showSeeAlso(hl), hl))
+temp = ins(1, prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[0], il)))
+for (k = 1; k < length(oSeeAlso); k++)
+temp = temp prettify("original-dictionary-see-also-phrases", ", ")\
+prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[k], il))
+r = r RS temp
+}
+}
+if (wShowDictionary) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+for (i = 0; i < length(wordClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("dictionary-word-class", s(wordClasses[i], hl))
+for (j = 0; j < length(words[i]); j++) {
+word = words[i][j][0]
+article = words[i][j][4]
+if (isRTL(il))
+explanation = join(words[i][j][1], ", ")
+else {
+explanation = prettify("dictionary-explanation-item", words[i][j][1][0])
+for (k = 1; k < length(words[i][j][1]); k++)
+explanation = explanation prettify("dictionary-explanation", ", ")\
+prettify("dictionary-explanation-item", words[i][j][1][k])
+}
+r = r RS prettify("dictionary-word", ins(1, (article ? "(" article ") " : "") word, tl))
+if (isRTL(il))
+r = r RS prettify("dictionary-explanation-item", ins(2, explanation, il))
+else
+r = r RS ins(2, explanation)
+}
+}
+}
+if (wShowAlternatives) {
+if (r) r = r RS RS
+r = r m("-- display alternative translations")
+for (i = 0; i < length(altTranslations); i++) {
+r = (i > 0 ? r RS : r) prettify("alternatives-original", show(segments[i], il))
+if (isRTL(tl)) {
+temp = join(altTranslations[i], ", ")
+r = r RS prettify("alternatives-translations-item", ins(1, temp, tl))
+} else {
+temp = prettify("alternatives-translations-item", altTranslations[i][0])
+for (j = 1; j < length(altTranslations[i]); j++)
+temp = temp prettify("alternatives-translations", ", ")\
+prettify("alternatives-translations-item", altTranslations[i][j])
+r = r RS ins(1, temp)
+}
+}
+}
+if (toSpeech) {
+if (index(showTranslationsOf(hl, "%s"), "%s") > 2) {
+returnPlaylist[0]["text"] = showTranslationsOf(hl)
+returnPlaylist[0]["tl"] = hl
+returnPlaylist[1]["text"] = join(original)
+returnPlaylist[1]["tl"] = il
+} else {
+returnPlaylist[0]["text"] = join(original)
+returnPlaylist[0]["tl"] = il
+returnPlaylist[1]["text"] = showTranslationsOf(hl)
+returnPlaylist[1]["tl"] = hl
+}
+returnPlaylist[2]["text"] = translation
+returnPlaylist[2]["tl"] = tl
+}
+}
+return r
+}
+BEGIN { provides("bing") }
+function bingInit() {
+HttpProtocol = "http://"
+HttpHost = "www.bing.com"
+HttpPort = 80
+}
+function bingSetIG(    content, cookie, group, header, isBody,
+url, status, location) {
+url = HttpPathPrefix "/translator"
+header = "GET " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+cookie = NULLSTR
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+match($0, /Set-Cookie: ([^;]*);/, group)
+if (group[1]) {
+cookie = cookie (cookie ?  "; " : NULLSTR) group[1]
+}
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), length($0) < 1024 ? $0 : "..."))
+}
+close(HttpService)
+if ((status == "301" || status == "302") && location)
+content = curl(location)
+Cookie = cookie
+match(content, /IG:"([^"]+)"/, group)
+if (group[1]) {
+IG = group[1]
+} else {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+exit 1
+}
+}
+function bingTTSUrl(text, tl,
+country, gender, i, group,
+header, content, isBody) {
+gender = "female"
+country = NULLSTR
+split(Option["narrator"], group, ",")
+for (i in group) {
+if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
+gender = "female"
+else if (group[i] ~ /^m(ale|an)?$/)
+gender = "male"
+else
+country = group[i]
+}
+if (country) tl = tl "-" country
+else if (tl == "ar") tl = tl "-EG"
+else if (tl == "da") tl = tl "-DK"
+else if (tl == "de") tl = tl "-DE"
+else if (tl == "en") tl = tl "-US"
+else if (tl == "es") tl = tl "-ES"
+else if (tl == "fi") tl = tl "-FI"
+else if (tl == "fr") tl = tl "-FR"
+else if (tl == "it") tl = tl "-IT"
+else if (tl == "ja") tl = tl "-JP"
+else if (tl == "ko") tl = tl "-KR"
+else if (tl == "nl") tl = tl "-NL"
+else if (tl == "nb") tl = tl "-NO"
+else if (tl == "pl") tl = tl "-PL"
+else if (tl == "pt") tl = tl "-PT"
+else if (tl == "ru") tl = tl "-RU"
+else if (tl == "sv") tl = tl "-SE"
+else if (tl == "yue") ;
+else if (tl == "zh") tl = tl "-CN"
+header = "GET " "/translator/api/language/Speak?"\
+"locale=" tl "&text=" preprocess(text)\
+"&gender=" gender "&media=audio/mp3" " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+content = NULLSTR; isBody = 0
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+}
+close(HttpService)
+if (!TempFile)
+TempFile = getOutput("mktemp")
+printf("%s", content) > TempFile
+close(TempFile)
+return TempFile
+}
+function bingWebTranslateUrl(uri, sl, tl, hl) {
+return "http://www.microsofttranslator.com/bv.aspx?"\
+"from=" sl "&to=" tl "&a=" uri
+}
+function bingRequestUrl(text, sl, tl, hl) {
+return HttpPathPrefix "/translator/api/Dictionary/Lookup?"\
+"from=" sl "&to=" tl "&text=" preprocess(text)
+}
+function bingPostRequestUrl(text, sl, tl, hl, type) {
+if (type == "translate")
+return HttpPathPrefix "/ttranslate?&IG=" IG "&IID=translator.5032.2"
+else if (type == "translationlookup")
+return HttpPathPrefix "/ttranslationlookup?&IG=" IG "&IID=translator.5032.2"
+else if (type == "transliterate")
+return HttpPathPrefix "/ttransliterate?&IG=" IG "&IID=translator.5032.1"
+else # type == "detect"
+return HttpPathPrefix "/tdetect?&IG=" IG "&IID=translator.5032.2"
+}
+function bingPostRequestContentType(text, sl, tl, hl, type) {
+return "application/x-www-form-urlencoded"
+}
+function bingPostRequestBody(text, sl, tl, hl, type) {
+if (type == "translate")
+return "&text=" quote(text) "&from=" sl "&to=" tl
+else if (type == "translationlookup")
+return "&text=" quote(text) "&from=" sl "&to=" tl
+else if (type == "transliterate")
+return "&text=" quote(text) "&language=" sl "&toScript=" "latn"
+else # type == "detect"
+return "&text=" quote(text)
+}
+function bingTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, isPhonetic,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+group, temp) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+bingSetIG()
+il = postResponse(text, _sl, _tl, _hl, "detect")
+if (!il) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+returnIl[0] = il
+if (Option["verbose"] < -1)
+return il
+if (Option["verbose"] < 0)
+return getList(il)
+if (_sl == "auto")  _sl = il
+if (_sl == "bs")    _sl = "bs-Latn"
+if (_sl == "zh-CN") _sl = "zh-CHS"
+if (_sl == "zh-TW") _sl = "zh-CHT"
+if (_tl == "bs")    _tl = "bs-Latn"
+if (_tl == "zh-CN") _tl = "zh-CHS"
+if (_tl == "zh-TW") _tl = "zh-CHT"
+content = postResponse(text, _sl, _tl, _hl, "translate")
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+} else if (ast[0 SUBSEP "statusCode"] != "200") {
+e("[ERROR] statusCode: " ast[0 SUBSEP "statusCode"])
+ExitCode = 1
+return
+}
+translation = unparameterize(ast[0 SUBSEP "translationResponse"])
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+if (wShowTranslationPhonetics) {
+split(_tl, group, "-")
+content = postResponse(translation, group[1], group[1], _hl, "transliterate")
+phonetics = unparameterize(content)
+if (phonetics == translation) phonetics = ""
+}
+if (!isVerbose) {
+r = isPhonetic && phonetics ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowDictionary = Option["show-dictionary"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+if (wShowOriginalPhonetics) {
+split(il, group, "-")
+content = postResponse(text, group[1], group[1], _hl, "transliterate")
+oPhonetics = unparameterize(content)
+if (oPhonetics == text) oPhonetics = ""
+}
+if (!oPhonetics) wShowOriginalPhonetics = 0
+if (!phonetics) wShowTranslationPhonetics = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowDictionary && false) {
+dicContent = getResponse(text, il, _tl, _hl)
+tokenize(dicTokens, dicContent)
+parseJson(dicAst, dicTokens)
+if (anything(dicAst)) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+}
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN { provides("yandex") }
+function genSID(    content, group, temp) {
+content = curl("http://translate.yandex.com")
+match(content, /SID:[[:space:]]*'([^']+)'/, group)
+if (group[1]) {
+split(group[1], temp, ".")
+SID = reverse(temp[1]) "." reverse(temp[2]) "." reverse(temp[3])
+} else {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+exit 1
+}
+}
+function yandexInit() {
+genSID()
+YandexWebTranslate = "z5h64q92x9.net"
+HttpProtocol = "http://"
+HttpHost = "translate.yandex.net"
+HttpPort = 80
+}
+function yandexRequestUrl(text, sl, tl, hl,    group) {
+split(sl, group, "-"); sl = group[1]
+split(tl, group, "-"); tl = group[1]
+return HttpPathPrefix "/api/v1/tr.json/translate?"\
+"id=" SID "-0-0&srv=tr-text"\
+"&text=" preprocess(text) "&lang=" (sl == "auto" ? tl : sl "-" tl)
+}
+function yandexPostRequestBody(text, sl, tl, hl, type) {
+return "text=" quote(text) "&lang=" sl
+}
+function yandexGetDictionaryResponse(text, sl, tl, hl,    content, header, isBody, url) {
+split(sl, group, "-"); sl = group[1]
+split(tl, group, "-"); tl = group[1]
+url = "http://dictionary.yandex.net/dicservice.json/lookupMultiple?"\
+"&text=" preprocess(text) "&dict=" sl "-" tl
+content = curl(url)
+return assert(content, "[ERROR] Null response.")
+}
+function yandexTTSUrl(text, tl,
+speaker, emotion, i, group) {
+speaker = NULLSTR
+emotion = NULLSTR
+split(Option["narrator"], group, ",")
+for (i in group) {
+if (group[i] ~ /^(g(ood)?|n(eutral)?|e(vil)?)$/)
+emotion = group[i]
+else if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
+speaker = "alyss"
+else if (group[i] ~ /^m(ale|an)?$/)
+speaker = "zahar"
+else
+speaker = group[i]
+}
+switch (tl) {
+case "ar": tl = "ar_AE"; break
+case "cs": tl = "cs_CZ"; break
+case "da": tl = "da_DK"; break
+case "de": tl = "de_DE"; break
+case "el": tl = "el_GR"; break
+case "en": tl = "en_GB"; break
+case "es": tl = "es_ES"; break
+case "fi": tl = "fi_FI"; break
+case "fr": tl = "fr_FR"; break
+case "it": tl = "it_IT"; break
+case "nl": tl = "nl_NL"; break
+case "no": tl = "no_NO"; break
+case "pl": tl = "pl_PL"; break
+case "pt": tl = "pt_PT"; break
+case "ru": tl = "ru_RU"; break
+case "sv": tl = "sv_SE"; break
+case "tr": tl = "tr_TR"; break
+default: tl = NULLSTR
+}
+return HttpProtocol "tts.voicetech.yandex.net" "/tts?"\
+"text=" preprocess(text) (tl ? "&lang=" tl : tl)\
+(speaker ? "&speaker=" speaker : speaker)\
+(emotion ? "&emotion=" emotion : emotion)\
+"&format=mp3" "&quality=hi"
+}
+function yandexWebTranslateUrl(uri, sl, tl, hl) {
+gsub(/:\/\//, "/", uri)
+return HttpProtocol YandexWebTranslate "/proxy_u/"\
+(sl == "auto" ? tl : sl "-" tl)"/" uri
+}
+function yandexTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, isPhonetic,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+wShowDictionary, dicContent, dicTokens, dicAst,
+i, syn, mean,
+group, temp) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+if (ast[0 SUBSEP "code"] != "200") {
+e("[ERROR] " unparameterize(ast[0 SUBSEP "message"]))
+ExitCode = 1
+return
+}
+translation = unparameterize(ast[0 SUBSEP "text" SUBSEP 0])
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+if (wShowTranslationPhonetics) {
+split(_tl, group, "-")
+data = yandexPostRequestBody(translation, group[1], group[1], _hl, "translit")
+content = curlPost("https://translate.yandex.net/translit/translit", data)
+phonetics = (content ~ /not supported$/) ? "" : unparameterize(content)
+}
+split(unparameterize(ast[0 SUBSEP "lang"]), group, "-")
+returnIl[0] = il = group[1]
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = isPhonetic && phonetics ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowDictionary = Option["show-dictionary"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+if (wShowTranslationPhonetics) {
+split(il, group, "-")
+data = yandexPostRequestBody(text, group[1], group[1], _hl, "translit")
+content = curlPost("https://translate.yandex.net/translit/translit", data)
+oPhonetics = (content ~ /not supported$/) ? "" : unparameterize(content)
+}
+if (!oPhonetics) wShowOriginalPhonetics = 0
+if (!phonetics) wShowTranslationPhonetics = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text & phonetics")
+r = r prettify("original", s(text, il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowDictionary && false) {
+dicContent = yandexGetDictionaryResponse(text, il, _tl, _hl)
+tokenize(dicTokens, dicContent)
+parseJson(dicAst, dicTokens)
+if (anything(dicAst)) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in dicAst) {
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"pos$") {
+r = r RS prettify("dictionary-word-class", s((literal(dicAst[i])), hl))
+syn = mean = ""
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP\
+"mean" SUBSEP "[[:digit:]]+" SUBSEP "text") {
+if (mean) {
+mean = mean prettify("dictionary-explanation", ", ")\
+prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
+} else {
+mean = prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
+}
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP\
+"syn" SUBSEP "[[:digit:]]+" SUBSEP "text") {
+if (syn) {
+syn = syn prettify("dictionary-explanation", ", ")\
+prettify("dictionary-word", s((literal(dicAst[i])), il))
+} else {
+syn = prettify("dictionary-word", s((literal(dicAst[i])), il))
+}
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP "text$") {
+text = prettify("dictionary-word", s((literal(dicAst[i])), il))
+if (syn) {
+r = r RS ins(1, text prettify("dictionary-explanation", ", ") syn)
+} else {
+r = r RS ins(1, text)
+}
+r = r RS ins(2, mean)
+syn = mean = ""
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+}
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN { provides("apertium") }
+function apertiumInit() {
+HttpProtocol = "http://"
+HttpHost = "www.apertium.org"
+HttpPort = 80
+}
+function apertiumRequestUrl(text, sl, tl, hl) {
+return HttpPathPrefix "/apy/translate?"\
+"langpair=" preprocess(sl) "|" preprocess(tl)\
+"&q=" preprocess(text)
+}
+function apertiumTTSUrl(text, tl,    narrator) {
+}
+function apertiumWebTranslateUrl(uri, sl, tl, hl) {
+}
+function apertiumTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+group, temp) {
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+_sl = "auto" == _sl ? "en" : _sl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+translation = uprintf(unquote(unparameterize(ast[0 SUBSEP "responseData" SUBSEP "translatedText"])))
+returnIl[0] = il = _sl
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = translation
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN {
+provides("spell")
+provides("aspell")
+provides("hunspell")
+}
+function spellInit() {
+Ispell = detectProgram("aspell", "--version") ? "aspell" :
+(detectProgram("hunspell", "--version") ? "hunspell" : "")
+if (!Ispell) {
+e("[ERROR] Spell checker (aspell or hunspell) not found.")
+exit 1
+}
+}
+function aspellInit() {
+if (!(Ispell = detectProgram("aspell", "--version") ? "aspell" : "")) {
+e("[ERROR] Spell checker (aspell) not found.")
+exit 1
+}
+}
+function hunspellInit() {
+if (!(Ispell = detectProgram("hunspell", "--version") ? "hunspell" : "")) {
+e("[ERROR] Spell checker (hunspell) not found.")
+exit 1
+}
+}
+function spellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+args, i, j, r, line, group, word, sug) {
+args = " -a" (sl != "auto" ? " -d " sl : "")
+if (system("echo" PIPE Ispell args SUPOUT SUPERR)) {
+e("[ERROR] No dictionary for language: " sl)
+exit 1
+}
+i = 1
+r = ""
+while ((("echo " parameterize(text) PIPE Ispell args SUPERR) |& getline line) > 0) {
+match(line,
+/^& (.*) [[:digit:]]+ [[:digit:]]+: ([^,]+)(, ([^,]+))?(, ([^,]+))?/,
+group)
+if (RSTART) {
+ExitCode = 1
+word = group[1]
+sug = "[" group[2]
+if (group[4]) sug = sug "|" group[4]
+if (group[6]) sug = sug "|" group[6]
+sug = sug "]"
+j = i + index(substr(text, i), word) - 1
+r = r substr(text, i, j - i)
+r = r ansi("bold", ansi("red", word)) ansi("yellow", sug)
+i = j + length(word)
+}
+}
+r = r substr(text, i)
+return r
+}
+function aspellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return spellTranslate(text, sl, tl, hl)
+}
+function hunspellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return spellTranslate(text, sl, tl, hl)
+}
+BEGIN { provides("deepl") }
+function deeplInit() {
+HttpProtocol = "http://"
+HttpHost = "www.deepl.com"
+HttpPort = 80
+}
+function deeplRequestUrl(text, sl, tl, hl) {
+}
+function deeplTTSUrl(text, tl,    narrator) {
+}
+function deeplWebTranslateUrl(uri, sl, tl, hl) {
+}
+function deeplPost(text, sl, tl, hl,
+content, data, url) {
+data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_handle_jobs\","
+data = data "\"params\":{\"jobs\":[{\"kind\":\"default\","
+data = data "\"raw_en_sentence\":" parameterize(text, "\"") "}],"
+data = data "\"lang\":{\"user_preferred_langs\":[\"" hl "\"],"
+data = data "\"source_lang_user_selected\":\"" sl "\","
+data = data "\"target_lang\":\"" tl "\"},"
+data = data "\"priority\":1},\"id\":1}"
+l(data)
+url = "https://www.deepl.com/jsonrpc"
+content = curlPost(url, data)
+return assert(content, "[ERROR] Null response.")
+}
+function deeplTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il,
+translation, translations,
+wShowOriginal, wShowTranslation,
+wShowLanguages, wShowAlternatives,
+group, temp) {
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+if (_sl != "auto") _sl = toupper(_sl)
+if (_tl != "auto") _tl = toupper(_tl)
+if (_hl != "auto") _hl = toupper(_hl)
+content = deeplPost(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "compareByIndexFields"
+for (i in ast) {
+if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP 0 SUBSEP "beams" SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
+append(translations, uprintf(unquote(unparameterize(ast[i]))))
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+translation = translations[0]
+returnIl[0] = il = tolower(unparameterize(ast[0 SUBSEP "result" SUBSEP "source_lang"]))
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = translation
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowAlternatives = Option["show-alternatives"]
+if (length(translations) <= 1) wShowAlternatives = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowAlternatives) {
+if (r) r = r RS
+r = r m("-- display alternative translations")
+r = r RS ins(1, prettify("alternatives-translations-item", translations[1]))
+for (i = 2; i < length(translations); i++)
+r = r RS ins(1, prettify("alternatives-translations-item", translations[i]))
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+function loadOptions(script,    i, j, tokens, name, value) {
+tokenize(tokens, script)
+for (i in tokens) {
+if (tokens[i] ~ /^:/) {
+name = substr(tokens[i], 2)
+value = tokens[i + 1]
+if (value ~ /^[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?$/) {
+delete Option[name]
+Option[name] = value
+} else if (value == "false" || value == "true") {
+delete Option[name]
+Option[name] = yn(value)
+} else if (value ~ /^".*"$/) {
+delete Option[name]
+Option[name] = literal(value)
+} else if (value == "[") {
+delete Option[name]
+for (j = 1; tokens[i + j + 1] && tokens[i + j + 1] != "]"; j++) {
+if (tokens[i + j + 1] ~ /^".*"$/)
+Option[name][j] = literal(tokens[i + j + 1])
+else {
+e("[ERROR] Malformed configuration.")
+return
+}
+}
+} else {
+e("[ERROR] Malformed configuration.")
+return
+}
+}
+}
+}
+function upgrade(    i, newVersion, registry, tokens) {
+RegistryIndex = "https://raw.githubusercontent.com/soimort/translate-shell/registry/index.trans"
+registry = curl(RegistryIndex)
+if (!registry) {
+e("[ERROR] Failed to check for upgrade.")
+ExitCode = 1
+return
+}
+tokenize(tokens, registry)
+for (i in tokens)
+if (tokens[i] == ":translate-shell")
+newVersion = literal(tokens[i + 1])
+if (newerVersion(newVersion, Version)) {
+w("Current version: \t" Version)
+w("New version available: \t" newVersion)
+w("Download from: \t" "https://www.soimort.org/translate-shell/trans")
+} else {
+w("Current version: \t" Version)
+w("Already up-to-date.")
+}
+}
+function welcome() {
+if (Option["fmt-welcome-message"])
+print prettify("welcome-message", Option["fmt-welcome-message"]) > STDERR
+if (Option["fmt-welcome-submessage"])
+print prettify("welcome-submessage", Option["fmt-welcome-submessage"]) > STDERR
+}
+function prompt(    i, p, temp) {
+p = Option["fmt-prompt"]
+if (p ~ /%a/) gsub(/%a/, strftime("%a"), p)
+if (p ~ /%A/) gsub(/%A/, strftime("%A"), p)
+if (p ~ /%b/) gsub(/%b/, strftime("%b"), p)
+if (p ~ /%B/) gsub(/%B/, strftime("%B"), p)
+if (p ~ /%c/) gsub(/%c/, strftime("%c"), p)
+if (p ~ /%C/) gsub(/%C/, strftime("%C"), p)
+if (p ~ /%d/) gsub(/%d/, strftime("%d"), p)
+if (p ~ /%D/) gsub(/%D/, strftime("%D"), p)
+if (p ~ /%e/) gsub(/%e/, strftime("%e"), p)
+if (p ~ /%F/) gsub(/%F/, strftime("%F"), p)
+if (p ~ /%g/) gsub(/%g/, strftime("%g"), p)
+if (p ~ /%G/) gsub(/%G/, strftime("%G"), p)
+if (p ~ /%h/) gsub(/%h/, strftime("%h"), p)
+if (p ~ /%H/) gsub(/%H/, strftime("%H"), p)
+if (p ~ /%I/) gsub(/%I/, strftime("%I"), p)
+if (p ~ /%j/) gsub(/%j/, strftime("%j"), p)
+if (p ~ /%m/) gsub(/%m/, strftime("%m"), p)
+if (p ~ /%M/) gsub(/%M/, strftime("%M"), p)
+if (p ~ /%n/) gsub(/%n/, strftime("%n"), p)
+if (p ~ /%p/) gsub(/%p/, strftime("%p"), p)
+if (p ~ /%r/) gsub(/%r/, strftime("%r"), p)
+if (p ~ /%R/) gsub(/%R/, strftime("%R"), p)
+if (p ~ /%u/) gsub(/%u/, strftime("%u"), p)
+if (p ~ /%U/) gsub(/%U/, strftime("%U"), p)
+if (p ~ /%V/) gsub(/%V/, strftime("%V"), p)
+if (p ~ /%w/) gsub(/%w/, strftime("%w"), p)
+if (p ~ /%W/) gsub(/%W/, strftime("%W"), p)
+if (p ~ /%x/) gsub(/%x/, strftime("%x"), p)
+if (p ~ /%X/) gsub(/%X/, strftime("%X"), p)
+if (p ~ /%y/) gsub(/%y/, strftime("%y"), p)
+if (p ~ /%Y/) gsub(/%Y/, strftime("%Y"), p)
+if (p ~ /%z/) gsub(/%z/, strftime("%z"), p)
+if (p ~ /%Z/) gsub(/%Z/, strftime("%Z"), p)
+if (p ~ /%_/)
+gsub(/%_/, showTranslationsOf(Option["hl"]), p)
+if (p ~ /%l/)
+gsub(/%l/, getDisplay(Option["hl"]), p)
+if (p ~ /%L/)
+gsub(/%L/, getName(Option["hl"]), p)
+if (p ~ /%S/)
+gsub(/%S/, getName(Option["sl"]), p)
+if (p ~ /%t/) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "+" getDisplay(Option["tl"][i])
+gsub(/%t/, temp, p)
+}
+if (p ~ /%T/) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "+" getName(Option["tl"][i])
+gsub(/%T/, temp, p)
+}
+if (p ~ /%,/) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "," getDisplay(Option["tl"][i])
+gsub(/%,/, temp, p)
+}
+if (p ~ /%</) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "," getName(Option["tl"][i])
+gsub(/%</, temp, p)
+}
+if (p ~ /%\//) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "/" getDisplay(Option["tl"][i])
+gsub(/%\//, temp, p)
+}
+if (p ~ /%\?/) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "/" getName(Option["tl"][i])
+gsub(/%\?/, temp, p)
+}
+printf(prettify("prompt", p), getDisplay(Option["sl"])) > STDERR
+}
+function repl(line,    command, group, name, i, value, words) {
+split(line, words, " ")
+command = words[1]
+if (command ~ /^:(q|quit)$/) {
+exit
+} else if (command ~ /^:set$/) {
+name = words[2]
+value = words[3]
+Option[name] = value
+} else if (command ~ /^:show$/) {
+name = words[2]
+print prettify("welcome-submessage", toString(Option[name], 1, 0, 1))
+} else if (command ~ /^:engine$/) {
+value = words[2]
+Option["engine"] = value
+initHttpService()
+} else {
+match(command, /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
+if (RSTART) {
+if (group[1]) Option["sl"] = group[1]
+if (group[4]) split(group[4], Option["tl"], "+")
+line = words[2]
+for (i = 3; i <= length(words); i++)
+line = line " " words[i]
+}
+if (line) {
+translate(line)
+if (Option["verbose"]) printf RS
+}
+}
+prompt()
+}
+function init() {
+initGawk()
+initBiDi()
+initLocale()
+initUserLang()
+RS = "\n"
+ExitCode = 0
+Option["debug"] = 0
+Option["engine"] = "google"
+Option["verbose"] = 1
+Option["show-original"] = 1
+Option["show-original-phonetics"] = 1
+Option["show-translation"] = 1
+Option["show-translation-phonetics"] = 1
+Option["show-prompt-message"] = 1
+Option["show-languages"] = 1
+Option["show-original-dictionary"] = 0
+Option["show-dictionary"] = 1
+Option["show-alternatives"] = 1
+Option["width"] = ENVIRON["COLUMNS"] ? ENVIRON["COLUMNS"] - 2 : 0
+Option["indent"] = 4
+Option["no-ansi"] = 0
+Option["no-autocorrect"] = 0
+Option["no-bidi"] = 0
+Option["no-warn"] = 0
+Option["theme"] = "default"
+Option["dump"] = 0
+Option["play"] = 0
+Option["narrator"] = "female"
+Option["player"] = ENVIRON["PLAYER"]
+Option["no-translate"] = 0
+Option["download-audio"] = 0
+Option["download-audio-as"] = NULLSTR
+Option["view"] = 0
+Option["pager"] = ENVIRON["PAGER"]
+Option["browser"] = ENVIRON["BROWSER"]
+Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"]
+Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] :
+"Mozilla/5.0 (X11; Linux x86_64) "\
+"AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 "\
+"Safari/602.1 Epiphany/3.18.2"
+Option["no-rlwrap"] = 0
+Option["interactive"] = 0
+Option["emacs"] = 0
+Option["input"] = NULLSTR
+Option["output"] = STDOUT
+Option["hl"] = ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang
+Option["sl"] = ENVIRON["SOURCE_LANG"] ? ENVIRON["SOURCE_LANG"] : "auto"
+Option["tl"][1] = ENVIRON["TARGET_LANG"] ? ENVIRON["TARGET_LANG"] : UserLang
+}
+function initScript(    file, line, script, temp) {
+file = ".trans"
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.translate-shell/init.trans"
+if (!fileExists(file)) {
+file = ENVIRON["XDG_CONFIG_HOME"] "/translate-shell/init.trans"
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.config/translate-shell/init.trans"
+if (!fileExists(file)) {
+file = "/etc/translate-shell"
+if (!fileExists(file)) return
+}
+}
+}
+}
+InitScript = file
+script = NULLSTR
+while (getline line < InitScript)
+script = script "\n" line
+loadOptions(script)
+if (!isarray(Option["tl"])) {
+temp = Option["tl"]
+delete Option["tl"]
+Option["tl"][1] = temp
+}
+}
+function initMisc(    group, temp) {
+initHttpService()
+if (!Option["width"] && detectProgram("tput", "-V")) {
+"tput cols" SUPERR | getline temp
+Option["width"] = temp ? temp - 2 : 64
+}
+if (Option["no-ansi"])
+delete AnsiCode
+if (Option["no-bidi"])
+BiDi = BiDiNoPad = NULLSTR
+if (Option["no-warn"])
+STDERR = "/dev/null"
+if (Option["play"]) {
+if (!Option["player"]) {
+initAudioPlayer()
+Option["player"] = AudioPlayer ? AudioPlayer : Option["player"]
+if (!Option["player"])
+initSpeechSynthesizer()
+}
+if (!Option["player"] && !SpeechSynthesizer) {
+w("[WARNING] No available audio player or speech synthesizer.")
+Option["play"] = 0
+}
+}
+if (Option["view"]) {
+if (!Option["pager"]) {
+initPager()
+Option["pager"] = Pager
+}
+if (!Option["pager"]) {
+w("[WARNING] No available terminal pager.")
+Option["view"] = 0
+}
+}
+if (!Option["browser"]) {
+"xdg-mime query default text/html" SUPERR | getline Option["browser"]
+match(Option["browser"], "(.*).desktop$", group)
+Option["browser"] = group[1]
+}
+}
+BEGIN {
+init()
+if (!(belongsTo("-no-init", ARGV) || belongsTo("--no-init", ARGV)))
+initScript()
+pos = 0
+noargc = 0
+while (ARGV[++pos]) {
+match(ARGV[pos], /^--?(V|vers(i(on?)?)?)$/)
+if (RSTART) {
+InfoOnly = "version"
+continue
+}
+match(ARGV[pos], /^--?(H|h(e(lp?)?)?)$/)
+if (RSTART) {
+InfoOnly = "help"
+continue
+}
+match(ARGV[pos], /^--?(M|m(a(n(u(al?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "manual"
+continue
+}
+match(ARGV[pos], /^--?(T|ref(e(r(e(n(ce?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "reference"
+continue
+}
+match(ARGV[pos], /^--?r$/)
+if (RSTART) {
+w("[WARNING] Option '-r' has been deprecated since version 0.9.\n"\
+"          Use option '-T' or '-reference' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?(R|reference-e(n(g(l(i(sh?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "reference-english"
+continue
+}
+match(ARGV[pos], /^--?(L|list)(=(.*)?)?$/, group)
+if (RSTART) {
+InfoOnly = "list"
+if (group[2]) {
+if (group[3]) split(group[3], Option["tl"], "+")
+} else
+split(ARGV[++pos], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^--?(S|list-e(n(g(i(n(es?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "list-engines"
+continue
+}
+match(ARGV[pos], /^--?(U|upgrade)$/)
+if (RSTART) {
+InfoOnly = "upgrade"
+continue
+}
+match(ARGV[pos], /^--?(N|nothing)$/)
+if (RSTART) {
+InfoOnly = "nothing"
+continue
+}
+match(ARGV[pos], /^--?(e|engine)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["engine"] = group[2] ?
+(group[3] ? group[3] : Option["engine"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^\/(.*)$/, group)
+if (RSTART) {
+Option["engine"] = group[1]
+continue
+}
+match(ARGV[pos], /^--?verbose$/)
+if (RSTART) {
+Option["verbose"] = 1
+continue
+}
+match(ARGV[pos], /^--?b(r(i(ef?)?)?)?$/)
+if (RSTART) {
+Option["verbose"] = 0
+continue
+}
+match(ARGV[pos], /^--?d(i(c(t(i(o(n(a(ry?)?)?)?)?)?)?)?)?$/)
+if (RSTART) {
+Option["show-original-dictionary"] = 1
+Option["show-dictionary"] = 0
+Option["show-alternatives"] = 0
+continue
+}
+match(ARGV[pos], /^--?id(e(n(t(i(fy?)?)?)?)?)?$/)
+if (RSTART) {
+Option["verbose"] = Option["verbose"] - 2
+continue
+}
+match(ARGV[pos], /^--?show-original(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-original-phonetics(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-translation(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-translation"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-translation-phonetics(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-translation-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-prompt-message(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-prompt-message"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-languages(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-languages"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-original-dictionary(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-dictionary(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-alternatives(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-alternatives"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?w(i(d(th?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["width"] = group[4] ?
+(group[5] ? group[5] : Option["width"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?indent(=(.*)?)?$/, group)
+if (RSTART) {
+Option["indent"] = group[1] ?
+(group[2] ? group[2] : Option["indent"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?theme(=(.*)?)?$/, group)
+if (RSTART) {
+Option["theme"] = group[1] ?
+(group[2] ? group[2] : Option["theme"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-theme$/)
+if (RSTART) {
+Option["theme"] = NULLSTR
+continue
+}
+match(ARGV[pos], /^--?no-ansi$/)
+if (RSTART) {
+Option["no-ansi"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-auto(correct)?$/)
+if (RSTART) {
+Option["no-autocorrect"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-bidi/)
+if (RSTART) {
+Option["no-bidi"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-warn/)
+if (RSTART) {
+Option["no-warn"] = 1
+continue
+}
+match(ARGV[pos], /^--?dump/)
+if (RSTART) {
+Option["dump"] = 1
+continue
+}
+match(ARGV[pos], /^--?p(l(ay?)?)?$/)
+if (RSTART) {
+Option["play"] = 1
+continue
+}
+match(ARGV[pos], /^--?sp(e(ak?)?)?$/)
+if (RSTART) {
+Option["play"] = 2
+continue
+}
+match(ARGV[pos], /^--?(n|narrator)(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["play"]) Option["play"] = 1
+Option["narrator"] = group[2] ?
+(group[3] ? group[3] : Option["narrator"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?player(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["play"]) Option["play"] = 1
+Option["player"] = group[1] ?
+(group[2] ? group[2] : Option["player"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-play$/)
+if (RSTART) {
+Option["play"] = 0
+continue
+}
+match(ARGV[pos], /^--?no-tran(s(l(a(te?)?)?)?)?$/)
+if (RSTART) {
+Option["no-translate"] = 1
+continue
+}
+match(ARGV[pos], /^--?download-a(u(d(io?)?)?)?$/)
+if (RSTART) {
+Option["download-audio"] = 1
+continue
+}
+match(ARGV[pos], /^--?download-audio-as(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["download-audio"]) Option["download-audio"] = 1
+Option["download-audio-as"] = group[1] ?
+(group[2] ? group[2] : Option["download-audio-as"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?v(i(ew?)?)?$/)
+if (RSTART) {
+Option["view"] = 1
+continue
+}
+match(ARGV[pos], /^--?pager(=(.*)?)?$/, group)
+if (RSTART) {
+Option["view"] = 1
+Option["pager"] = group[1] ?
+(group[2] ? group[2] : Option["pager"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-view$/)
+if (RSTART) {
+Option["view"] = 0
+continue
+}
+match(ARGV[pos], /^--?browser(=(.*)?)?$/, group)
+if (RSTART) {
+Option["browser"] = group[1] ?
+(group[2] ? group[2] : Option["browser"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(x|proxy)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["proxy"] = group[2] ?
+(group[3] ? group[3] : Option["proxy"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(u|user-agent)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["user-agent"] = group[2] ?
+(group[3] ? group[3] : Option["user-agent"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(I|int(e(r(a(c(t(i(ve?)?)?)?)?)?)?)?|shell)$/)
+if (RSTART) {
+Option["interactive"] = 1
+continue
+}
+match(ARGV[pos], /^--?(E|emacs)$/)
+if (RSTART) {
+Option["emacs"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-rlwrap$/)
+if (RSTART) {
+Option["no-rlwrap"] = 1
+continue
+}
+match(ARGV[pos], /^--?prompt(=(.*)?)?$/, group)
+if (RSTART) {
+w("[ERROR] Option '-prompt' has been deprecated since version 0.9.\n"\
+"        Use configuration variable 'fmt-prompt' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?prompt-color(=(.*)?)?$/, group)
+if (RSTART) {
+w("[ERROR] Option '-prompt-color' has been deprecated since version 0.9.\n"\
+"        Use configuration variable 'sgr-prompt' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?i(n(p(ut?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["input"] = group[4] ?
+(group[5] ? group[5] : Option["input"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?o(u(t(p(ut?)?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["output"] = group[5] ?
+(group[6] ? group[6] : Option["output"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(l(a(ng?)?)?|hl)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["hl"] = group[4] ?
+(group[5] ? group[5] : Option["hl"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(s(o(u(r(ce?)?)?)?|l)?|f|from)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["sl"] = group[6] ?
+(group[7] ? group[7] : Option["sl"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?t(a(r(g(et?)?)?)?|l|o)?(=(.*)?)?$/, group)
+if (RSTART) {
+if (group[5]) {
+if (group[6]) split(group[6], Option["tl"], "+")
+} else
+split(ARGV[++pos], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
+if (RSTART) {
+if (group[1]) Option["sl"] = group[1]
+if (group[4]) split(group[4], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^--?(D|debug)$/)
+if (RSTART) {
+Option["debug"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-init/)
+if (RSTART) continue
+match(ARGV[pos], /^-(-?no-op)?$/)
+if (RSTART) continue
+match(ARGV[pos], /^--$/)
+if (RSTART) {
+++pos
+break
+}
+noargv[noargc++] = ARGV[pos]
+}
+if (Option["interactive"] && !Option["no-rlwrap"])
+rlwrapMe()
+else if (Option["emacs"] && !Option["interactive"] && !Option["no-rlwrap"])
+if (emacsMe())
+Option["interactive"] = 1
+initMisc()
+switch (InfoOnly) {
+case "version":
+print getVersion()
+exit ExitCode
+case "help":
+print getHelp()
+exit ExitCode
+case "manual":
+showMan()
+exit ExitCode
+case "reference":
+print getReference("endonym")
+exit ExitCode
+case "reference-english":
+print getReference("name")
+exit ExitCode
+case "list":
+print getList(Option["tl"])
+exit ExitCode
+case "list-engines":
+for (translator in Translator)
+print (Option["engine"] == translator ? "* " : "  ") translator
+exit ExitCode
+case "upgrade":
+upgrade()
+exit ExitCode
+case "nothing":
+exit ExitCode
+}
+setTheme()
+if (Option["interactive"])
+welcome()
+if (pos < ARGC)
+for (i = pos; i < ARGC; i++)
+noargv[noargc++] = ARGV[i]
+if (noargc) {
+for (i = 0; i < noargc; i++) {
+if (Option["verbose"] && i > pos)
+p(prettify("source-seperator", replicate(Option["chr-source-seperator"], Option["width"])))
+translate(noargv[i], 1)
+}
+} else {
+if (!Option["input"]) Option["input"] = STDIN
+}
+if (Option["input"])
+translateMain()
+exit ExitCode
+}
+EOF
+read -r -d '' TRANS_MANPAGE << 'EOF'
+.\" Automatically generated by Pandoc 2.1.1
+.\"
+.TH "TRANS" "1" "2018\-03\-17" "0.9.6.7" ""
+.hy
+.SH NAME
+.PP
+trans \- Command\-line translator using Google Translate, Bing
+Translator, Yandex.Translate, DeepL Translator, etc.
+.SH SYNOPSIS
+.PP
+\f[B]trans\f[] [\f[I]OPTIONS\f[]] [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
+[\f[I]TEXT\f[]]...
+.SH DESCRIPTION
+.PP
+This tool translates text into any language from the command\-line,
+using a translation engine such as Google Translate, Bing Translator and
+Yandex.Translate.
+.PP
+Each argument which is not a valid option is treated as \f[I]TEXT\f[] to
+be translated.
+.PP
+If neither \f[I]TEXT\f[] nor the input file is specified by
+command\-line arguments, the program will read and translate from
+standard input.
+.SH OPTIONS
+.SS Information options
+.TP
+.B \f[B]\-V\f[], \f[B]\-version\f[]
+Print version and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-H\f[], \f[B]\-help\f[]
+Print help message and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-M\f[], \f[B]\-man\f[]
+Show man page and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-T\f[], \f[B]\-reference\f[]
+Print reference table of all supported languages and codes, and exit.
+Names of languages are displayed in their endonyms (language name in the
+language itself).
+.RS
+.RE
+.TP
+.B \f[B]\-R\f[], \f[B]\-reference\-english\f[]
+Print reference table of all supported languages and codes, and exit.
+Names of languages are displayed in English.
+.RS
+.RE
+.TP
+.B \f[B]\-L\f[] \f[I]CODES\f[], \f[B]\-list\f[] \f[I]CODES\f[]
+Print details of languages and exit.
+When specifying two or more language codes, concatenate them by plus
+sign "+".
+.RS
+.RE
+.TP
+.B \f[B]\-S\f[], \f[B]\-list\-engines\f[]
+List available translation engines and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-U\f[], \f[B]\-upgrade\f[]
+Check for upgrade of this program.
+.RS
+.RE
+.SS Translator options
+.TP
+.B \f[B]\-e\f[] \f[I]ENGINE\f[], \f[B]\-engine\f[] \f[I]ENGINE\f[]
+Specify the translation engine to use.
+(default: google)
+.RS
+.RE
+.SS Display options
+.TP
+.B \f[B]\-verbose\f[]
+Verbose mode.
+.RS
+.PP
+Show the original text and its most relevant translation, then its
+phonetic notation (if any), then its alternative translations (if any)
+or its definition in the dictionary (if it is a word).
+.PP
+This option is unnecessary in most cases since verbose mode is enabled
+by default.
+.RE
+.TP
+.B \f[B]\-b\f[], \f[B]\-brief\f[]
+Brief mode.
+.RS
+.PP
+Show the most relevant translation or its phonetic notation only.
+.RE
+.TP
+.B \f[B]\-d\f[], \f[B]\-dictionary\f[]
+Dictionary mode.
+.RS
+.PP
+Show the definition of the original word in the dictionary.
+.RE
+.TP
+.B \f[B]\-identify\f[]
+Language identification.
+.RS
+.PP
+Show the identified language of the original text.
+.RE
+.TP
+.B \f[B]\-show\-original\f[] \f[I]Y/n\f[]
+Show original text or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-original\-phonetics\f[] \f[I]Y/n\f[]
+Show phonetic notation of original text or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-translation\f[] \f[I]Y/n\f[]
+Show translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-translation\-phonetics\f[] \f[I]Y/n\f[]
+Show phonetic notation of translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-prompt\-message\f[] \f[I]Y/n\f[]
+Show prompt message or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-languages\f[] \f[I]Y/n\f[]
+Show source and target languages or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-original\-dictionary\f[] \f[I]y/N\f[]
+Show dictionary entry of original text or not.
+(default: no)
+.RS
+.PP
+This option is enabled in dictionary mode.
+.RE
+.TP
+.B \f[B]\-show\-dictionary\f[] \f[I]Y/n\f[]
+Show dictionary entry of translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-alternatives\f[] \f[I]Y/n\f[]
+Show alternative translations or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-w\f[] \f[I]NUM\f[], \f[B]\-width\f[] \f[I]NUM\f[]
+Specify the screen width for padding.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]COLUMNS\f[].
+.RE
+.TP
+.B \f[B]\-indent\f[] \f[I]NUM\f[]
+Specify the size of indent (number of spaces).
+(default: 4)
+.RS
+.RE
+.TP
+.B \f[B]\-theme\f[] \f[I]FILENAME\f[]
+Specify the theme to use.
+(default: default)
+.RS
+.RE
+.TP
+.B \f[B]\-no\-theme\f[]
+Do not use any other theme than default.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-ansi\f[]
+Do not use ANSI escape codes.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-autocorrect\f[]
+Do not autocorrect.
+(if defaulted by the translation engine)
+.RS
+.RE
+.TP
+.B \f[B]\-no\-bidi\f[]
+Do not convert bidirectional texts.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-warn\f[]
+Do not write warning messages to stderr.
+.RS
+.RE
+.TP
+.B \f[B]\-dump\f[]
+Print raw API response instead.
+.RS
+.RE
+.SS Audio options
+.TP
+.B \f[B]\-p\f[], \f[B]\-play\f[]
+Listen to the translation.
+.RS
+.PP
+You must have at least one of the supported audio players
+(\f[B]mplayer\f[], \f[B]mpv\f[] or \f[B]mpg123\f[]) installed to stream
+from Google Text\-to\-Speech engine.
+Otherwise, a local speech synthesizer may be used instead (\f[B]say\f[]
+on macOS, \f[B]espeak\f[] on Linux or other platforms).
+.RE
+.TP
+.B \f[B]\-speak\f[]
+Listen to the original text.
+.RS
+.RE
+.TP
+.B \f[B]\-n\f[] \f[I]VOICE\f[], \f[B]\-narrator\f[] \f[I]VOICE\f[]
+Specify the narrator, and listen to the translation.
+.RS
+.PP
+Common values for this option are \f[B]male\f[] and \f[B]female\f[].
+.RE
+.TP
+.B \f[B]\-player\f[] \f[I]PROGRAM\f[]
+Specify the audio player to use, and listen to the translation.
+.RS
+.PP
+Option \f[B]\-play\f[] will try to use \f[B]mplayer\f[], \f[B]mpv\f[] or
+\f[B]mpg123\f[] by default, since these players are known to work for
+streaming URLs.
+Not all command\-line audio players can work this way.
+Use this option only when you have your own preference.
+.PP
+This option overrides the setting of environment variable
+$\f[B]PLAYER\f[].
+.RE
+.TP
+.B \f[B]\-no\-play\f[]
+Do not listen to the translation.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-translate\f[]
+Do not translate anything when using \-speak.
+.RS
+.RE
+.TP
+.B \f[B]\-download\-audio\f[]
+Download the audio to the current directory.
+.RS
+.RE
+.TP
+.B \f[B]\-download\-audio\-as\f[] \f[I]FILENAME\f[]
+Download the audio to the specified file.
+.RS
+.RE
+.SS Terminal paging and browsing options
+.TP
+.B \f[B]\-v\f[], \f[B]\-view\f[]
+View the translation in a terminal pager (\f[B]less\f[], \f[B]more\f[]
+or \f[B]most\f[]).
+.RS
+.RE
+.TP
+.B \f[B]\-pager\f[] \f[I]PROGRAM\f[]
+Specify the terminal pager to use, and view the translation.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]PAGER\f[].
+.RE
+.TP
+.B \f[B]\-no\-view\f[]
+Do not view the translation in a terminal pager.
+.RS
+.RE
+.TP
+.B \f[B]\-browser\f[] \f[I]PROGRAM\f[]
+Specify the web browser to use.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]BROWSER\f[].
+.RE
+.SS Networking options
+.TP
+.B \f[B]\-x\f[] \f[I]HOST:PORT\f[], \f[B]\-proxy\f[] \f[I]HOST:PORT\f[]
+Use HTTP proxy on given port.
+.RS
+.PP
+This option overrides the setting of environment variables
+$\f[B]HTTP_PROXY\f[] and $\f[B]http_proxy\f[].
+.RE
+.TP
+.B \f[B]\-u\f[] \f[I]STRING\f[], \f[B]\-user\-agent\f[] \f[I]STRING\f[]
+Specify the User\-Agent to identify as.
+.RS
+.PP
+This option overrides the setting of environment variables
+$\f[B]USER_AGENT\f[].
+.RE
+.SS Interactive shell options
+.TP
+.B \f[B]\-I\f[], \f[B]\-interactive\f[], \f[B]\-shell\f[]
+Start an interactive shell, invoking \f[B]rlwrap\f[] whenever possible
+(unless \f[B]\-no\-rlwrap\f[] is specified).
+.RS
+.RE
+.TP
+.B \f[B]\-E\f[], \f[B]\-emacs\f[]
+Start the GNU Emacs front\-end for an interactive shell.
+.RS
+.PP
+This option does not need to, and cannot be used along with \f[B]\-I\f[]
+or \f[B]\-no\-rlwrap\f[].
+.RE
+.TP
+.B \f[B]\-no\-rlwrap\f[]
+Do not invoke \f[B]rlwrap\f[] when starting an interactive shell.
+.RS
+.PP
+This option is useful when your terminal type is not supported by
+\f[B]rlwrap\f[] (e.g.
+\f[B]emacs\f[]).
+.RE
+.SS I/O options
+.TP
+.B \f[B]\-i\f[] \f[I]FILENAME\f[], \f[B]\-input\f[] \f[I]FILENAME\f[]
+Specify the input file.
+.RS
+.PP
+Source text to be translated will be read from the input file, instead
+of standard input.
+.RE
+.TP
+.B \f[B]\-o\f[] \f[I]FILENAME\f[], \f[B]\-output\f[] \f[I]FILENAME\f[]
+Specify the output file.
+.RS
+.PP
+Translations will be written to the output file, instead of standard
+output.
+.RE
+.SS Language preference options
+.TP
+.B \f[B]\-l\f[] \f[I]CODE\f[], \f[B]\-hl\f[] \f[I]CODE\f[], \f[B]\-lang\f[] \f[I]CODE\f[]
+Specify your home language (the language you would like to see for
+displaying prompt messages in the translation).
+.RS
+.PP
+This option affects only the display in verbose mode (anything other
+than source language and target language will be displayed in your home
+language).
+This option has no effect in brief mode.
+.PP
+This option is optional.
+When its setting is omitted, English will be used.
+.PP
+This option overrides the setting of environment variables
+$\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
+$\f[B]HOME_LANG\f[].
+.RE
+.TP
+.B \f[B]\-s\f[] \f[I]CODE\f[], \f[B]\-sl\f[] \f[I]CODE\f[], \f[B]\-source\f[] \f[I]CODE\f[], \f[B]\-from\f[] \f[I]CODE\f[]
+Specify the source language (the language of original text).
+.RS
+.PP
+This option is optional.
+When its setting is omitted, the language of original text will be
+identified automatically (with a possibility of misidentification).
+.PP
+This option overrides the setting of environment variable
+$\f[B]SOURCE_LANG\f[].
+.RE
+.TP
+.B \f[B]\-t\f[] \f[I]CODES\f[], \f[B]\-tl\f[] \f[I]CODE\f[], \f[B]\-target\f[] \f[I]CODES\f[], \f[B]\-to\f[] \f[I]CODES\f[]
+Specify the target language(s) (the language(s) of translated text).
+When specifying two or more language codes, concatenate them by plus
+sign "+".
+.RS
+.PP
+This option is optional.
+When its setting is omitted, everything will be translated into English.
+.PP
+This option overrides the setting of environment variables
+$\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
+$\f[B]TARGET_LANG\f[].
+.RE
+.TP
+.B [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
+A simpler, alternative way to specify the source language and target
+language(s) is to use a shortcut formatted string:
+.RS
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE\f[]
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE\f[]
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
+.PP
+Delimiter ":" and "=" can be used interchangeably.
+.PP
+Either \f[I]SOURCE\f[] or \f[I]TARGETS\f[] may be omitted, but the
+delimiter character must be kept.
+.RE
+.SS Other options
+.TP
+.B \f[B]\-no\-init\f[]
+Do not load any initialization script.
+.RS
+.RE
+.TP
+.B \f[B]\-\-\f[]
+End\-of\-options.
+.RS
+.PP
+All arguments after this option are treated as \f[I]TEXT\f[] to be
+translated.
+.RE
+.SH EXIT STATUS
+.TP
+.B \f[B]0\f[]
+Successful translation.
+.RS
+.RE
+.TP
+.B \f[B]1\f[]
+Error.
+.RS
+.RE
+.SH ENVIRONMENT
+.TP
+.B \f[B]PAGER\f[]
+Equivalent to option setting \f[B]\-pager\f[].
+.RS
+.RE
+.TP
+.B \f[B]BROWSER\f[]
+Equivalent to option setting \f[B]\-browser\f[].
+.RS
+.RE
+.TP
+.B \f[B]PLAYER\f[]
+Equivalent to option setting \f[B]\-player\f[].
+.RS
+.RE
+.TP
+.B \f[B]HTTP_PROXY\f[]
+Equivalent to option setting \f[B]\-proxy\f[].
+.RS
+.RE
+.TP
+.B \f[B]USER_AGENT\f[]
+Equivalent to option setting \f[B]\-user\-agent\f[].
+.RS
+.RE
+.TP
+.B \f[B]HOME_LANG\f[]
+Equivalent to option setting \f[B]\-lang\f[].
+.RS
+.RE
+.TP
+.B \f[B]SOURCE_LANG\f[]
+Equivalent to option setting \f[B]\-source\f[].
+.RS
+.RE
+.TP
+.B \f[B]TARGET_LANG\f[]
+Equivalent to option setting \f[B]\-target\f[].
+.RS
+.RE
+.SH FILES
+.TP
+.B \f[I]/etc/translate\-shell\f[]
+Initialization script.
+(system\-wide)
+.RS
+.RE
+.TP
+.B \f[I]$HOME/.translate\-shell/init.trans\f[]
+Initialization script.
+(user\-specific)
+.RS
+.RE
+.TP
+.B \f[I]$XDG_CONFIG_HOME/translate\-shell/init.trans\f[]
+Initialization script.
+(user\-specific)
+.RS
+.RE
+.TP
+.B \f[I]./.trans\f[]
+Initialization script.
+(current directory)
+.RS
+.RE
+.SH REPORTING BUGS
+.PP
+<https://github.com/soimort/translate-shell/issues>
+.SH AUTHORS
+Mort Yao <soi@mort.ninja>.
+EOF
+export TRANS_MANPAGE
+export TRANS_BUILD=release
+gawk -f <(echo -E "$TRANS_PROGRAM") - "$@"

+ 1 - 0
R9/Utils/SlowDNS/README.md

@@ -0,0 +1 @@
+#SlowDNS

BIN
R9/Utils/SlowDNS/dns-server


BIN
R9/Utils/badvpn/badvpn-master.zip


+ 14 - 0
R9/Utils/badvpn/badvpn.service

@@ -0,0 +1,14 @@
+[Unit]
+Description=BadVPN UDPGW Service
+After=network.target
+
+[Service]
+Type=simple
+User=root
+WorkingDirectory=/root
+ExecStart=/usr/bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
+Restart=always
+RestartSec=3s
+
+[Install]
+WantedBy=multi-user.target

+ 134 - 0
R9/Utils/badvpn/budp.sh

@@ -0,0 +1,134 @@
+#!/bin/bash
+#19/12/2019
+clear
+msg () {
+local colors=""
+if [[ ! -e $colors ]]; then
+COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
+COLOR[1]='\e[31m' #VERMELHO='\e[31m'
+COLOR[2]='\e[32m' #VERDE='\e[32m'
+COLOR[3]='\e[33m' #AMARELO='\e[33m'
+COLOR[4]='\e[34m' #AZUL='\e[34m'
+COLOR[5]='\e[91m' #MAGENTA='\e[35m'
+COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
+else
+local COL=0
+for number in $(cat $colors); do
+case $number in
+1)COLOR[$COL]='\033[1;37m';;
+2)COLOR[$COL]='\e[31m';;
+3)COLOR[$COL]='\e[32m';;
+4)COLOR[$COL]='\e[33m';;
+5)COLOR[$COL]='\e[34m';;
+6)COLOR[$COL]='\e[35m';;
+7)COLOR[$COL]='\033[1;36m';;
+esac
+let COL++
+done
+fi
+NEGRITO='\e[1m'
+SEMCOR='\e[0m'
+ case $1 in
+  -ne)cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+  -ama)cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verm)cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verm2)cor="${COLOR[1]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -azu)cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verd)cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -bra)cor="${COLOR[0]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  "-bar2"|"-bar")cor="${COLOR[1]}=====================================================" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+  -bar3)cor="${COLOR[1]}-----------------------------------------------------" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+ esac
+}
+
+msg -bar
+echo -e  "         INSTALADOR BADVPN-UDPGW @Rufu99" | lolcat
+msg -bar
+
+BadVPN () {
+if [[ -z $(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND"|grep "badvpn-ud"|awk '{print $1}') ]]; then
+    msg -ama "                  INICIADO BADVPN"
+    msg -bar
+
+echo -e "[Unit]
+Description=BadVPN UDPGW Service
+After=network.target\n
+[Service]
+Type=simple
+User=root
+WorkingDirectory=/root
+ExecStart=/usr/bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
+Restart=always
+RestartSec=3s\n
+[Install]
+WantedBy=multi-user.target" > /etc/systemd/system/badvpn.service
+
+    systemctl enable badvpn &>/dev/null
+    systemctl start badvpn &>/dev/null
+    sleep 2
+    [[ -z $(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND"|grep "badvpn-ud"|awk '{print $1}') ]] && msg -verm2 "                  FALLA AL INICIAR" || msg -verd "                  BADVPN INICIADO" 
+    msg -bar
+    sleep 1
+else
+    msg -ama "                DETENIENDO BADVPN"
+    msg -bar
+    systemctl stop badvpn &>/dev/null
+    systemctl disable badvpn &>/dev/null
+    rm /etc/systemd/system/badvpn.service
+    sleep 2
+    [[ -z $(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND"|grep "badvpn-ud"|awk '{print $1}') ]] && msg -ama "                 BADVPN DETENIDO" || msg -verm2 "                FALLA AL DETENER"
+    msg -bar
+    sleep 1  
+fi
+unset st_badvpn
+}
+
+if [[ ! -e /root/udp-rufu ]]; then
+	rm -rf /usr/bin/badvpn-udpgw &>/dev/null
+	rm -rf /bin/badvpn-udpgw &>/dev/null
+	touch /root/udp-rufu
+fi
+        if [[ ! -e /usr/bin/badvpn-udpgw ]]; then
+            echo -ne "$(msg -azu " INSTALADO DEPENDECIAS...") "
+
+            if apt install cmake -y &>/dev/null; then
+                msg -verd "[OK]"
+            else
+                msg -verm2 "[fail]"
+                slee 3
+                return
+            fi
+            cd $HOME
+            echo -ne "$(msg -azu " DESCARGANDO BADVPN......") "
+            if wget https://github.com/rudi9999/ADMRufu/raw/main/Utils/badvpn/badvpn-master.zip &>/dev/null; then
+                msg -verd "[OK]"
+            else
+                msg -verm2 "[fail]"
+                slee 3
+                return
+            fi
+
+            echo -ne "$(msg -azu " DESCOMPRIMIENDO.........") "
+            if unzip badvpn-master.zip &>/dev/null; then
+                msg -verd "[OK]"
+            else
+                msg -verm2 "[fail]"
+                slee 3
+                return
+            fi
+            cd badvpn-master
+            mkdir build
+            cd build
+
+            echo -ne "$(msg -azu " COMPILANDO BADVPN.......") "
+            if cmake .. -DCMAKE_INSTALL_PREFIX="/" -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_UDPGW=1 &>/dev/null && make install &>/dev/null; then
+                msg -verd "[OK]"
+            else
+                msg -verm2 "[fail]"
+                slee 3
+                return
+            fi
+            cd $HOME
+            rm badvpn-master.zip &>/dev/null
+        fi
+BadVPN

+ 7 - 0
R9/Utils/v2ray/README.md

@@ -0,0 +1,7 @@
+INSTALADOR V2RAY
+
+source <(curl -sSL https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Utils/v2ray/v2ray.sh)
+
+INSTALADOR ORIGINAL
+
+source <(curl -sL https://multi.netlify.app/v2ray.sh)

+ 355 - 0
R9/Utils/v2ray/v2ray.sh

@@ -0,0 +1,355 @@
+#!/bin/bash
+# Author: Jrohy
+# github: https://github.com/Jrohy/multi-v2ray
+
+#定时任务北京执行时间(0~23)
+BEIJING_UPDATE_TIME=3
+
+#记录最开始运行脚本的路径
+BEGIN_PATH=$(pwd)
+
+#安装方式, 0为全新安装, 1为保留v2ray配置更新
+INSTALL_WAY=0
+
+#定义操作变量, 0为否, 1为是
+HELP=0
+
+REMOVE=0
+
+CHINESE=0
+
+BASE_SOURCE_PATH="https://multi.netlify.app"
+
+UTIL_PATH="/etc/v2ray_util/util.cfg"
+
+UTIL_CFG="$BASE_SOURCE_PATH/v2ray_util/util_core/util.cfg"
+
+BASH_COMPLETION_SHELL="$BASE_SOURCE_PATH/v2ray"
+
+CLEAN_IPTABLES_SHELL="$BASE_SOURCE_PATH/v2ray_util/global_setting/clean_iptables.sh"
+
+#Centos 临时取消别名
+[[ -f /etc/redhat-release && -z $(echo $SHELL|grep zsh) ]] && unalias -a
+
+[[ -z $(echo $SHELL|grep zsh) ]] && ENV_FILE=".bashrc" || ENV_FILE=".zshrc"
+
+#######color code########
+RED="31m"
+GREEN="32m"
+YELLOW="33m"
+BLUE="36m"
+FUCHSIA="35m"
+
+colorEcho(){
+    COLOR=$1
+    echo -e "\033[${COLOR}${@:2}\033[0m"
+}
+
+msg () {
+local colors="${ADM_tmp}/ADM-color"
+if [[ ! -e $colors ]]; then
+COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
+COLOR[1]='\e[31m' #VERMELHO='\e[31m'
+COLOR[2]='\e[32m' #VERDE='\e[32m'
+COLOR[3]='\e[33m' #AMARELO='\e[33m'
+COLOR[4]='\e[34m' #AZUL='\e[34m'
+COLOR[5]='\e[91m' #MAGENTA='\e[35m'
+COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
+else
+local COL=0
+for number in $(cat $colors); do
+case $number in
+1)COLOR[$COL]='\033[1;37m';;
+2)COLOR[$COL]='\e[31m';;
+3)COLOR[$COL]='\e[32m';;
+4)COLOR[$COL]='\e[33m';;
+5)COLOR[$COL]='\e[34m';;
+6)COLOR[$COL]='\e[35m';;
+7)COLOR[$COL]='\033[1;36m';;
+esac
+let COL++
+done
+fi
+NEGRITO='\e[1m'
+SEMCOR='\e[0m'
+ case $1 in
+  -ne)cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
+  -ama)cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verm)cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verm2)cor="${COLOR[1]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -azu)cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -verd)cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  -bra)cor="${COLOR[0]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
+  "-bar2"|"-bar")cor="${COLOR[1]}=====================================================" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+  -bar3)cor="${COLOR[1]}-----------------------------------------------------" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
+ esac
+}
+
+print_center(){
+    local x
+    local y
+    #text="$*"
+    text="$2"
+    #x=$(( ($(tput cols) - ${#text}) / 2))
+    x=$(( ( 54 - ${#text}) / 2))
+    echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
+    #echo -e "\033[${y};${x}f$*"
+    msg "$1" "\033[${y};${x}f$2"
+}
+
+fun_bar(){
+    comando="$1"
+    txt="$2"
+    _=$(
+    $comando > /dev/null 2>&1
+    ) & > /dev/null
+    pid=$!
+    while [[ -d /proc/$pid ]]; do
+        echo -ne " \033[1;33m$txt["
+        for((i=0; i<10; i++)); do
+            echo -ne "\033[1;31m##"
+            sleep 0.2
+        done
+        echo -ne "\033[1;33m]"
+        sleep 1s
+        echo
+        tput cuu1 && tput dl1
+    done
+    echo -e " \033[1;33m$txt[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+    sleep 1s
+}
+
+#######get params#########
+while [[ $# > 0 ]];do
+    key="$1"
+    case $key in
+        --remove)
+        REMOVE=1
+        ;;
+        -h|--help)
+        HELP=1
+        ;;
+        -k|--keep)
+        INSTALL_WAY=1
+        colorEcho ${BLUE} "keep config to update\n"
+        ;;
+        --zh)
+        CHINESE=1
+        colorEcho ${BLUE} "安装中文版..\n"
+        ;;
+        *)
+                # unknown option
+        ;;
+    esac
+    shift # past argument or value
+done
+#############################
+
+help(){
+    echo "bash v2ray.sh [-h|--help] [-k|--keep] [--remove]"
+    echo "  -h, --help           Show help"
+    echo "  -k, --keep           keep the config.json to update"
+    echo "      --remove         remove v2ray,xray && multi-v2ray"
+    echo "                       no params to new install"
+    return 0
+}
+
+removeV2Ray() {
+    #卸载V2ray脚本
+    bash <(curl -L -s https://multi.netlify.app/go.sh) --remove >/dev/null 2>&1
+    rm -rf /etc/v2ray >/dev/null 2>&1
+    rm -rf /var/log/v2ray >/dev/null 2>&1
+
+    #卸载Xray脚本
+    bash <(curl -L -s https://multi.netlify.app/go.sh) --remove -x >/dev/null 2>&1
+    rm -rf /etc/xray >/dev/null 2>&1
+    rm -rf /var/log/xray >/dev/null 2>&1
+
+    #清理v2ray相关iptable规则
+    bash <(curl -L -s $CLEAN_IPTABLES_SHELL)
+
+    #卸载multi-v2ray
+    pip uninstall v2ray_util -y
+    rm -rf /usr/share/bash-completion/completions/v2ray.bash >/dev/null 2>&1
+    rm -rf /usr/share/bash-completion/completions/v2ray >/dev/null 2>&1
+    rm -rf /usr/share/bash-completion/completions/xray >/dev/null 2>&1
+    rm -rf /etc/bash_completion.d/v2ray.bash >/dev/null 2>&1
+    rm -rf /usr/local/bin/v2ray >/dev/null 2>&1
+    rm -rf /etc/v2ray_util >/dev/null 2>&1
+
+    #删除v2ray定时更新任务
+    crontab -l|sed '/SHELL=/d;/v2ray/d'|sed '/SHELL=/d;/xray/d' > crontab.txt
+    crontab crontab.txt >/dev/null 2>&1
+    rm -f crontab.txt >/dev/null 2>&1
+
+    if [[ ${PACKAGE_MANAGER} == 'dnf' || ${PACKAGE_MANAGER} == 'yum' ]];then
+        systemctl restart crond >/dev/null 2>&1
+    else
+        systemctl restart cron >/dev/null 2>&1
+    fi
+
+    #删除multi-v2ray环境变量
+    sed -i '/v2ray/d' ~/$ENV_FILE
+    sed -i '/xray/d' ~/$ENV_FILE
+    source ~/$ENV_FILE
+
+    colorEcho ${GREEN} "uninstall success!"
+}
+
+closeSELinux() {
+    #禁用SELinux
+    if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
+        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
+        setenforce 0
+    fi
+}
+
+checkSys() {
+    #检查是否为Root
+    [ $(id -u) != "0" ] && { colorEcho ${RED} "Error: You must be root to run this script"; exit 1; }
+
+    if [[ `command -v apt-get` ]];then
+        PACKAGE_MANAGER='apt-get'
+    elif [[ `command -v dnf` ]];then
+        PACKAGE_MANAGER='dnf'
+    elif [[ `command -v yum` ]];then
+        PACKAGE_MANAGER='yum'
+    else
+        colorEcho $RED "Not support OS!"
+        exit 1
+    fi
+}
+
+#安装依赖
+installDependent(){
+    if [[ ${PACKAGE_MANAGER} == 'dnf' || ${PACKAGE_MANAGER} == 'yum' ]];then
+        ${PACKAGE_MANAGER} install socat crontabs bash-completion which -y
+    else
+        fun_bar "${PACKAGE_MANAGER} update" 'APT UPDATE           '
+        fun_bar "${PACKAGE_MANAGER} install socat cron bash-completion ntpdate gawk jq uuid-runtime -y" 'INSTALL DEPENDENCIAS '
+        msg -bar
+    fi
+
+    #install python3 & pip
+    source <(curl -sL https://python3.netlify.app/install.sh)
+}
+
+updateProject() {
+    [[ ! $(type pip 2>/dev/null) ]] && colorEcho $RED "pip no install!" && exit 1
+
+    pip install -U v2ray_util
+
+    if [[ -e $UTIL_PATH ]];then
+        [[ -z $(cat $UTIL_PATH|grep lang) ]] && echo "lang=en" >> $UTIL_PATH
+    else
+        mkdir -p /etc/v2ray_util
+        curl $UTIL_CFG > $UTIL_PATH
+    fi
+
+    [[ $CHINESE == 1 ]] && sed -i "s/lang=en/lang=zh/g" $UTIL_PATH
+
+    rm -f /usr/local/bin/v2ray >/dev/null 2>&1
+    ln -s $(which v2ray-util) /usr/local/bin/v2ray
+    rm -f /usr/local/bin/xray >/dev/null 2>&1
+    ln -s $(which v2ray-util) /usr/local/bin/xray
+
+    #移除旧的v2ray bash_completion脚本
+    [[ -e /etc/bash_completion.d/v2ray.bash ]] && rm -f /etc/bash_completion.d/v2ray.bash
+    [[ -e /usr/share/bash-completion/completions/v2ray.bash ]] && rm -f /usr/share/bash-completion/completions/v2ray.bash
+
+    #更新v2ray bash_completion脚本
+    curl $BASH_COMPLETION_SHELL > /usr/share/bash-completion/completions/v2ray
+    curl $BASH_COMPLETION_SHELL > /usr/share/bash-completion/completions/xray
+    if [[ -z $(echo $SHELL|grep zsh) ]];then
+        source /usr/share/bash-completion/completions/v2ray
+        source /usr/share/bash-completion/completions/xray
+    fi
+    
+    #安装V2ray主程序
+    [[ ${INSTALL_WAY} == 0 ]] && bash <(curl -L -s https://multi.netlify.app/go.sh)
+}
+
+#时间同步
+timeSync() {
+    if [[ ${INSTALL_WAY} == 0 ]];then
+        echo -e "${Info} Time Synchronizing.. ${Font}"
+        if [[ `command -v ntpdate` ]];then
+            ntpdate pool.ntp.org
+        elif [[ `command -v chronyc` ]];then
+            chronyc -a makestep
+        fi
+
+        if [[ $? -eq 0 ]];then 
+            echo -e "${OK} Time Sync Success ${Font}"
+            echo -e "${OK} now: `date -R`${Font}"
+        fi
+    fi
+}
+
+profileInit() {
+
+    #清理v2ray模块环境变量
+    [[ $(grep v2ray ~/$ENV_FILE) ]] && sed -i '/v2ray/d' ~/$ENV_FILE && source ~/$ENV_FILE
+
+    #解决Python3中文显示问题
+    [[ -z $(grep PYTHONIOENCODING=utf-8 ~/$ENV_FILE) ]] && echo "export PYTHONIOENCODING=utf-8" >> ~/$ENV_FILE && source ~/$ENV_FILE
+
+    #全新安装的新配置
+    [[ ${INSTALL_WAY} == 0 ]] && v2ray new
+
+    echo ""
+}
+
+installFinish() {
+    #回到原点
+    cd ${BEGIN_PATH}
+
+    [[ ${INSTALL_WAY} == 0 ]] && WAY="install" || WAY="update"
+    colorEcho  ${GREEN} "multi-v2ray ${WAY} success!\n"
+
+    config='/etc/v2ray/config.json'
+    tmp='/etc/v2ray/temp.json'
+    jq 'del(.inbounds[].streamSettings.kcpSettings[])' < /etc/v2ray/config.json >> /etc/v2ray/tmp.json
+    rm -rf /etc/v2ray/config.json
+    jq '.inbounds[].streamSettings += {"network":"ws","wsSettings":{"path": "/ADMRufu/","headers": {"Host": "ejemplo.com"}}}' < /etc/v2ray/tmp.json >> /etc/v2ray/config.json
+    chmod 777 /etc/v2ray/config.json
+
+    if [[ ${INSTALL_WAY} == 0 ]]; then
+        #clear
+
+        v2ray info
+
+        msg -bar
+        print_center -verd "INSTALACION FINALIZADA"
+        print_center -ama "Por favor verifique el log"
+        msg -bar
+        msg -ama "►► Presione enter para continuar ◄◄"
+        read foo
+    fi
+}
+
+
+main() {
+
+    [[ ${HELP} == 1 ]] && help && return
+
+    [[ ${REMOVE} == 1 ]] && removeV2Ray && return
+
+    [[ ${INSTALL_WAY} == 0 ]] && clear && msg -bar && print_center -verd "INSTALADO v2ray" && msg -bar
+
+    checkSys
+
+    installDependent
+
+    closeSELinux
+
+    timeSync
+
+    updateProject
+
+    profileInit
+
+    installFinish
+}
+
+main

+ 280 - 0
R9/install.sh

@@ -0,0 +1,280 @@
+#!/bin/bash
+ 
+ module="$(pwd)/module"
+ rm -rf ${module}
+ wget -O ${module} "https://raw.githubusercontent.com/rudi9999/Herramientas/main/module/module" &>/dev/null
+ [[ ! -e ${module} ]] && exit
+ chmod +x ${module} &>/dev/null
+ source ${module}
+ 
+ CTRL_C(){
+   rm -rf ${module}; exit
+ }
+ 
+ trap "CTRL_C" INT TERM EXIT
+ 
+ ADMRufu="/etc/ADMRufu" && [[ ! -d ${ADMRufu} ]] && mkdir ${ADMRufu}
+ ADM_inst="${ADMRufu}/install" && [[ ! -d ${ADM_inst} ]] && mkdir ${ADM_inst}
+ SCPinstal="$HOME/install"
+ 
+ rm -rf /etc/localtime &>/dev/null
+ ln -s /usr/share/zoneinfo/America/Argentina/Tucuman /etc/localtime &>/dev/null
+ rm $(pwd)/$0 &> /dev/null
+ 
+ stop_install(){
+  	title "INSTALACION CANCELADA"
+  	exit
+  }
+ 
+ time_reboot(){
+   print_center -ama "REINICIANDO VPS EN $1 SEGUNDOS"
+   REBOOT_TIMEOUT="$1"
+   
+   while [ $REBOOT_TIMEOUT -gt 0 ]; do
+      print_center -ne "-$REBOOT_TIMEOUT-\r"
+      sleep 1
+      : $((REBOOT_TIMEOUT--))
+   done
+   reboot
+ }
+ 
+ os_system(){
+   system=$(cat -n /etc/issue |grep 1 |cut -d ' ' -f6,7,8 |sed 's/1//' |sed 's/      //')
+   distro=$(echo "$system"|awk '{print $1}')
+ 
+   case $distro in
+     Debian)vercion=$(echo $system|awk '{print $3}'|cut -d '.' -f1);;
+     Ubuntu)vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2);;
+   esac
+ }
+ 
+ repo(){
+   link="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Repositorios/$1.list"
+   case $1 in
+     8|9|10|11|16.04|18.04|20.04|20.10|21.04|21.10|22.04)wget -O /etc/apt/sources.list ${link} &>/dev/null;;
+   esac
+ }
+ 
+ dependencias(){
+ 	soft="sudo bsdmainutils zip unzip ufw curl python python3 python3-pip openssl screen cron iptables lsof nano at mlocate gawk grep bc jq curl npm nodejs socat netcat netcat-traditional net-tools cowsay figlet lolcat"
+ 
+ 	for i in $soft; do
+ 		leng="${#i}"
+ 		puntos=$(( 21 - $leng))
+ 		pts="."
+ 		for (( a = 0; a < $puntos; a++ )); do
+ 			pts+="."
+ 		done
+ 		msg -nazu "       instalando $i$(msg -ama "$pts")"
+ 		if apt install $i -y &>/dev/null ; then
+ 			msg -verd "INSTALL"
+ 		else
+ 			msg -verm2 "FAIL"
+ 			sleep 2
+ 			tput cuu1 && tput dl1
+ 			print_center -ama "aplicando fix a $i"
+ 			dpkg --configure -a &>/dev/null
+ 			sleep 2
+ 			tput cuu1 && tput dl1
+ 
+ 			msg -nazu "       instalando $i$(msg -ama "$pts")"
+ 			if apt install $i -y &>/dev/null ; then
+ 				msg -verd "INSTALL"
+ 			else
+ 				msg -verm2 "FAIL"
+ 			fi
+ 		fi
+ 	done
+ }
+ 
+ ofus(){
+ 	unset server
+ 	server=$(echo ${txt_ofuscatw}|cut -d':' -f1)
+ 	unset txtofus
+ 	number=$(expr length $1)
+ 	for((i=1; i<$number+1; i++)); do
+ 		txt[$i]=$(echo "$1" | cut -b $i)
+ 		case ${txt[$i]} in
+ 			".")txt[$i]="*";;
+ 			"*")txt[$i]=".";;
+ 			"1")txt[$i]="@";;
+ 			"@")txt[$i]="1";;
+ 			"2")txt[$i]="?";;
+ 			"?")txt[$i]="2";;
+ 			"4")txt[$i]="%";;
+ 			"%")txt[$i]="4";;
+ 			"-")txt[$i]="K";;
+ 			"K")txt[$i]="-";;
+ 		esac
+ 		txtofus+="${txt[$i]}"
+ 	done
+ 	echo "$txtofus" | rev
+ }
+ 
+ function_verify () {
+   permited=$(curl -sSL "https://raw.githubusercontent.com/rudi9999/Control/master/Control-IP")
+   [[ $(echo $permited|grep "${IP}") = "" ]] && {
+     clear
+     msg -bar
+     print_center -verm2 "¡LA IP $(wget -qO- ipv4.icanhazip.com) NO ESTA AUTORIZADA!"
+     print_center -ama "CONTACTE A @Rufu99"
+     msg -bar
+   	rm ${ADMRufu}
+     [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq
+     exit
+   } || {
+   ### INTALAR VERCION DE SCRIPT
+   ver=$(curl -sSL "https://raw.githubusercontent.com/rudi9999/ADMRufu/main/vercion")
+   echo "$ver" > ${ADMRufu}/vercion
+   }
+ }
+ 
+ fun_ip(){
+     MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
+     MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+     [[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+ }
+ 
+ verificar_arq(){
+ 	unset ARQ
+ 	case $1 in
+ 		menu|menu_inst.sh|tool_extras.sh|chekup.sh)ARQ="${ADMRufu}";;
+ 		*)ARQ="${ADM_inst}";;
+ 	esac
+ 	mv -f ${SCPinstal}/$1 ${ARQ}/$1
+ 	chmod +x ${ARQ}/$1
+ }
+ 
+ error_fun(){
+ 	msg -bar3
+ 	print_center -verm "ERROR de enlace VPS<-->GENERADOR"
+ 	msg -bar3
+ 	[[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
+ 	exit
+ }
+ 
+ post_reboot(){
+   echo 'wget -O /root/install.sh "https://raw.githubusercontent.com/rudi9999/ADMRufu/main/install.sh"; clear; sleep 2; chmod +x /root/install.sh; /root/install.sh --continue' >> /root/.bashrc
+   title "INSTALADOR ADMRufu"
+   print_center -ama "La instalacion continuara\ndespues del reinicio!!!"
+   msg -bar
+ }
+ 
+ install_start(){
+   title "INSTALADOR ADMRufu"
+   print_center -ama "A continuacion se actualizaran los paquetes\ndel systema. Esto podria tomar tiempo,\ny requerir algunas preguntas\npropias de las actualizaciones."
+   msg -bar3
+   msg -ne " Desea continuar? [S/N]: "
+   read opcion
+   [[ "$opcion" != @(s|S) ]] && stop_install
+   title "INSTALADOR ADMRufu"
+   os_system
+   repo "${vercion}"
+   apt update -y; apt upgrade -y  
+ }
+ 
+ install_continue(){
+   os_system
+   title "INSTALADOR ADMRufu"
+   print_center -ama "$distro $vercion"
+   print_center -verd "INSTALANDO DEPENDENCIAS"
+   msg -bar3
+   dependencias
+   msg -bar3
+   print_center -azu "Removiendo paquetes obsoletos"
+   apt autoremove -y &>/dev/null
+   sleep 2
+   tput cuu1 && tput dl1
+   print_center -ama "si algunas de las dependencias falla!!!\nal terminar, puede intentar instalar\nla misma manualmente usando el siguiente comando\napt install nom_del_paquete"
+   enter
+ }
+ 
+ while :
+ do
+   case $1 in
+     -s|--start)install_start && post_reboot && time_reboot "15";;
+     -c|--continue)rm /root/install.sh &> /dev/null
+                   sed -i '/Rufu/d' /root/.bashrc
+                   install_continue
+                   break;;
+     -u|--update)install_start
+                 install_continue
+                 break;;
+     *)exit;;
+   esac
+ done
+ 
+ title "INSTALADOR ADMRufu"
+ fun_ip
+ while [[ ! $Key ]]; do
+ 	echo -e "  $(msg -verm3 "╭╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼╼[")$(msg -azu "INGRESA TU KEY")$(msg -verm3 "]")"
+ 	echo -ne "  $(msg -verm3 "╰╼")\033[37;1m>\e[32m\e[1m "
+ 	read Key
+ done
+ msg -bar3
+ msg -ne " Verificando Key: "
+ cd $HOME
+ wget -O $HOME/lista-arq $(ofus "$Key")/$IP > /dev/null 2>&1 && msg -verd "Key Completa" || {
+    msg -verm2 "Key Invalida"
+    msg -bar
+    [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq
+    exit
+    }
+ msg -bar3
+ 
+ IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" > /usr/bin/vendor_code
+ sleep 1s
+ function_verify
+ 
+ if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq|grep "KEY INVALIDA!") ]]; then
+ 
+    msg -verd " INSTALANDO SCRIPT ADMRufu... $(msg -ama "[Proyect by @Rufu99]")"
+    REQUEST=$(ofus "$Key"|cut -d'/' -f2)
+    [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
+    msg -nama "Descarga de archivos...  "
+    for arqx in $(cat $HOME/lista-arq); do
+     wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && {
+     verificar_arq "${arqx}"
+    } || {
+     msg -verm2 "fallida!!!"
+     sleep 2s
+     error_fun
+    }
+    done
+    msg -verd "completa!!!"
+    sleep 2s
+    rm $HOME/lista-arq
+    [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
+    rm -rf /usr/bin/menu
+    rm -rf /usr/bin/adm
+    rm -rf /usr/bin/ADMRufu
+    echo "${ADMRufu}/menu" > /usr/bin/menu && chmod +x /usr/bin/menu
+    echo "${ADMRufu}/menu" > /usr/bin/adm && chmod +x /usr/bin/adm
+    echo "${ADMRufu}/menu" > /usr/bin/ADMRufu && chmod +x /usr/bin/ADMRufu
+    sed -i '/Rufu/d' /root/bash.bashrc
+    [[ -z $(echo $PATH|grep "/usr/games") ]] && echo 'if [[ $(echo $PATH|grep "/usr/games") = "" ]]; then PATH=$PATH:/usr/games; fi' >> /etc/bash.bashrc
+    echo '[[ $UID = 0 ]] && screen -dmS up /etc/ADMRufu/chekup.sh' >> /etc/bash.bashrc
+    echo 'v=$(cat /etc/ADMRufu/vercion)' >> /etc/bash.bashrc
+    echo '[[ -e /etc/ADMRufu/new_vercion ]] && up=$(cat /etc/ADMRufu/new_vercion) || up=$v' >> /etc/bash.bashrc
+    echo -e "[[ \$(date '+%s' -d \$up) -gt \$(date '+%s' -d \$(cat /etc/ADMRufu/vercion)) ]] && v2=\"Nueva Vercion disponible: \$v >>> \$up\" || v2=\"Script Vercion: \$v\"" >> /etc/bash.bashrc
+    echo '[[ -e "/etc/ADMRufu/tmp/message.txt" ]] && mess1="$(less /etc/ADMRufu/tmp/message.txt)"' >> /etc/bash.bashrc
+    echo '[[ -z "$mess1" ]] && mess1="@Rufu99"' >> /etc/bash.bashrc
+    echo 'clear && echo -e "\n$(figlet -f big.flf "  ADMRufu")\n        RESELLER : $mess1 \n\n   Para iniciar ADMRufu escriba:  menu \n\n   $v2\n\n"|lolcat' >> /etc/bash.bashrc
+ 
+    update-locale LANG=en_US.UTF-8 LANGUAGE=en
+    clear
+    title "-- ADMRufu INSTALADO --"
+  else
+   [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq
+   clear
+   msg -bar
+   print_center -verm2 "KEY INVALIDA"
+   msg -bar
+   print_center -ama "Esta key no es valida o ya fue usada"
+   print_center -ama "Contacta con @Rufu99"
+   msg -bar
+   rm -rf ${module}
+   exit
+ fi
+ mv -f ${module} /etc/ADMRufu/module
+ time_reboot "10" 

+ 931 - 0
R9/online/ADMbot.sh

@@ -0,0 +1,931 @@
+#!/bin/bash
+exit 1
+#19/12/2019
+SCPdir="/etc/newadm" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/ger-user" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+# VERIFICANDO  CONDIÇÕES PRIMARIAS
+[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || apt-get install jq -y &>/dev/null
+[[ ! -e "/bin/ShellBot.sh" ]] && wget -O /bin/ShellBot.sh https://raw.githubusercontent.com/shellscriptx/shellbot/master/ShellBot.sh &> /dev/null
+[[ -e /etc/texto-bot ]] && rm /etc/texto-bot
+#VARIAVEL ENTRADA TOKEN
+msg -ama " BOT DE TELEGRAM Mod By MEX \033[1;31m"
+msg -bar
+if [[ $1 = "id" || -z $(ps aux |grep -v grep |grep -w "ADMbot.sh"|grep dmS|awk '{print $2}') ]]; then
+[[ -z $2 ]] && echo -ne "\033[1;37m$(fun_trans "Digite el Token del bot"): " && read TOKEN || TOKEN="$2"
+[[ -z "$TOKEN" ]] && exit 1 #SEM TOKEN, SEM BOT
+IDIOMA="$(cat ${SCPidioma})" && [[ -z $IDIOMA ]] && IDIOMA="es" #ARGUMENTO 2 (IDIOMA)
+[[ -z $3 ]] && echo -ne "\033[1;37m$(fun_trans "Digite su Usuario"): " && read USERLIB || USERLIB="$3"
+[[ -z "$USERLIB" ]] && exit 1 #USUARIO
+[[ -z $4 ]] && echo -ne "\033[1;37m$(fun_trans "Digite su Contraseña"): " && read PASSLIB || PASSLIB="$4"
+[[ -z "$PASSLIB" ]] && exit 1 #SENHA
+[[ -z $2 ]] && [[ -z $3 ]] && [[ -z $4 ]] && {
+screen -dmS telebot ${SCPfrm}/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
+msg -bar
+exit 0
+}
+else
+kill -9 $(ps aux |grep -v grep |grep -w "ADMbot.sh"|grep dmS|awk '{print $2}') && echo -e "\033[1;37m$(fun_trans "Bot Cerrado Con Exito")"
+msg -bar
+exit 0
+fi
+LINE='================================='
+USRdatabase="/etc/ADMuser"
+#IMPORTANDO API
+source ShellBot.sh
+ShellBot.init --token "$TOKEN"
+ShellBot.username
+# SUPRIME ERROS
+exec 2>/dev/null
+# SISTEMA DE PIDS
+dropbear_pids () {
+unset pids
+port_dropbear=`ps aux | grep dropbear | awk NR==1 | awk '{print $17;}'`
+log=/var/log/auth.log
+loginsukses='Password auth succeeded'
+[[ -z $port_dropbear ]] && return 1
+for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+  pids="${pids}$pidx\n"
+ done
+done
+for pid in `echo -e "$pids"`; do
+  pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+  i=0
+    for pidend in $pidlogs; do
+    let i++
+    done
+    if [[ $pidend ]]; then
+    login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+    PID=$pid
+    user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+    waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+    [[ -z $user ]] && continue
+    echo "$user|$PID|$waktu"
+    fi
+done
+}
+openvpn_pids () {
+#nome|#loguin|#rcv|#snd|#time
+  byte () {
+   while read B dummy; do
+   [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
+   KB=$(((B+512)/1024))
+   [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
+   MB=$(((KB+512)/1024))
+   [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
+   GB=$(((MB+512)/1024))
+   [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
+   echo $(((GB+512)/1024)) terabytes
+   done
+   }
+for user in $(mostrar_usuarios); do
+[[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
+i=0
+unset RECIVED
+unset SEND
+unset HOUR
+ while read line; do
+ IDLOCAL=$(echo ${line}|cut -d',' -f2)
+ RECIVED+="$(echo ${line}|cut -d',' -f3)+"
+ SEND+="$(echo ${line}|cut -d',' -f4)+"
+ DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
+ TIMEON="$(($(date +%s)-${DATESEC}))"
+  MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
+  HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
+  let i++
+ done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
+RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
+SEND=$(echo $(echo ${SEND}0|bc)|byte)
+HOUR=$(echo -e $HOUR|sort -n|tail -1)
+echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
+done
+}
+# ADICIONA USUARIO
+add_user () {
+#nome senha Dias limite
+[[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+useradd -M -s /bin/false $1 -e ${valid} > /dev/null 2>&1 || return 1
+(echo $2; echo $2)|passwd $1 2>/dev/null || {
+    userdel --force $1
+    return 1
+    }
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+}
+# REMOVER USUARIO
+rm_user () {
+#nome
+userdel --force "$1" &>/dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   rm ${USRdatabase} && touch ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   }
+}
+# LISTA OS USUARIOS CADASTRADOS
+mostrar_usuarios () {
+for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
+echo "$u"
+done
+}
+# DEFINE UM IP
+meu_ip () {
+if [[ -e /etc/MEUIPADM ]]; then
+echo "$(cat /etc/MEUIPADM)"
+else
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+echo "$MEU_IP2" > /etc/MEUIPADM
+fi
+}
+# USUARIO BLOCK
+blockfun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "USTED NO PUEDE USAR EL BOT")\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Comandos Bloqueados")\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0
+}
+# SISTEMA DE LOGUIN
+ativarid_fun () {
+if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS}|grep -w "$3") ]]; then
+local bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "ACESSO LIBERADO")\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Usted ya Puede usar el Bot")\n"
+          bot_retorno+="$(fun_trans "Dele Buen Uso")\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+elif [[ $1 = ${USERLIB} ]] && [[ $2 = ${PASSLIB} ]]; then
+[[ -z $LIBERADOS ]] && LIBERADOS="${3}" || LIBERADOS="${LIBERADOS} ${3}"
+local bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "LIBERACION EFECTUADA CON EXITO")\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Usted ya Puede usar el Bot")\n"
+          bot_retorno+="$(fun_trans "Dele Buen Uso")\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+else
+local bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "USTED NO PUEDE USAR EL BOT")\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "No tiene los permisos de uso")\n"
+          bot_retorno+="$(fun_trans "Intento de acesso negada")\n"
+          bot_retorno+="$(fun_trans "Usuario y Contraseña Erroneos")\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+fi
+}
+loguin_fun () {
+local bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "USUARIOS LIBERADOS EN BOT")\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+for lines in $(echo $LIBERADOS); do
+local bot_retorno+="$LINE\n"
+          bot_retorno2+="$(fun_trans "Usuario") ID: $lines\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno2)" \
+							--parse_mode markdown
+done
+return 0
+}
+# INFORMAÇÕES DA VPS
+infovps () {
+mine_port () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+i=0
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e ${portas}|grep "$var1|$var2")" ]] || {
+    portas+="$var1|$var2\n"
+    let i++
+    }
+done <<< "$portas_var"
+echo -e $portas
+}
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Puertos y Servicos Activos")\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="IP: $(meu_ip)\n"
+          while read line; do
+          local serv=$(echo $line|cut -d'|' -f1)
+          local port=$(echo $line|cut -d'|' -f2)
+          bot_retorno+="$(fun_trans "Servicio"): ${serv} $(fun_trans "Puerto"): ${port}\n"
+          done <<< "$(mine_port)"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0
+}
+# AJUDA
+ajuda_fun () {
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "Hola Amigo")\n"
+         bot_retorno+="$(fun_trans "Bienvenido al BOT") Mod By @Kalix1\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="$(fun_trans "Lista de Comandos Disponibles")\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="$(fun_trans "COMANDOS")\n"
+         bot_retorno+="/online ($(fun_trans "usuarios online"))\n"
+         bot_retorno+="/useradd ($(fun_trans "agregar usuario"))\n"
+         [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && bot_retorno+="/openadd ($(fun_trans "crear archivo openvpn"))\n"
+         bot_retorno+="/userdell ($(fun_trans "remover usuario"))\n"
+         bot_retorno+="/info ($(fun_trans "informacion de usuarios"))\n"
+         bot_retorno+="/infovps ($(fun_trans "informacion de servidor"))\n"
+         bot_retorno+="/usuarios ($(fun_trans "usuarios liberados en bot"))\n"
+         bot_retorno+="/lang ($(fun_trans "Traducir texto"))\n"
+         bot_retorno+="/scan ($(fun_trans "scan de subdominios"))\n"
+         bot_retorno+="/gerar ($(fun_trans "generador de payload"))\n"
+         bot_retorno+="/criptar ($(fun_trans "Codifica y Decodifica un Texto"))\n"
+         bot_retorno+="/logar ($(fun_trans "Usuario Contraseña") ($(fun_trans "libera el bot"))\n"
+         bot_retorno+="$LINE\n"
+	     ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0	
+}
+info_fun () {
+if [[ ! -e "${USRdatabase}" ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno="$(fun_trans "No se ha identificado una base de datos con los usuarios")\n"
+          bot_retorno="$(fun_trans "Los Usuarios a Seguir No contiene Ninguna Informacion")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+else
+VPSsec=$(date +%s)
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "Usuarios Cadastrados")\n"
+         bot_retorno+="$LINE\n"
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+         for user in $(mostrar_usuarios); do
+             sen=$(cat ${USRdatabase}|grep -w "$user"|cut -d '|' -f2)
+             [[ -z $sen ]] && sen="???"
+             DateExp="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f3)"
+             if [[ ! -z $DateExp ]]; then             
+             DataSec=$(date +%s --date="$DateExp")
+             [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[Exp]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+             else
+             EXPTIME="???"
+             fi
+             limit=$(cat ${USRdatabase}|grep -w "$user"|cut -d '|' -f4)
+             [[ -z $limit ]] && limit="???"
+             bot_retorno="$LINE\n"       
+             bot_retorno+="$(fun_trans "Usuario"): $user\n"
+             bot_retorno+="$(fun_trans "Contraseña"): $sen\n"
+             bot_retorno+="$(fun_trans "Dias Restantes"): $EXPTIME\n"
+             bot_retorno+="$(fun_trans "Limite"): $limit\n"
+             bot_retorno+="$LINE\n"
+             ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+         done
+fi
+return 0
+}
+online_fun () {
+MyTIME="${SCPusr}/time-adm"
+[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "Monitor de Usuarios")\n"
+         bot_retorno+="$LINE\n"
+while read user; do
+PID="0+"
+[[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps -u $user|grep sshd|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${user}"|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+PID+="0"
+[[ $(echo $PID|bc) = 0 ]] && continue
+TIMEON="${TIMEUS[$user]}"
+[[ -z $TIMEON ]] && TIMEON=0
+MIN=$(($TIMEON/60))
+SEC=$(($TIMEON-$MIN*60))
+HOR=$(($MIN/60))
+MIN=$(($MIN-$HOR*60))
+HOUR="${HOR}h:${MIN}m:${SEC}s"
+[[ -z $(cat ${USRdatabase}|grep -w "${user}") ]] && MAXPID="?" || MAXPID="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+TOTALPID="$(echo $PID|bc)/$MAXPID"
+local IMPRIME="YES"
+local bot_retorno+="$LINE\n"
+          bot_retorno="$(fun_trans "Usuario"): $user\n"
+          bot_retorno+="$(fun_trans "Conexiones"): $TOTALPID\n"
+          bot_retorno+="$(fun_trans "Tiempo Total"): $HOUR\n"
+          bot_retorno+="$LINE\n"
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+done <<< "$(mostrar_usuarios)"
+[[ -z $IMPRIME ]] && {
+ local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "No hay usuarios en linea")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+ return 0
+ }
+}
+useradd_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "MODO DE USO")\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="useradd $(fun_trans "Usuario Contraseña Dias Limite")\n"
+         bot_retorno+="$(fun_trans "Ejemplo"):\n"
+         bot_retorno+='useradd admin admin 30 1\n'
+         bot_retorno+="$LINE\n"
+         case $1 in
+         [1-3]|14)
+         [[ $1 = 1 ]] && bot_retorno+="$(fun_trans "Usuario Nulo")" && bot_retorno+="$LINE\n"
+         [[ $1 = 2 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Corto")" && bot_retorno+="$LINE\n"
+         [[ $1 = 3 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Grande")" && bot_retorno+="$LINE\n"
+         [[ $1 = 14 ]] && bot_retorno+="$(fun_trans "Usuario ya Existe")" && bot_retorno+="$LINE\n"
+         ;;
+         [4-6])
+         [[ $1 = 4 ]] && bot_retorno+="$(fun_trans "Contraseña Nula")" && bot_retorno+="$LINE\n"
+         [[ $1 = 5 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Corta")" && bot_retorno+="$LINE\n"
+         [[ $1 = 6 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Grande")" && bot_retorno+="$LINE\n"
+         ;;
+         [7-9])
+         [[ $1 = 7 ]] && bot_retorno+="$(fun_trans "Duracion Nula")" && bot_retorno+="$LINE\n"
+         [[ $1 = 8 ]] && bot_retorno+="$(fun_trans "Duracion invalida utilize numeros")" && bot_retorno+="$LINE\n"
+         [[ $1 = 9 ]] && bot_retorno+="$(fun_trans "Duracion maxima de un año")" && bot_retorno+="$LINE\n"
+         ;;
+         1[1-3])
+         [[ $1 = 11 ]] && bot_retorno+="$(fun_trans "Limite Nulo")" && bot_retorno+="$LINE\n"
+         [[ $1 = 12 ]] && bot_retorno+="$(fun_trans "Limite invalido utilize numeros")" && bot_retorno+="$LINE\n"
+         [[ $1 = 13 ]] && bot_retorno+="$(fun_trans "Limite maximo de 999")" && bot_retorno+="$LINE\n"
+         ;;
+         esac
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+}
+     usuarios_ativos=($(mostrar_usuarios))
+     [[ -z "$1" ]] && error_fun && return 0
+     [[ -z "$2" ]] && error_fun && return 0
+     [[ -z "$3" ]] && error_fun && return 0
+     [[ -z "$4" ]] && error_fun && return 0
+     if [[ -z $1 ]]; then
+     error_fun 1 && return 0
+     elif [[ "${#1}" -lt "4" ]]; then
+     error_fun 2 && return 0
+     elif [[ "${#1}" -gt "24" ]]; then
+     error_fun 3 && return 0
+     elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$1")" ]]; then
+     error_fun 14 && return 0
+     fi    
+     if [[ -z $2 ]]; then
+     error_fun 4 && return 0
+     elif [[ "${#2}" -lt "6" ]]; then
+     error_fun 5 && return 0
+     elif [[ "${#2}" -gt "20" ]]; then
+     error_fun 6 && return 0
+     fi
+     if [[ -z "$3" ]]; then
+     error_fun 7 && return 0
+     elif [[ "$3" != +([0-9]) ]]; then
+     error_fun 8 && return 0
+     elif [[ "$3" -gt "360" ]]; then
+     error_fun 9 && return 0
+     fi
+     if [[ -z "$4" ]]; then
+     error_fun 11 && return 0
+     elif [[ "$4" != +([0-9]) ]]; then
+     error_fun 12 && return 0
+     elif [[ "$4" -gt "999" ]]; then
+     error_fun 13 && return 0
+     fi
+     add_user "$1" "$2" "$3" "$4"
+     if [[ "$?" = "1" ]]; then
+     local bot_retorno="$LINE\n"
+              bot_retorno+="$(fun_trans "Usuario No Fue Creado")\n"
+              bot_retorno+="$LINE\n"
+              ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+      return 0
+      else
+      local bot_retorno="$LINE\n"
+               bot_retorno+="$(fun_trans "USUARIO CREADO")\n"
+               bot_retorno+="$(fun_trans "Usuario"): $1\n"
+               bot_retorno+="$(fun_trans "Contraseña"): $2\n"
+               bot_retorno+="$(fun_trans "Duracion"): $3\n"
+               bot_retorno+="$(fun_trans "Limite"): $4\n"
+               bot_retorno+="$LINE\n"
+               ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+        return 0
+        fi
+}
+userdell_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "MODO DE USO")\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="userdell $(fun_trans "Usuario")\n"
+         bot_retorno+="$(fun_trans "Ejemplo"):\n"
+         bot_retorno+='userdell admin\n'
+         bot_retorno+="$LINE\n"
+	     ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+[[ -z "$1" ]] && error_fun && return 0
+rm_user "$1" && {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Removido Con Exito")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+} || {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Usuario No Removido")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+ }
+}
+paygen_fun () {
+gerar_pays () {
+echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
+GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $HOME/$1
+}
+fail_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "MODO DE USO"):\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="/gerar $(fun_trans "Host") $(fun_trans "Solicitud") $(fun_trans "Conexion")\n"
+          bot_retorno+="$(fun_trans "Ejemplo"):\n"
+          bot_retorno+="/gerar www.host.com (1 a 9) (1 a 3)\n"
+          bot_retorno+="/gerar www.host.com 2 1\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Metodos Solicitud")\n${LINE}\n1-GET, 2-CONNECT, 3-PUT, 4-OPTIONS, 5-DELETE, 6-HEAD, 7-TRACE, 8-PROPATCH, 9-PATCH\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Metodos Conexion")\n${LINE}\n1-REALDATA, 2-NETDATA, 3-RAW\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+		  unset bot_retorno
+return 0
+}
+valor1="$1" #Entrada Host 
+valor2="127.0.0.1" #Entrada IP
+valor3="$2" #Metodo Requisicao
+valor4="$3" #Metodo Conexao
+[[ "$1" = "" ]] && fail_fun && return 0
+[[ "$2" = "" ]] && fail_fun && return 0
+[[ "$3" = "" ]] && fail_fun && return 0
+case $valor3 in
+    1)req="GET";;
+    2)req="CONNECT";;
+    3)req="PUT";;
+    4)req="OPTIONS";;
+    5)req="DELETE";;
+    6)req="HEAD";;
+    7)req="PATCH";;
+    8)req="POST";;
+    *)req="GET";;
+esac
+case $valor4 in
+     1)in="realData";;
+     2)in="netData";;
+     3)in="raw";;
+     *)in="netData";;
+esac
+gerar_pays Payloads.txt
+sed -i "s;realData;abc;g" $HOME/Payloads.txt
+sed -i "s;netData;abc;g" $HOME/Payloads.txt
+sed -i "s;raw;abc;g" $HOME/Payloads.txt
+sed -i "s;abc;$in;g" $HOME/Payloads.txt
+sed -i "s;GET;$req;g" $HOME/Payloads.txt
+sed -i "s;get;$req;g" $HOME/Payloads.txt
+sed -i "s;mhost;$valor1;g" $HOME/Payloads.txt
+sed -i "s;mip;$valor2;g" $HOME/Payloads.txt
+if [[ -e $HOME/Payloads.txt ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "PAYLOADS GERADAS CON EXITO")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+local bot_retorno2
+          ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+                             --document @$HOME/Payloads.txt
+return 0                           
+else
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "PAYLOADS NO GERADAS")\n"
+          bot_retorno+="$(fun_trans "Algun  Error")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+fi
+}
+scan_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Modo de uso"):\n"
+          bot_retorno+="/scan $(fun_trans "dominio")\n"
+          bot_retorno+="$(fun_trans "Ejemplo"): /scan www.host.com\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+[[ -z $1 ]] && error_fun && return 0
+local HOST=$1
+local RETURN=$(curl -sSL "$HOST"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|uniq)
+if [[ -z $RETURN ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Ningun Host Encontrado en Dominio"): ${1}\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+else
+i=1
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "SUBDOMINIOS ENCONTRADOS")\n$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+unset bot_retorno
+while read hostreturn; do
+local bot_retorno+="$hostreturn\n"
+      if [[ $i -gt 20 ]]; then
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	  unset bot_retorno
+	  unset i
+	  fi
+let i++
+done <<< "$RETURN"
+[[ ! -z $bot_retorno ]] && {
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	}
+fi
+}
+
+openadd_fun () {
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] || return 0
+[[ -e /etc/openvpn/openvpn-status.log ]] || return 0
+newclient "$nomeuser" "$senhauser"
+[[ -z $1 ]] && client="adm" || client="$1"
+cp /etc/openvpn/client-common.txt $HOME/$client.ovpn
+echo "<key>
+$(cat /etc/openvpn/client-key.pem)
+</key>
+<cert>
+$(cat /etc/openvpn/client-cert.pem)
+</cert>
+<ca>
+$(cat /etc/openvpn/ca.pem)
+</ca>" >> $HOME/$client.ovpn
+[[ ! -z $1 ]] && [[ ! -z $2 ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$1\n$2\n</auth-user-pass>;g" $HOME/$client.ovpn
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Para Generar Archivos Con Autenticación Automatica Utilice"):\n/openadd usuario senha\n$LINE\n"
+          bot_retorno+="$(fun_trans "ARCHIVO OPENVPN GENERADO CON EXITO")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+local bot_retorno2
+          ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+                             --document @$HOME/$client.ovpn
+rm $HOME/$client.ovpn
+return 0
+}
+cript_fun () {
+if [[ -z $2 ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Modo de uso"):\n"
+          bot_retorno+="/criptar texto_for_cript\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+else
+local array=($@)
+for((i=1; i<=${#array[@]}; i++)); do
+unset txtofus
+local number=$(expr length "${array[$i]}")
+         for((e=1; e<$number+1; e++)); do
+         local txt[$e]=$(echo "${array[$i]}" | cut -b $e)
+                   case ${txt[$e]} in
+                   ".")txt[$e]="#";;
+                   "#")txt[$e]=".";;
+                   "1")txt[$e]="%";;
+                   "%")txt[$e]="1";;
+                   "2")txt[$e]="?";;
+                   "?")txt[$e]="2";;
+                   "3")txt[$e]="&";;
+                   "&")txt[$e]="3";;
+                   "/")txt[$e]="!";;
+                   "!")txt[$e]="/";;
+                   "a")txt[$e]="k";;
+                   "k")txt[$e]="a";;
+                   "s")txt[$e]="w";;
+                   "w")txt[$e]="s";;
+                   "h")txt[$e]="y";;
+                   "y")txt[$e]="h";;
+                   "o")txt[$e]="P";;
+                   "P")txt[$e]="o";;
+                   "v")txt[$e]="T";;
+                   "T")txt[$e]="v";;
+                   "f")txt[$e]="Z";;
+                   "Z")txt[$e]="f";;
+                   esac
+          txtofus+="${txt[$e]}"
+          done
+[[ -z $returntxt ]] && returntxt="$(echo $txtofus | rev)" || returntxt="$returntxt $(echo $txtofus | rev)"
+done
+unset txtofus
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "SU TEXTO ENCRIPTADO O DESCRIPTADO"):\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+local bot_retorno="$returntxt\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+fi
+}
+language_fun () {
+if [[ -z $2 || -z $3 ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Modo de uso"):\n"
+          bot_retorno+="/lang (pt, fr, es, en...) (text)\n"
+          bot_retorno+="/lang es Hello\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+else
+local array=($@)
+local RETORNO
+for((i=2; i<=${#array[@]}; i++)); do
+local RET=$(source trans -b :$2 "${array[$i]}")
+[[ -z $RETORNO ]] && RETORNO=$RET || RETORNO="$RETORNO $RET"
+done
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Su Traducion"):\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+          bot_retorno="$(echo $RETORNO|sed -e 's/[^a-z0-9 -]//ig')\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+fi
+}
+teste_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "USUARIO"): ${chatuser}\n"
+          bot_retorno+="$(fun_trans "ARGUMENTOS"): ${comando[@]}\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+#local bot_retorno="$LINE\n"
+#          bot_retorno+="$(fun_trans "ESSE USUARIO"): ${chatuser}\n"
+#          bot_retorno+="$(fun_trans "ESSES ARGUMENTOS"): ${comando[@]}\n"
+#          bot_retorno+="$LINE\n"
+#          ShellBot.editMessageText --chat_id ${message_chat_id[$id]} --message_id ${reply_to_message_message_id[$id]} --text "$(echo -e $bot_retorno)" --parse_mode markdown
+#return 0
+}
+
+# LOOP ESCUTANDO O TELEGRAN
+while true; do
+    ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
+    for id in $(ShellBot.ListUpdates); do
+	    chatuser="$(echo ${message_chat_id[$id]}|cut -d'-' -f2)"
+	    echo $chatuser >&2
+	    comando=(${message_text[$id]})
+	    case ${comando[0]} in
+	      /[Tt]este|[Tt]este)teste_fun &;;
+		  /[Aa]juda|[Aa]juda|[Hh]elp|/[Hh]elp)ajuda_fun &;;
+		  /[Ss]tart|[Ss]tart|[Cc]omecar|/[Cc]omecar)ajuda_fun &;;
+		  /[Ll]ogar|[Ll]ogar|[Ll]oguin|/[Ll]oguin)ativarid_fun "${comando[1]}" "${comando[2]}" "$chatuser";;
+		  *)if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS}|grep -w "${chatuser}") ]]; then
+             case ${comando[0]} in
+             [Oo]nline|/[Oo]nline|[Oo]nlines|/[Oo]nlines)online_fun &;;
+             [Cc]riptar|/[Cc]riptar|[Cc]ript|/[Cc]ript)cript_fun "${comando[@]}" &;;
+             [Uu]seradd|/[Uu]seradd|[Aa]dd|/[Aa]dd)useradd_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" "${comando[4]}" &;;
+             [Uu]serdell|/[Uu]serdell|[Dd]ell|/[Dd]ell)userdell_fun "${comando[1]}" &;;
+             [Ii]nfo|/[Ii]nfo)info_fun &;;
+             [Ii]nfovps|/[Ii]nfovps)infovps &;;
+             [Ll]ang|/[Ll]ang)language_fun "${comando[@]}" &;;
+             [Oo]penadd|/[Oo]penadd|[Oo]pen|/[Oo]pen)openadd_fun "${comando[1]}" "${comando[2]}" &;;
+             [Gg]erar|/[Gg]erar|[Pp]ay|/[Pp]ay)paygen_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" &;;
+             [Uu]suarios|/[Uu]suarios|[Uu]ser|/[Uu]ser)loguin_fun &;;
+             [Ss]can|/[Ss]can)scan_fun "${comando[1]}" &;;
+             *)ajuda_fun;;
+             esac
+             else
+             [[ ! -z "${comando[0]}" ]] && blockfun &
+             fi;;
+           esac
+    done
+done

+ 104 - 0
R9/online/apacheon.sh

@@ -0,0 +1,104 @@
+#!/bin/bash
+
+online(){
+    i="1"
+    [[ -z $(ls $HOME) ]] && msg -bar || {
+        for my_arqs in `ls $HOME`; do
+            [[ -d "$my_arqs" ]] && continue
+            select_arc[$i]="$my_arqs"
+            echo -e " $(msg -verd "[$i]") $(msg -verm2 ">") $(msg -ama "$my_arqs")"
+            let i++
+        done
+        i=$(($i - 1))
+        msg -bar
+        while [[ -z ${select_arc[$slct]} ]]; do
+            msg -nama "$(fun_trans "Seleccione un archivo") [1-$i]: "
+            read slct
+            tput cuu1 && tput dl1
+        done
+        arquivo_move="${select_arc[$slct]}"
+        [ ! -d /var ] && mkdir /var
+        [ ! -d /var/www ] && mkdir /var/www
+        [ ! -d /var/www/html ] && mkdir /var/www/html
+        [ ! -e /var/www/html/index.html ] && touch /var/www/html/index.html
+        [ ! -e /var/www/index.html ] && touch /var/www/index.html
+        chmod -R 755 /var/www
+        cp $HOME/$arquivo_move /var/www/$arquivo_move
+        cp $HOME/$arquivo_move /var/www/html/$arquivo_move
+        clear
+        msg -bar
+        print_center -verd "ARCHIVO EN LINEA"
+        msg -bar
+        print_center -teal "http://$IP:81/$arquivo_move"
+        msg -bar
+        enter
+    }
+}
+
+rm_online(){
+    i=1
+    [[ -z $(ls /var/www/html) ]] && msg -bar || {
+        for my_arqs in `ls /var/www/html`; do
+            [[ "$my_arqs" = "index.html" ]] && continue
+            [[ "$my_arqs" = "index.php" ]] && continue
+            [[ -d "$my_arqs" ]] && continue
+            select_arc[$i]="$my_arqs"
+            echo -e "$(msg -verd "[$i]") $(msg -verm2 ">") $(msg -teal "http://$IP:81/$my_arqs")"
+            let i++
+        done
+        msg -bar
+        while [[ -z ${select_arc[$slct]} ]]; do
+            msg -nama "$(fun_trans "Seleccione el archivo que desea borrar") [1-$i]: "
+            read slct
+            tput cuu1 && tput dl1
+        done
+        arquivo_move="${select_arc[$slct]}"
+        [[ -d /var/www/html ]] && [[ -e /var/www/html/$arquivo_move ]] && rm -rf /var/www/html/$arquivo_move > /dev/null 2>&1
+        [[ -e /var/www/$arquivo_move ]] && rm -rf /var/www/$arquivo_move > /dev/null 2>&1
+        clear
+        msg -bar
+        print_center -verd "ARCHIVO REMOVIDO"
+        msg -bar
+        print_center -teal "http://$IP:81/$arquivo_move"
+        msg -bar
+        enter
+    }
+}
+
+Links(){
+    [[ -z $(ls /var/www/html) ]] && print_center -ama "SIN ARCHIVOS EN LINEA" || {
+        for my_arqs in `ls /var/www/html`; do
+            [[ "$my_arqs" = "index.html" ]] && continue
+            [[ "$my_arqs" = "index.php" ]] && continue
+            [[ -d "$my_arqs" ]] && continue
+            echo -e " $(msg -verd "[$my_arqs]") $(msg -teal "http://$IP:81/$my_arqs")"
+        done
+        enter
+    }
+}
+
+start(){
+    IP="$(fun_ip)"
+    clear
+    msg -bar
+    print_center -ama "Gestor de Archivos FTP"
+    msg -bar
+    menu_func "Colocar Archivo Online" "Remover Archivo Online" "Ver Links de Archivos Online"
+    back
+    opcion=$(selection_fun 3)
+
+    case $opcion in
+        1)online;;
+        2)rm_online;;
+        3)Links;;
+        0)return 1;;
+    esac
+}
+
+[[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || {
+ apt-get install apache2 -y &>/dev/null
+ sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
+ service apache2 restart > /dev/null 2>&1 &
+ }
+
+start

+ 531 - 0
R9/online/blockBT.sh

@@ -0,0 +1,531 @@
+#!/bin/bash
+#19/12/19
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+
+sh_ver="1.0.11"
+Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
+Error="${Red_font_prefix}[Error]${Font_color_suffix}"
+
+smtp_port="25,26,465,587"
+pop3_port="109,110,995"
+imap_port="143,218,220,993"
+other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
+bt_key_word="torrent
+.torrent
+peer_id=
+announce
+info_hash
+get_peers
+find_node
+BitTorrent
+announce_peer
+BitTorrent protocol
+announce.php?passkey=
+magnet:
+xunlei
+sandai
+Thunder
+XLLiveUD"
+
+check_sys(){
+	if [[ -f /etc/redhat-release ]]; then
+		release="centos"
+	elif cat /etc/issue | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	elif cat /proc/version | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+    fi
+	bit=`uname -m`
+}
+check_BT(){
+	Cat_KEY_WORDS
+	BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
+}
+check_SPAM(){
+	Cat_PORT
+	SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
+}
+Cat_PORT(){
+	Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
+}
+Cat_KEY_WORDS(){
+	Ban_KEY_WORDS_list=""
+	Ban_KEY_WORDS_v6_list=""
+	if [[ ! -z ${v6iptables} ]]; then
+		Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+		Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+	fi
+	Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+	Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+}
+View_PORT(){
+	Cat_PORT
+	echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
+	echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
+}
+View_KEY_WORDS(){
+	Cat_KEY_WORDS
+	echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
+	echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
+}
+View_ALL(){
+	echo
+	View_PORT
+	View_KEY_WORDS
+	echo
+	msg -bar2
+}
+Save_iptables_v4_v6(){
+	if [[ ${release} == "centos" ]]; then
+		if [[ ! -z "$v6iptables" ]]; then
+			service ip6tables save
+			chkconfig --level 2345 ip6tables on
+		fi
+		service iptables save
+		chkconfig --level 2345 iptables on
+	else
+		if [[ ! -z "$v6iptables" ]]; then
+			ip6tables-save > /etc/ip6tables.up.rules
+			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules" > /etc/network/if-pre-up.d/iptables
+		else
+			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
+		fi
+		iptables-save > /etc/iptables.up.rules
+		chmod +x /etc/network/if-pre-up.d/iptables
+	fi
+}
+Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
+Set_tcp_port() {
+	[[ "$1" = "$v4iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with icmp-port-unreachable
+	[[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
+}
+Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
+Set_SPAM_Code_v4(){
+	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+		do
+		Set_tcp_port $v4iptables "$i" $s
+		Set_udp_port $v4iptables "$i" $s
+	done
+}
+Set_SPAM_Code_v4_v6(){
+	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+	do
+		for j in $v4iptables $v6iptables
+		do
+			Set_tcp_port $j "$i" $s
+			Set_udp_port $j "$i" $s
+		done
+	done
+}
+Set_PORT(){
+	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+		Set_tcp_port $v4iptables $PORT $s
+		Set_udp_port $v4iptables $PORT $s
+		Set_tcp_port $v6iptables $PORT $s
+		Set_udp_port $v6iptables $PORT $s
+	elif [[ -n "$v4iptables" ]]; then
+		Set_tcp_port $v4iptables $PORT $s
+		Set_udp_port $v4iptables $PORT $s
+	fi
+	Save_iptables_v4_v6
+}
+Set_KEY_WORDS(){
+	key_word_num=$(echo -e "${key_word}"|wc -l)
+	for((integer = 1; integer <= ${key_word_num}; integer++))
+		do
+			i=$(echo -e "${key_word}"|sed -n "${integer}p")
+			Set_key_word $v4iptables "$i" $s
+			[[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
+	done
+	Save_iptables_v4_v6
+}
+Set_BT(){
+	key_word=${bt_key_word}
+	Set_KEY_WORDS
+	Save_iptables_v4_v6
+}
+Set_SPAM(){
+	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+		Set_SPAM_Code_v4_v6
+	elif [[ -n "$v4iptables" ]]; then
+		Set_SPAM_Code_v4
+	fi
+	Save_iptables_v4_v6
+}
+Set_ALL(){
+	Set_BT
+	Set_SPAM
+}
+Ban_BT(){
+	check_BT
+	[[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
+	s="A"
+	Set_BT
+	View_ALL
+	echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+	msg -bar2
+}
+Ban_SPAM(){
+	check_SPAM
+	[[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
+	s="A"
+	Set_SPAM
+	View_ALL
+	echo -e "${Info} Puertos SPAM Bloqueados !"
+	msg -bar2
+}
+Ban_ALL(){
+	check_BT
+	check_SPAM
+	s="A"
+	if [[ -z ${BT_KEY_WORDS} ]]; then
+		if [[ -z ${SPAM_PORT} ]]; then
+			Set_ALL
+			View_ALL
+			echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
+			msg -bar2
+		else
+			Set_BT
+			View_ALL
+			echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+		fi
+	else
+		if [[ -z ${SPAM_PORT} ]]; then
+			Set_SPAM
+			View_ALL
+			echo -e "${Info} Puerto SPAM (spam) prohibido !"
+		else
+			echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
+		fi
+	fi
+}
+UnBan_BT(){
+	check_BT
+	[[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
+	s="D"
+	Set_BT
+	View_ALL
+	echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
+	msg -bar2
+}
+UnBan_SPAM(){
+	check_SPAM
+	[[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
+	s="D"
+	Set_SPAM
+	View_ALL
+	echo -e "${Info} Puertos de SPAM Desbloqueados !"
+	msg -bar2
+}
+UnBan_ALL(){
+	check_BT
+	check_SPAM
+	s="D"
+	if [[ ! -z ${BT_KEY_WORDS} ]]; then
+		if [[ ! -z ${SPAM_PORT} ]]; then
+			Set_ALL
+			View_ALL
+			echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
+			msg -bar2
+		else
+			Set_BT
+			View_ALL
+			echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
+			msg -bar2
+		fi
+	else
+		if [[ ! -z ${SPAM_PORT} ]]; then
+			Set_SPAM
+			View_ALL
+			echo -e "${Info} Puertos SPAM Desbloqueados !"
+			msg -bar2
+		else
+			echo -e "${Error} No se  detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
+		fi
+	fi
+}
+ENTER_Ban_KEY_WORDS_type(){
+	Type=$1
+	Type_1=$2
+	if [[ $Type_1 != "ban_1" ]]; then
+		echo -e "Por favor seleccione un tipo de entrada:
+		
+ 1. Entrada manual (solo se admiten palabras clave únicas)
+ 
+ 2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
+ 
+ 3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
+		read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
+	fi
+	[[ -z "${key_word_type}" ]] && key_word_type="1"
+	if [[ ${key_word_type} == "1" ]]; then
+		if [[ $Type == "ban" ]]; then
+			ENTER_Ban_KEY_WORDS
+		else
+			ENTER_UnBan_KEY_WORDS
+		fi
+	elif [[ ${key_word_type} == "2" ]]; then
+		ENTER_Ban_KEY_WORDS_file
+	elif [[ ${key_word_type} == "3" ]]; then
+		ENTER_Ban_KEY_WORDS_url
+	else
+		if [[ $Type == "ban" ]]; then
+			ENTER_Ban_KEY_WORDS
+		else
+			ENTER_UnBan_KEY_WORDS
+		fi
+	fi
+}
+ENTER_Ban_PORT(){
+	echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
+	if [[ ${Ban_PORT_Type_1} != "1" ]]; then
+	echo -e "
+	${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+	
+ -Puerto único: 25 (puerto único)
+ 
+ -Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
+
+ -Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
+	fi
+	read -e -p "(Intro se cancela por defecto):" PORT
+	[[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
+}
+ENTER_Ban_KEY_WORDS(){
+    msg -bar2
+	echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
+	if [[ ${Type_1} != "ban_1" ]]; then
+	echo ""
+	echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+	
+ -Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
+ 
+ -Palabras clave: youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de nombre de pan-dominio) que contenga la palabra clave youtube.com.
+
+ -Palabras clave: www.youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de subdominio) que contenga la palabra clave www.youtube.com.
+
+ -Autoevaluación de más efectos (como la palabra clave .zip se puede usar para deshabilitar la descarga de cualquier archivo de sufijo .zip)." && echo
+	fi
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+ENTER_Ban_KEY_WORDS_file(){
+	echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
+	read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
+	[[ -z "${key_word}" ]] && key_word="key_word.txt"
+	if [[ -e "${key_word}" ]]; then
+		key_word=$(cat "${key_word}")
+		[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
+	else
+		echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
+	fi
+}
+ENTER_Ban_KEY_WORDS_url(){
+	echo -e "Ingrese la dirección del archivo de red de palabras clave que se prohibirá / desbloqueará (por ejemplo, http: //xxx.xx/key_word.txt)" && echo
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+	key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
+	[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo de red está vacío o se agotó el tiempo de acceso !" && View_ALL && exit 0
+}
+ENTER_UnBan_KEY_WORDS(){
+	View_KEY_WORDS
+	echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+ENTER_UnBan_PORT(){
+	echo -e "Ingrese el puerto que desea desempaquetar:\n(ingrese el puerto completo y preciso de acuerdo con la lista anterior, incluyendo comas, dos puntos)" && echo
+	read -e -p "(Intro se cancela por defecto):" PORT
+	[[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+Ban_PORT(){
+	s="A"
+	ENTER_Ban_PORT
+	Set_PORT
+	echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+	Ban_PORT_Type_1="1"
+	while true
+	do
+		ENTER_Ban_PORT
+		Set_PORT
+		echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+	done
+	View_ALL
+}
+Ban_KEY_WORDS(){
+	s="A"
+	ENTER_Ban_KEY_WORDS_type "ban"
+	Set_KEY_WORDS
+	echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+	while true
+	do
+		ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
+		Set_KEY_WORDS
+		echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+	done
+	View_ALL
+}
+UnBan_PORT(){
+	s="D"
+	View_PORT
+	[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
+	ENTER_UnBan_PORT
+	Set_PORT
+	echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+	while true
+	do
+		View_PORT
+		[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
+		ENTER_UnBan_PORT
+		Set_PORT
+		echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+	done
+	View_ALL
+}
+UnBan_KEY_WORDS(){
+	s="D"
+	Cat_KEY_WORDS
+	[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
+	ENTER_Ban_KEY_WORDS_type "unban"
+	Set_KEY_WORDS
+	echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+	while true
+	do
+		Cat_KEY_WORDS
+		[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
+		ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
+		Set_KEY_WORDS
+		echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+	done
+	View_ALL
+}
+UnBan_KEY_WORDS_ALL(){
+	Cat_KEY_WORDS
+	[[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
+	if [[ ! -z "${v6iptables}" ]]; then
+		Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
+		for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
+			do
+				${v6iptables} -t mangle -D OUTPUT 1
+		done
+	fi
+	Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
+	for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
+		do
+			${v4iptables} -t mangle -D OUTPUT 1
+	done
+	Save_iptables_v4_v6
+	View_ALL
+	echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
+}
+check_iptables(){
+	v4iptables=`iptables -V`
+	v6iptables=`ip6tables -V`
+	if [[ ! -z ${v4iptables} ]]; then
+		v4iptables="iptables"
+		if [[ ! -z ${v6iptables} ]]; then
+			v6iptables="ip6tables"
+		fi
+	else
+		echo -e "${Error} El firewall de iptables no está instalado !
+Por favor, instale el firewall de iptables:
+CentOS Sistema: yum install iptables -y
+Debian / Ubuntu Sistema: apt-get install iptables -y"
+	fi
+}
+Update_Shell(){
+	sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://raw.githubusercontent.com/VPS-MX/VPS-MX-8.0/master/SCRIPT/blockBT.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
+	[[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
+	wget https://raw.githubusercontent.com/VPS-MX/VPS-MX-8.0/master/SCRIPT/blockBT.sh -O /etc/ger-frm/blockBT.sh &> /dev/null
+	chmod +x /etc/ger-frm/blockBT.sh
+	echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
+	msg -bar2 
+	exit 0
+}
+check_sys
+check_iptables
+action=$1
+if [[ ! -z $action ]]; then
+	[[ $action = "banbt" ]] && Ban_BT && exit 0
+	[[ $action = "banspam" ]] && Ban_SPAM && exit 0
+	[[ $action = "banall" ]] && Ban_ALL && exit 0
+	[[ $action = "unbanbt" ]] && UnBan_BT && exit 0
+	[[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
+	[[ $action = "unbanall" ]] && UnBan_ALL && exit 0
+fi
+echo -e "  Panel de Firewall VPS•MX By @Kalix1 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
+msg -bar2
+echo -e "  ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
+————————————
+  ${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
+  ${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM 
+  ${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
+  ${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
+  ${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
+————————————
+  ${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
+  ${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
+  ${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
+  ${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
+ ${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
+ ${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
+————————————
+ ${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
+read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
+case "$num" in
+	0)
+	View_ALL
+	;;
+	1)
+	Ban_BT
+	;;
+	2)
+	Ban_SPAM
+	;;
+	3)
+	Ban_ALL
+	;;
+	4)
+	Ban_PORT
+	;;
+	5)
+	Ban_KEY_WORDS
+	;;
+	6)
+	UnBan_BT
+	;;
+	7)
+	UnBan_SPAM
+	;;
+	8)
+	UnBan_ALL
+	;;
+	9)
+	UnBan_PORT
+	;;
+	10)
+	UnBan_KEY_WORDS
+	;;
+	11)
+	UnBan_KEY_WORDS_ALL
+	;;
+	12)
+	Update_Shell
+	;;
+	*)
+	echo "Por favor ingrese el número correcto [0-12]"
+	;;
+esac

+ 33 - 0
R9/online/dns-netflix.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+dnsnetflix () {
+echo "nameserver $dnsp" > /etc/resolv.conf
+#echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+/etc/init.d/ssrmu stop &>/dev/null
+/etc/init.d/ssrmu start &>/dev/null
+/etc/init.d/shadowsocks-r stop &>/dev/null
+/etc/init.d/shadowsocks-r start &>/dev/null
+msg -bar2
+echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
+} 
+clear
+msg -bar2
+echo -e "\033[1;93m     AGREGARDOR DE DNS PERSONALES By @USA1_BOT "
+msg -bar2
+echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
+msg -bar2
+echo -e "\033[1;91m ¡ Solo seran utiles si registraste tu IP en el BOT !"
+echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
+echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
+echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
+msg -bar2
+echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
+echo ""
+echo -e "\033[1;97m Ingrese su DNS a usar: \033[0;91m"; read -p "   "  dnsp
+echo ""
+msg -bar2
+read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix   
+[[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
+msg -bar2

+ 416 - 0
R9/online/fai2ban.sh

@@ -0,0 +1,416 @@
+#!/bin/bash
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+pid_fail=$(dpkg -l | grep fail2ban | grep ii)
+apache=$(dpkg -l | grep apache2 | grep ii)
+squid=$(dpkg -l | grep squid | grep ii)
+dropbear=$(dpkg -l | grep dropbear | grep ii)
+openssh=$(dpkg -l | grep openssh | grep ii)
+[[ "$openssh" != "" ]] && s1="ssh"
+[[ "$squid" != "" ]] && s2="squid"
+[[ "$dropbear" != "" ]] && s3="dropbear"
+[[ "$apache" != "" ]] && s4="apache"
+echo -e "${cor[5]} $(fun_trans "Este es Fail2ban Protection")"
+echo -e "${cor[5]} $(fun_trans "Excelente para proteger contra ataques de DDOS")"
+msg -bar
+if [[ ! -z "$pid_fail" ]]; then
+ echo -e "${cor[2]} [1] >${cor[5]} $(fun_trans "Desinstalar Fail2ban")"
+ echo -e "${cor[2]} [2] >${cor[5]} $(fun_trans "Mirar el registro")"
+ msg -bar
+  while [[ -z ${logxyz} || ${logxyz} != @(1|2) ]]; do
+   echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read logxyz
+   tput cuu1 && tput dl1
+  done
+ case ${logxyz} in
+  1)apt-get remove fail2ban -y &> /dev/null;;
+  2)cat /var/log/fail2ban.log;;
+ esac
+exit 0
+fi
+echo -e "${cor[5]} $(fun_trans "Desea Instalar  Fail2ban?")"
+msg -bar
+  while [[ -z ${fail2ban} || ${fail2ban} != @(s|S|n|N|y|Y) ]]; do
+   echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion") [S/N]: " && read fail2ban
+   tput cuu1 && tput dl1
+  done
+if [[ "$fail2ban" = @(s|S|y|Y) ]]; then
+apt-get install fail2ban -y &> /dev/null
+wget -O $HOME/fail2ban https://raw.githubusercontent.com/rudi9999/VPS-MX-8.0/master/ArchivosUtilitarios/fail2ban-0.9.4.tar.gz &> /dev/null
+tar -xf $HOME/fail2ban &> /dev/null
+cd $HOME/fail2ban-0.9.4 &> /dev/null
+python ./setup.py install &> /dev/null
+echo '[INCLUDES]
+before = paths-debian.conf
+[DEFAULT]
+ignoreip = 127.0.0.1/8
+# ignorecommand = /path/to/command <ip>
+ignorecommand =
+bantime  = 1036800
+findtime  = 3600
+maxretry = 5
+backend = auto
+usedns = warn
+logencoding = auto
+enabled = false
+filter = %(__name__)s
+destemail = root@localhost
+sender = root@localhost
+mta = sendmail
+protocol = tcp
+chain = INPUT
+port = 0:65535
+fail2ban_agent = Fail2Ban/%(fail2ban_version)s
+banaction = iptables-multiport
+banaction_allports = iptables-allports
+action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+            %(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
+action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+             %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+             xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
+action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
+                %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+action_blocklist_de  = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
+action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
+action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
+action = %(action_)s' > /etc/fail2ban/jail.local
+echo -e "${cor[5]} $(fun_trans "Fail2ban sera activo en los Siguientes Puertos y Servicos"):"
+msg -bar
+[ "$s1" != "" ] && echo -ne " $s1"
+[ "$s2" != "" ] && echo -ne " $s2"
+[ "$s3" != "" ] && echo -ne " $s3"
+[ "$s4" != "" ] && echo -ne " $s4"
+echo -e "\n"
+msg -bar
+sleep 1
+if [[ "$s1" != "" ]]; then
+echo '[sshd]
+enabled = true
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s
+[sshd-ddos]
+enabled = true
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+else
+echo '[sshd]
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s
+[sshd-ddos]
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s2" != "" ]]; then
+echo '[squid]
+enabled = true
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+else
+echo '[squid]
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s3" != "" ]]; then
+echo '[dropbear]
+enabled = true
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+else
+echo '[dropbear]
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s4" != "" ]]; then
+echo '[apache-auth]
+enabled = true
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+else
+echo '[apache-auth]
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+fi
+echo '[selinux-ssh]
+port     = ssh
+logpath  = %(auditd_log)s
+[apache-badbots]
+port     = http,https
+logpath  = %(apache_access_log)s
+bantime  = 172800
+maxretry = 1
+[apache-noscript]
+port     = http,https
+logpath  = %(apache_error_log)s
+[apache-overflows]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-nohome]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-botsearch]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-fakegooglebot]
+port     = http,https
+logpath  = %(apache_access_log)s
+maxretry = 1
+ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip>
+[apache-modsecurity]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-shellshock]
+port    = http,https
+logpath = %(apache_error_log)s
+maxretry = 1
+[openhab-auth]
+filter = openhab
+action = iptables-allports[name=NoAuthFailures]
+logpath = /opt/openhab/logs/request.log
+[nginx-http-auth]
+port    = http,https
+logpath = %(nginx_error_log)s
+[nginx-limit-req]
+port    = http,https
+logpath = %(nginx_error_log)s
+[nginx-botsearch]
+port     = http,https
+logpath  = %(nginx_error_log)s
+maxretry = 2
+[php-url-fopen]
+port    = http,https
+logpath = %(nginx_access_log)s
+          %(apache_access_log)s
+[suhosin]
+port    = http,https
+logpath = %(suhosin_log)s
+[lighttpd-auth]
+port    = http,https
+logpath = %(lighttpd_error_log)s
+[roundcube-auth]
+port     = http,https
+logpath  = %(roundcube_errors_log)s
+[openwebmail]
+port     = http,https
+logpath  = /var/log/openwebmail.log
+[horde]
+port     = http,https
+logpath  = /var/log/horde/horde.log
+[groupoffice]
+port     = http,https
+logpath  = /home/groupoffice/log/info.log
+[sogo-auth]
+port     = http,https
+logpath  = /var/log/sogo/sogo.log
+[tine20]
+logpath  = /var/log/tine20/tine20.log
+port     = http,https
+[drupal-auth]
+port     = http,https
+logpath  = %(syslog_daemon)s
+backend  = %(syslog_backend)s
+[guacamole]
+port     = http,https
+logpath  = /var/log/tomcat*/catalina.out
+[monit]
+#Ban clients brute-forcing the monit gui login
+port = 2812
+logpath  = /var/log/monit
+[webmin-auth]
+port    = 10000
+logpath = %(syslog_authpriv)s
+backend = %(syslog_backend)s
+[froxlor-auth]
+port    = http,https
+logpath  = %(syslog_authpriv)s
+backend  = %(syslog_backend)s
+[3proxy]
+port    = 3128
+logpath = /var/log/3proxy.log
+[proftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(proftpd_log)s
+backend  = %(proftpd_backend)s
+[pure-ftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(pureftpd_log)s
+backend  = %(pureftpd_backend)s
+[gssftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(syslog_daemon)s
+backend  = %(syslog_backend)s
+[wuftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(wuftpd_log)s
+backend  = %(wuftpd_backend)s
+[vsftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(vsftpd_log)s
+[assp]
+port     = smtp,465,submission
+logpath  = /root/path/to/assp/logs/maillog.txt
+[courier-smtp]
+port     = smtp,465,submission
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[postfix]
+port     = smtp,465,submission
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+[postfix-rbl]
+port     = smtp,465,submission
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+maxretry = 1
+[sendmail-auth]
+port    = submission,465,smtp
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[sendmail-reject]
+port     = smtp,465,submission
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[qmail-rbl]
+filter  = qmail
+port    = smtp,465,submission
+logpath = /service/qmail/log/main/current
+[dovecot]
+port    = pop3,pop3s,imap,imaps,submission,465,sieve
+logpath = %(dovecot_log)s
+backend = %(dovecot_backend)s
+[sieve]
+port   = smtp,465,submission
+logpath = %(dovecot_log)s
+backend = %(dovecot_backend)s
+[solid-pop3d]
+port    = pop3,pop3s
+logpath = %(solidpop3d_log)s
+[exim]
+port   = smtp,465,submission
+logpath = %(exim_main_log)s
+[exim-spam]
+port   = smtp,465,submission
+logpath = %(exim_main_log)s
+[kerio]
+port    = imap,smtp,imaps,465
+logpath = /opt/kerio/mailserver/store/logs/security.log
+[courier-auth]
+port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[postfix-sasl]
+port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+[perdition]
+port   = imap3,imaps,pop3,pop3s
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[squirrelmail]
+port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
+logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
+[cyrus-imap]
+port   = imap3,imaps
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[uwimap-auth]
+port   = imap3,imaps
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[named-refused]
+port     = domain,953
+logpath  = /var/log/named/security.log
+[nsd]
+port     = 53
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+logpath = /var/log/nsd.log
+[asterisk]
+port     = 5060,5061
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+           %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+logpath  = /var/log/asterisk/messages
+maxretry = 10
+[freeswitch]
+port     = 5060,5061
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+           %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+logpath  = /var/log/freeswitch.log
+maxretry = 10
+[mysqld-auth]
+port     = 3306
+logpath  = %(mysql_log)s
+backend  = %(mysql_backend)s
+[recidive]
+logpath  = /var/log/fail2ban.log
+banaction = %(banaction_allports)s
+bantime  = 604800  ; 1 week
+findtime = 86400   ; 1 day
+[pam-generic]
+banaction = %(banaction_allports)s
+logpath  = %(syslog_authpriv)s
+backend  = %(syslog_backend)s
+[xinetd-fail]
+banaction = iptables-multiport-log
+logpath   = %(syslog_daemon)s
+backend   = %(syslog_backend)s
+maxretry  = 2
+[stunnel]
+logpath = /var/log/stunnel4/stunnel.log
+[ejabberd-auth]
+port    = 5222
+logpath = /var/log/ejabberd/ejabberd.log
+[counter-strike]
+logpath = /opt/cstrike/logs/L[0-9]*.log
+# Firewall: http://www.cstrike-planet.com/faq/6
+tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
+udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
+action  = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+[nagios]
+logpath  = %(syslog_daemon)s     ; nrpe.cfg may define a different log_facility
+backend  = %(syslog_backend)s
+maxretry = 1
+[directadmin]
+logpath = /var/log/directadmin/login.log
+port = 2222
+[portsentry]
+logpath  = /var/lib/portsentry/portsentry.history
+maxretry = 1
+[pass2allow-ftp]
+# this pass2allow example allows FTP traffic after successful HTTP authentication
+port         = ftp,ftp-data,ftps,ftps-data
+# knocking_url variable must be overridden to some secret value in filter.d/apache-pass.local
+filter       = apache-pass
+# access log of the website with HTTP auth
+logpath      = %(apache_access_log)s
+blocktype    = RETURN
+returntype   = DROP
+bantime      = 3600
+maxretry     = 1
+findtime     = 1
+[murmur]
+port     = 64738
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
+logpath  = /var/log/mumble-server/mumble-server.log
+[screensharingd]
+logpath  = /var/log/system.log
+logencoding = utf-8
+[haproxy-http-auth]
+logpath  = /var/log/haproxy.log' >> /etc/fail2ban/jail.local
+[[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
+[[ -d $HOME/fail2ban-0.9.4 ]] && rm -rf $HOME/fail2ban-0.9.4
+service fail2ban restart
+fi

+ 150 - 0
R9/online/gestor.sh

@@ -0,0 +1,150 @@
+#!/bin/bash
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/newadm" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+
+update_pak () {
+echo -ne " \033[1;31m[ ! ] apt-get update"
+apt-get update -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] apt-get upgrade"
+apt-get upgrade -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+msg -bar
+return
+}
+
+reiniciar_ser () {
+echo -ne " \033[1;31m[ ! ] Services stunnel4 restart"
+service stunnel4 restart > /dev/null 2>&1
+[[ -e /etc/init.d/stunnel4 ]] && /etc/init.d/stunnel4 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services squid restart"
+service squid restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services squid3 restart"
+service squid3 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services apache2 restart"
+service apache2 restart > /dev/null 2>&1
+[[ -e /etc/init.d/apache2 ]] && /etc/init.d/apache2 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services openvpn restart"
+service openvpn restart > /dev/null 2>&1
+[[ -e /etc/init.d/openvpn ]] && /etc/init.d/openvpn restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services dropbear restart"
+service dropbear restart > /dev/null 2>&1
+[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services ssh restart"
+service ssh restart > /dev/null 2>&1
+[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Services fail2ban restart"
+( 
+[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart
+fail2ban-client -x stop && fail2ban-client -x start
+) > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+msg -bar
+return
+}
+
+host_name () {
+unset name
+while [[ ${name} = "" ]]; do
+echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
+tput cuu1 && tput dl1
+done
+hostnamectl set-hostname $name 
+if [ $(hostnamectl status | head -1  | awk '{print $3}') = "${name}" ]; then 
+echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
+else
+echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
+fi
+msg -bar
+return
+}
+
+pamcrack () {
+echo -e "${cor[3]} $(fun_trans "Liberar passwd para VURTL")"
+msg -bar
+echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -bar && return
+echo -e ""
+fun_bar "service ssh restart"
+sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password
+fun_bar "service ssh restart"
+echo -e ""
+echo -e " \033[1;31m[ ! ]\033[1;33m $(fun_trans "Configuraciones VURTL aplicadas")"
+msg -bar
+return
+}
+
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " FECHA LOCAL MX APLICADA!"
+}
+
+timearg () {
+rm -rf /etc/localtime
+ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime
+echo -e " FECHA LOCAL ARG APLICADA!"
+}
+
+
+gestor_fun () {
+clear
+msg -bar
+echo -e " ${cor[3]}             AJUSTES INTERNOS DEL VPS  "
+msg -bar
+while true; do
+echo -e "${cor[4]} [1] > \033[1;36mACTULIZAR REPOSITORIOS APT"
+echo -e "${cor[4]} [2] > \033[1;36mREINICIAR SERVICIOS"
+echo -e "${cor[4]} [3] > \033[1;36mCAMBIAR HOSTNAME VPS"
+echo -e "${cor[4]} [4] > \033[1;36mCAMBIAR HORA LOCAL MX"
+echo -e "${cor[4]} [5] > \033[1;36mCAMBIAR HORA LOCAL AR"
+echo -e "${cor[4]} [0] > VOLVER"
+while [[ ${opx} != @(0|[1-9]) ]]; do
+msg -bar
+echo -ne " Seleccione una Opcion: \033[1;37m" && read opx
+tput cuu1 && tput dl1
+done
+case $opx in
+	0)
+	return;;
+	1)
+	update_pak
+	break;;
+	2)
+	reiniciar_ser
+	break;;
+	3)
+	host_name
+	break;;
+	4)
+	timemx
+	break;;
+	5)
+	timearg
+	break;;
+esac
+done
+}
+gestor_fun

+ 2 - 0
R9/online/list-arq

@@ -0,0 +1,2 @@
+COMPARTIR ARCHIVO ONLINE \e[32m[working] = apacheon.sh
+MONITOR DE TAREAS HTOP \e[32m[working] = monitor_htop.sh

+ 12 - 0
R9/online/list-arq.back

@@ -0,0 +1,12 @@
+COMPARTIR ARCHIVO ONLINE \e[32m[working] = apacheon.sh
+MONITOR DE TAREAS HTOP \e[32m[working] = monitor_htop.sh
+ADMINISTAR MEDIENTE BOT DE TELEGAM = ADMbot.sh
+DNS NETFLIX = dns-netflix.sh
+FAI2BAN = fai2ban.sh
+AUTENTIFICAR PROXY SQUID = squidpass.sh
+Pass Root/Add root/Horario/etc.. = gestor.sh
+PAYLOAD FUERZA BRUTA = paysnd.sh
+SCANNER DE SUBDOMINIO = ultrahost
+Limpiar/Cache/Ram/Librerias/etc.. = utils.sh
+PRUEBA DE VELOCIDAD = speed.sh
+FIREWALL PARA VPS = blockBT.sh

+ 14 - 0
R9/online/monitor_htop.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+if [[ $(dpkg --get-selections|grep -w 'htop'|head -1) = "" ]]; then
+	title "INSTALADO HTOP..."
+	if apt install htop -y &>/dev/null ; then
+		print_center -verd "Htop instalado"
+		sleep 2
+	else
+		print_center -verm2 "Htop NO instalado"
+		sleep 2
+		return 1
+	fi
+fi
+htop

+ 283 - 0
R9/online/paysnd.sh

@@ -0,0 +1,283 @@
+#!/bin/bash
+#19/12/2019
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+construct_fun () {
+payload="$1"
+sed -i 's/.crlf]/\\r\\n&/g' ${payload}
+sed -i "s/.crlf]//g" ${payload}
+sed -i 's/.cr]/\\r&/g' ${payload}
+sed -i "s/.cr]//g" ${payload}
+sed -i 's/.lf]/\\n&/g' ${payload}
+sed -i "s/.lf]//g" ${payload}
+sed -i "s/.auth]//g" ${payload}
+sed -i 's/.delay_split]/\\r\\n&/g' ${payload}
+sed -i "s/.delay_split]//g" ${payload}
+sed -i 's/.instant_split]/\\r\\n&/g' ${payload}
+sed -i "s/.instant_split]//g" ${payload}
+sed -i 's/.split]/\\r\\n&/g' ${payload}
+sed -i "s/.split]//g" ${payload}
+sed -i "s;.host_port];${hostprox}:22;g" ${payload}
+sed -i "s;.host];${proxy};g" ${payload}
+sed -i "s;.port];:22;g" ${payload}
+sed -i 's;.protocol];HTTP/1.0;g' ${payload}
+sed -i 's;.ua];Dalvik/2.1.0;g' ${payload}
+sed -i 's;.method];CONNECT;g' ${payload}
+sed -i "s;.raw];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.netData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.realData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+}
+esquelet="./payloads.txt"
+gerar_arqpay () {
+echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
+GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $esquelet
+}
+err_fun () {
+echo -e "${cor[5]} Operacion Invalida"
+exit
+}
+echo -e "${cor[5]} Payload Brute Force By Mod MEX"
+msg -bar
+gerar_pay () {
+# Coletando Host
+while [[ ! ${value1} ]]; do
+    read -p " Host Test: " value1
+done
+curl -I ${value1} > /dev/null 2>&1 || err_fun
+[[ $(echo ${value1}|rev|cut -c 1) = "/" ]] && valor1="${value1:0:$((${#value1}-1))}" || valor1="${value1}"
+valor2="127.0.0.1"
+msg -bar
+echo -e "${cor[5]} Request Method ${cor[3]}"
+cat <<EOF
+ [1] - GET        [2] - CONNECT  [3] - PUT     [4] - OPTIONS
+ [5] - DELETE     [6] - HEAD     [7] - PATCH   [8] - POST
+EOF
+msg -bar
+# Coletando Requisição
+while [[ ! ${req} ]]; do
+    read -p " => " valor3
+    case $valor3 in
+    1)req="GET";;
+    2)req="CONNECT";;
+    3)req="PUT";;
+    4)req="OPTIONS";;
+    5)req="DELETE";;
+    6)req="HEAD";;
+    7)req="PATCH";;
+    8)req="POST";;
+    esac
+done
+in="netData"
+gerar_arqpay
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+msg -bar
+read -p " Digite el Proxy/Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+echo -e "${cor[1]} STARTING..."
+msg -bar
+}
+while true; do
+echo -e " [1]-Testear Un Payload"
+echo -e " [2]-Testear Payloads Registrados"
+msg -bar
+read -p " [1-2]: " opx
+case $opx in
+1)
+read -p " Digite un Payload: " payloadx
+echo "$payloadx" > $esquelet
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+construct_fun $esquelet
+read -p " Digite el Proxy/o Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+break
+;;
+2)
+msg -bar
+gerar_pay
+construct_fun $esquelet
+break
+;;
+esac
+done
+read -p " Digite el Tiempo De Espera! (Segundos): " VARS
+msg -bar
+line=$(($(cat $esquelet|wc -l)+1))
+for((a=1; a<$line; a++)); do
+(
+echo -ne "${cor[1]}Payload: ${cor[3]}" >&2
+cat $esquelet|head -${a}|tail -1 >&2
+echo -ne "${cor[1]}Respuesta: ${cor[2]}" >&2
+pay="$(cat $esquelet|head -${a}|tail -1)"
+exec 5<>/dev/tcp/${hostprox}/${portx}
+echo "$pay" >&5
+echo -e "$(cat <&5|head -1)\n" >&2
+) & > /dev/null
+PID=$!
+sleep ${VARS}s
+kill -SIGINT $PID &>/dev/null && echo -e "Sin Respuesta\n"
+done
+echo -ne "\033[0m"

+ 27 - 0
R9/online/speed.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+#19/12/2019
+[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+echo -e "${cor[4]} $(fun_trans "Speed Test") [VPS-MX By @Kalix1]"
+msg -bar
+ping=$(ping -c1 google.com |awk '{print $8 $9}' |grep -v loss |cut -d = -f2 |sed ':a;N;s/\n//g;ta')
+# PROGRESS - BAR
+(
+echo -ne "[" >&2
+while [[ ! -e /tmp/pyend ]]; do
+echo -ne "." >&2
+sleep 0.8s
+done
+rm /tmp/pyend
+echo -e "]" >&2
+) &
+starts_test=$(python ${SCPfrm}/speedtest.py) && touch /tmp/pyend
+sleep 0.6s
+down_load=$(echo "$starts_test" | grep "Download" | awk '{print $2,$3}')
+up_load=$(echo "$starts_test" | grep "Upload" | awk '{print $2,$3}')
+msg -ama " $(fun_trans "Latencia"): $ping"
+msg -ama " $(fun_trans "Subida"): $up_load"
+msg -ama " $(fun_trans "Descarga"): $down_load"
+msg -bar

+ 1412 - 0
R9/online/speedtest.py

@@ -0,0 +1,1412 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright 2012-2016 Matt Martz
+# All Rights Reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import os
+import re
+import csv
+import sys
+import math
+import errno
+import signal
+import socket
+import timeit
+import datetime
+import platform
+import threading
+import xml.parsers.expat
+
+try:
+    import gzip
+    GZIP_BASE = gzip.GzipFile
+except ImportError:
+    gzip = None
+    GZIP_BASE = object
+
+__version__ = '1.0.0'
+
+
+class FakeShutdownEvent(object):
+    """Class to fake a threading.Event.isSet so that users of this module
+    are not required to register their own threading.Event()
+    """
+
+    @staticmethod
+    def isSet():
+        "Dummy method to always return false"""
+        return False
+
+
+# Some global variables we use
+USER_AGENT = None
+SOURCE = None
+SHUTDOWN_EVENT = FakeShutdownEvent()
+SCHEME = 'http'
+DEBUG = False
+
+# Used for bound_interface
+SOCKET_SOCKET = socket.socket
+
+# Begin import game to handle Python 2 and Python 3
+try:
+    import json
+except ImportError:
+    try:
+        import simplejson as json
+    except ImportError:
+        json = None
+
+try:
+    import xml.etree.cElementTree as ET
+except ImportError:
+    try:
+        import xml.etree.ElementTree as ET
+    except ImportError:
+        from xml.dom import minidom as DOM
+        ET = None
+
+try:
+    from urllib2 import urlopen, Request, HTTPError, URLError
+except ImportError:
+    from urllib.request import urlopen, Request, HTTPError, URLError
+
+try:
+    from httplib import HTTPConnection
+except ImportError:
+    from http.client import HTTPConnection
+
+try:
+    from httplib import HTTPSConnection
+except ImportError:
+    try:
+        from http.client import HTTPSConnection
+    except ImportError:
+        HTTPSConnection = None
+
+try:
+    from Queue import Queue
+except ImportError:
+    from queue import Queue
+
+try:
+    from urlparse import urlparse
+except ImportError:
+    from urllib.parse import urlparse
+
+try:
+    from urlparse import parse_qs
+except ImportError:
+    try:
+        from urllib.parse import parse_qs
+    except ImportError:
+        from cgi import parse_qs
+
+try:
+    from hashlib import md5
+except ImportError:
+    from md5 import md5
+
+try:
+    from argparse import ArgumentParser as ArgParser
+    from argparse import SUPPRESS as ARG_SUPPRESS
+    PARSER_TYPE_INT = int
+    PARSER_TYPE_STR = str
+except ImportError:
+    from optparse import OptionParser as ArgParser
+    from optparse import SUPPRESS_HELP as ARG_SUPPRESS
+    PARSER_TYPE_INT = 'int'
+    PARSER_TYPE_STR = 'string'
+
+try:
+    from cStringIO import StringIO
+    BytesIO = None
+except ImportError:
+    try:
+        from io import StringIO, BytesIO
+    except ImportError:
+        from StringIO import StringIO
+        BytesIO = None
+
+try:
+    import builtins
+except ImportError:
+    def print_(*args, **kwargs):
+        """The new-style print function for Python 2.4 and 2.5.
+
+        Taken from https://pypi.python.org/pypi/six/
+
+        Modified to set encoding to UTF-8 if not set when stdout may not be
+        a tty such as when piping to head
+        """
+        fp = kwargs.pop("file", sys.stdout)
+        if fp is None:
+            return
+
+        def write(data):
+            if not isinstance(data, basestring):
+                data = str(data)
+            # If the file has an encoding, encode unicode with it.
+            encoding = fp.encoding or 'UTF-8'  # Diverges for notty
+            if (isinstance(fp, file) and
+                    isinstance(data, unicode) and
+                    encoding is not None):
+                errors = getattr(fp, "errors", None)
+                if errors is None:
+                    errors = "strict"
+                data = data.encode(encoding, errors)
+            fp.write(data)
+        want_unicode = False
+        sep = kwargs.pop("sep", None)
+        if sep is not None:
+            if isinstance(sep, unicode):
+                want_unicode = True
+            elif not isinstance(sep, str):
+                raise TypeError("sep must be None or a string")
+        end = kwargs.pop("end", None)
+        if end is not None:
+            if isinstance(end, unicode):
+                want_unicode = True
+            elif not isinstance(end, str):
+                raise TypeError("end must be None or a string")
+        if kwargs:
+            raise TypeError("invalid keyword arguments to print()")
+        if not want_unicode:
+            for arg in args:
+                if isinstance(arg, unicode):
+                    want_unicode = True
+                    break
+        if want_unicode:
+            newline = unicode("\n")
+            space = unicode(" ")
+        else:
+            newline = "\n"
+            space = " "
+        if sep is None:
+            sep = space
+        if end is None:
+            end = newline
+        for i, arg in enumerate(args):
+            if i:
+                write(sep)
+            write(arg)
+        write(end)
+else:
+    print_ = getattr(builtins, 'print')
+    del builtins
+
+# Exception "constants" to support Python 2 through Python 3
+try:
+    import ssl
+    try:
+        CERT_ERROR = (ssl.CertificateError,)
+    except AttributeError:
+        CERT_ERROR = tuple()
+
+    HTTP_ERRORS = ((HTTPError, URLError, socket.error, ssl.SSLError) +
+                   CERT_ERROR)
+except ImportError:
+    HTTP_ERRORS = (HTTPError, URLError, socket.error)
+
+
+class SpeedtestException(Exception):
+    """Base exception for this module"""
+
+
+class SpeedtestHTTPError(SpeedtestException):
+    """Base HTTP exception for this module"""
+
+
+class SpeedtestConfigError(SpeedtestException):
+    """Configuration provided is invalid"""
+
+
+class ConfigRetrievalError(SpeedtestHTTPError):
+    """Could not retrieve config.php"""
+
+
+class ServersRetrievalError(SpeedtestHTTPError):
+    """Could not retrieve speedtest-servers.php"""
+
+
+class InvalidServerIDType(SpeedtestException):
+    """Server ID used for filtering was not an integer"""
+
+
+class NoMatchedServers(SpeedtestException):
+    """No servers matched when filtering"""
+
+
+class SpeedtestMiniConnectFailure(SpeedtestException):
+    """Could not connect to the provided speedtest mini server"""
+
+
+class InvalidSpeedtestMiniServer(SpeedtestException):
+    """Server provided as a speedtest mini server does not actually appear
+    to be a speedtest mini server
+    """
+
+
+class ShareResultsConnectFailure(SpeedtestException):
+    """Could not connect to speedtest.net API to POST results"""
+
+
+class ShareResultsSubmitFailure(SpeedtestException):
+    """Unable to successfully POST results to speedtest.net API after
+    connection
+    """
+
+
+class SpeedtestUploadTimeout(SpeedtestException):
+    """testlength configuration reached during upload
+    Used to ensure the upload halts when no additional data should be sent
+    """
+
+
+class SpeedtestBestServerFailure(SpeedtestException):
+    """Unable to determine best server"""
+
+
+class GzipDecodedResponse(GZIP_BASE):
+    """A file-like object to decode a response encoded with the gzip
+    method, as described in RFC 1952.
+
+    Largely copied from ``xmlrpclib``/``xmlrpc.client`` and modified
+    to work for py2.4-py3
+    """
+    def __init__(self, response):
+        # response doesn't support tell() and read(), required by
+        # GzipFile
+        if not gzip:
+            raise SpeedtestHTTPError('HTTP response body is gzip encoded, '
+                                     'but gzip support is not available')
+        IO = BytesIO or StringIO
+        self.io = IO(response.read())
+        gzip.GzipFile.__init__(self, mode='rb', fileobj=self.io)
+
+    def close(self):
+        try:
+            gzip.GzipFile.close(self)
+        finally:
+            self.io.close()
+
+
+def bound_socket(*args, **kwargs):
+    """Bind socket to a specified source IP address"""
+
+    sock = SOCKET_SOCKET(*args, **kwargs)
+    sock.bind((SOURCE, 0))
+    return sock
+
+
+def distance(origin, destination):
+    """Determine distance between 2 sets of [lat,lon] in km"""
+
+    lat1, lon1 = origin
+    lat2, lon2 = destination
+    radius = 6371  # km
+
+    dlat = math.radians(lat2 - lat1)
+    dlon = math.radians(lon2 - lon1)
+    a = (math.sin(dlat / 2) * math.sin(dlat / 2) +
+         math.cos(math.radians(lat1)) *
+         math.cos(math.radians(lat2)) * math.sin(dlon / 2) *
+         math.sin(dlon / 2))
+    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
+    d = radius * c
+
+    return d
+
+
+def build_user_agent():
+    """Build a Mozilla/5.0 compatible User-Agent string"""
+
+    global USER_AGENT
+    if USER_AGENT:
+        return USER_AGENT
+
+    ua_tuple = (
+        'Mozilla/5.0',
+        '(%s; U; %s; en-us)' % (platform.system(), platform.architecture()[0]),
+        'Python/%s' % platform.python_version(),
+        '(KHTML, like Gecko)',
+        'speedtest-cli/%s' % __version__
+    )
+    USER_AGENT = ' '.join(ua_tuple)
+    printer(USER_AGENT, debug=True)
+    return USER_AGENT
+
+
+def build_request(url, data=None, headers=None, bump=''):
+    """Build a urllib2 request object
+
+    This function automatically adds a User-Agent header to all requests
+
+    """
+
+    if not USER_AGENT:
+        build_user_agent()
+
+    if not headers:
+        headers = {}
+
+    if url[0] == ':':
+        schemed_url = '%s%s' % (SCHEME, url)
+    else:
+        schemed_url = url
+
+    if '?' in url:
+        delim = '&'
+    else:
+        delim = '?'
+
+    # WHO YOU GONNA CALL? CACHE BUSTERS!
+    final_url = '%s%sx=%s.%s' % (schemed_url, delim,
+                                 int(timeit.time.time() * 1000),
+                                 bump)
+
+    headers.update({
+        'User-Agent': USER_AGENT,
+        'Cache-Control': 'no-cache',
+    })
+
+    printer('%s %s' % (('GET', 'POST')[bool(data)], final_url),
+            debug=True)
+
+    return Request(final_url, data=data, headers=headers)
+
+
+def catch_request(request):
+    """Helper function to catch common exceptions encountered when
+    establishing a connection with a HTTP/HTTPS request
+
+    """
+
+    try:
+        uh = urlopen(request)
+        return uh, False
+    except HTTP_ERRORS:
+        e = sys.exc_info()[1]
+        return None, e
+
+
+def get_response_stream(response):
+    """Helper function to return either a Gzip reader if
+    ``Content-Encoding`` is ``gzip`` otherwise the response itself
+
+    """
+
+    try:
+        getheader = response.headers.getheader
+    except AttributeError:
+        getheader = response.getheader
+
+    if getheader('content-encoding') == 'gzip':
+        return GzipDecodedResponse(response)
+
+    return response
+
+
+def get_attributes_by_tag_name(dom, tag_name):
+    """Retrieve an attribute from an XML document and return it in a
+    consistent format
+
+    Only used with xml.dom.minidom, which is likely only to be used
+    with python versions older than 2.5
+    """
+    elem = dom.getElementsByTagName(tag_name)[0]
+    return dict(list(elem.attributes.items()))
+
+
+def print_dots(current, total, start=False, end=False):
+    """Built in callback function used by Thread classes for printing
+    status
+    """
+
+    if SHUTDOWN_EVENT.isSet():
+        return
+
+    sys.stdout.write('.')
+    if current + 1 == total and end is True:
+        sys.stdout.write('\n')
+    sys.stdout.flush()
+
+
+def do_nothing(*args, **kwargs):
+    pass
+
+
+class HTTPDownloader(threading.Thread):
+    """Thread class for retrieving a URL"""
+
+    def __init__(self, i, request, start, timeout):
+        threading.Thread.__init__(self)
+        self.request = request
+        self.result = [0]
+        self.starttime = start
+        self.timeout = timeout
+        self.i = i
+
+    def run(self):
+        try:
+            if (timeit.default_timer() - self.starttime) <= self.timeout:
+                f = urlopen(self.request)
+                while (not SHUTDOWN_EVENT.isSet() and
+                        (timeit.default_timer() - self.starttime) <=
+                        self.timeout):
+                    self.result.append(len(f.read(10240)))
+                    if self.result[-1] == 0:
+                        break
+                f.close()
+        except IOError:
+            pass
+
+
+class HTTPUploaderData(object):
+    """File like object to improve cutting off the upload once the timeout
+    has been reached
+    """
+
+    def __init__(self, length, start, timeout):
+        self.length = length
+        self.start = start
+        self.timeout = timeout
+
+        self._data = None
+
+        self.total = [0]
+
+    def _create_data(self):
+        chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+        multiplier = int(round(int(self.length) / 36.0))
+        IO = BytesIO or StringIO
+        self._data = IO(
+            ('content1=%s' %
+             (chars * multiplier)[0:int(self.length) - 9]
+             ).encode()
+        )
+
+    @property
+    def data(self):
+        if not self._data:
+            self._create_data()
+        return self._data
+
+    def read(self, n=10240):
+        if ((timeit.default_timer() - self.start) <= self.timeout and
+                not SHUTDOWN_EVENT.isSet()):
+            chunk = self.data.read(n)
+            self.total.append(len(chunk))
+            return chunk
+        else:
+            raise SpeedtestUploadTimeout
+
+    def __len__(self):
+        return self.length
+
+
+class HTTPUploader(threading.Thread):
+    """Thread class for putting a URL"""
+
+    def __init__(self, i, request, start, size, timeout):
+        threading.Thread.__init__(self)
+        self.request = request
+        self.request.data.start = self.starttime = start
+        self.size = size
+        self.result = None
+        self.timeout = timeout
+        self.i = i
+
+    def run(self):
+        request = self.request
+        try:
+            if ((timeit.default_timer() - self.starttime) <= self.timeout and
+                    not SHUTDOWN_EVENT.isSet()):
+                try:
+                    f = urlopen(request)
+                except TypeError:
+                    # PY24 expects a string or buffer
+                    # This also causes issues with Ctrl-C, but we will concede
+                    # for the moment that Ctrl-C on PY24 isn't immediate
+                    request = build_request(self.request.get_full_url(),
+                                            data=request.data.read(self.size))
+                    f = urlopen(request)
+                f.read(11)
+                f.close()
+                self.result = sum(self.request.data.total)
+            else:
+                self.result = 0
+        except (IOError, SpeedtestUploadTimeout):
+            self.result = sum(self.request.data.total)
+
+
+class SpeedtestResults(object):
+    """Class for holding the results of a speedtest, including:
+
+    Download speed
+    Upload speed
+    Ping/Latency to test server
+    Data about server that the test was run against
+
+    Additionally this class can return a result data as a dictionary or CSV,
+    as well as submit a POST of the result data to the speedtest.net API
+    to get a share results image link.
+    """
+
+    def __init__(self, download=0, upload=0, ping=0, server=None):
+        self.download = download
+        self.upload = upload
+        self.ping = ping
+        if server is None:
+            self.server = {}
+        else:
+            self.server = server
+        self._share = None
+        self.timestamp = datetime.datetime.utcnow().isoformat()
+        self.bytes_received = 0
+        self.bytes_sent = 0
+
+    def __repr__(self):
+        return repr(self.dict())
+
+    def share(self):
+        """POST data to the speedtest.net API to obtain a share results
+        link
+        """
+
+        if self._share:
+            return self._share
+
+        download = int(round(self.download / 1000.0, 0))
+        ping = int(round(self.ping, 0))
+        upload = int(round(self.upload / 1000.0, 0))
+
+        # Build the request to send results back to speedtest.net
+        # We use a list instead of a dict because the API expects parameters
+        # in a certain order
+        api_data = [
+            'recommendedserverid=%s' % self.server['id'],
+            'ping=%s' % ping,
+            'screenresolution=',
+            'promo=',
+            'download=%s' % download,
+            'screendpi=',
+            'upload=%s' % upload,
+            'testmethod=http',
+            'hash=%s' % md5(('%s-%s-%s-%s' %
+                             (ping, upload, download, '297aae72'))
+                            .encode()).hexdigest(),
+            'touchscreen=none',
+            'startmode=pingselect',
+            'accuracy=1',
+            'bytesreceived=%s' % self.bytes_received,
+            'bytessent=%s' % self.bytes_sent,
+            'serverid=%s' % self.server['id'],
+        ]
+
+        headers = {'Referer': 'http://c.speedtest.net/flash/speedtest.swf'}
+        request = build_request('://www.speedtest.net/api/api.php',
+                                data='&'.join(api_data).encode(),
+                                headers=headers)
+        f, e = catch_request(request)
+        if e:
+            raise ShareResultsConnectFailure(e)
+
+        response = f.read()
+        code = f.code
+        f.close()
+
+        if int(code) != 200:
+            raise ShareResultsSubmitFailure('Could not submit results to '
+                                            'speedtest.net')
+
+        qsargs = parse_qs(response.decode())
+        resultid = qsargs.get('resultid')
+        if not resultid or len(resultid) != 1:
+            raise ShareResultsSubmitFailure('Could not submit results to '
+                                            'speedtest.net')
+
+        self._share = 'http://www.speedtest.net/result/%s.png' % resultid[0]
+
+        return self._share
+
+    def dict(self):
+        """Return dictionary of result data"""
+
+        return {
+            'download': self.download,
+            'upload': self.upload,
+            'ping': self.ping,
+            'server': self.server,
+            'timestamp': self.timestamp
+        }
+
+    def csv(self, delimiter=','):
+        """Return data in CSV format"""
+
+        data = self.dict()
+        out = StringIO()
+        writer = csv.writer(out, delimiter=delimiter, lineterminator='')
+        writer.writerow([data['server']['id'], data['server']['sponsor'],
+                         data['server']['name'], data['timestamp'],
+                         data['server']['d'], data['ping'], data['download'],
+                         data['upload']])
+        return out.getvalue()
+
+    def json(self, pretty=False):
+        """Return data in JSON format"""
+
+        kwargs = {}
+        if pretty:
+            kwargs.update({
+                'indent': 4,
+                'sort_keys': True
+            })
+        return json.dumps(self.dict(), **kwargs)
+
+
+class Speedtest(object):
+    """Class for performing standard speedtest.net testing operations"""
+
+    def __init__(self, config=None):
+        self.config = {}
+        self.get_config()
+        if config is not None:
+            self.config.update(config)
+
+        self.servers = {}
+        self.closest = []
+        self.best = {}
+
+        self.results = SpeedtestResults()
+
+    def get_config(self):
+        """Download the speedtest.net configuration and return only the data
+        we are interested in
+        """
+
+        headers = {}
+        if gzip:
+            headers['Accept-Encoding'] = 'gzip'
+        request = build_request('://www.speedtest.net/speedtest-config.php',
+                                headers=headers)
+        uh, e = catch_request(request)
+        if e:
+            raise ConfigRetrievalError(e)
+        configxml = []
+
+        stream = get_response_stream(uh)
+
+        while 1:
+            configxml.append(stream.read(10240))
+            if len(configxml[-1]) == 0:
+                break
+        stream.close()
+        uh.close()
+
+        if int(uh.code) != 200:
+            return None
+
+        printer(''.encode().join(configxml), debug=True)
+
+        try:
+            root = ET.fromstring(''.encode().join(configxml))
+            server_config = root.find('server-config').attrib
+            download = root.find('download').attrib
+            upload = root.find('upload').attrib
+            # times = root.find('times').attrib
+            client = root.find('client').attrib
+
+        except AttributeError:
+            root = DOM.parseString(''.join(configxml))
+            server_config = get_attributes_by_tag_name(root, 'server-config')
+            download = get_attributes_by_tag_name(root, 'download')
+            upload = get_attributes_by_tag_name(root, 'upload')
+            # times = get_attributes_by_tag_name(root, 'times')
+            client = get_attributes_by_tag_name(root, 'client')
+
+        ignore_servers = list(
+            map(int, server_config['ignoreids'].split(','))
+        )
+
+        ratio = int(upload['ratio'])
+        upload_max = int(upload['maxchunkcount'])
+        up_sizes = [32768, 65536, 131072, 262144, 524288, 1048576, 7340032]
+        sizes = {
+            'upload': up_sizes[ratio - 1:],
+            'download': [350, 500, 750, 1000, 1500, 2000, 2500,
+                         3000, 3500, 4000]
+        }
+
+        counts = {
+            'upload': int(upload_max * 2 / len(sizes['upload'])),
+            'download': int(download['threadsperurl'])
+        }
+
+        threads = {
+            'upload': int(upload['threads']),
+            'download': int(server_config['threadcount']) * 2
+        }
+
+        length = {
+            'upload': int(upload['testlength']),
+            'download': int(download['testlength'])
+        }
+
+        self.config.update({
+            'client': client,
+            'ignore_servers': ignore_servers,
+            'sizes': sizes,
+            'counts': counts,
+            'threads': threads,
+            'length': length,
+            'upload_max': upload_max
+        })
+
+        self.lat_lon = (float(client['lat']), float(client['lon']))
+
+        return self.config
+
+    def get_servers(self, servers=None):
+        """Retrieve a the list of speedtest.net servers, optionally filtered
+        to servers matching those specified in the ``servers`` argument
+        """
+        if servers is None:
+            servers = []
+
+        self.servers.clear()
+
+        for i, s in enumerate(servers):
+            try:
+                servers[i] = int(s)
+            except ValueError:
+                raise InvalidServerIDType('%s is an invalid server type, must '
+                                          'be int' % s)
+
+        urls = [
+            '://www.speedtest.net/speedtest-servers-static.php',
+            'http://c.speedtest.net/speedtest-servers-static.php',
+            '://www.speedtest.net/speedtest-servers.php',
+            'http://c.speedtest.net/speedtest-servers.php',
+        ]
+
+        headers = {}
+        if gzip:
+            headers['Accept-Encoding'] = 'gzip'
+
+        errors = []
+        for url in urls:
+            try:
+                request = build_request('%s?threads=%s' %
+                                        (url,
+                                         self.config['threads']['download']),
+                                        headers=headers)
+                uh, e = catch_request(request)
+                if e:
+                    errors.append('%s' % e)
+                    raise ServersRetrievalError
+
+                stream = get_response_stream(uh)
+
+                serversxml = []
+                while 1:
+                    serversxml.append(stream.read(10240))
+                    if len(serversxml[-1]) == 0:
+                        break
+
+                stream.close()
+                uh.close()
+
+                if int(uh.code) != 200:
+                    raise ServersRetrievalError
+
+                printer(''.encode().join(serversxml), debug=True)
+
+                try:
+                    try:
+                        root = ET.fromstring(''.encode().join(serversxml))
+                        elements = root.getiterator('server')
+                    except AttributeError:
+                        root = DOM.parseString(''.join(serversxml))
+                        elements = root.getElementsByTagName('server')
+                except (SyntaxError, xml.parsers.expat.ExpatError):
+                    raise ServersRetrievalError
+
+                for server in elements:
+                    try:
+                        attrib = server.attrib
+                    except AttributeError:
+                        attrib = dict(list(server.attributes.items()))
+
+                    if servers and int(attrib.get('id')) not in servers:
+                        continue
+
+                    if int(attrib.get('id')) in self.config['ignore_servers']:
+                        continue
+
+                    try:
+                        d = distance(self.lat_lon,
+                                     (float(attrib.get('lat')),
+                                      float(attrib.get('lon'))))
+                    except:
+                        continue
+
+                    attrib['d'] = d
+
+                    try:
+                        self.servers[d].append(attrib)
+                    except KeyError:
+                        self.servers[d] = [attrib]
+
+                printer(''.encode().join(serversxml), debug=True)
+
+                break
+
+            except ServersRetrievalError:
+                continue
+
+        if servers and not self.servers:
+            raise NoMatchedServers
+
+        return self.servers
+
+    def set_mini_server(self, server):
+        """Instead of querying for a list of servers, set a link to a
+        speedtest mini server
+        """
+
+        urlparts = urlparse(server)
+
+        name, ext = os.path.splitext(urlparts[2])
+        if ext:
+            url = os.path.dirname(server)
+        else:
+            url = server
+
+        request = build_request(url)
+        uh, e = catch_request(request)
+        if e:
+            raise SpeedtestMiniConnectFailure('Failed to connect to %s' %
+                                              server)
+        else:
+            text = uh.read()
+            uh.close()
+
+        extension = re.findall('upload_?[Ee]xtension: "([^"]+)"',
+                               text.decode())
+        if not extension:
+            for ext in ['php', 'asp', 'aspx', 'jsp']:
+                try:
+                    f = urlopen('%s/speedtest/upload.%s' % (url, ext))
+                except:
+                    pass
+                else:
+                    data = f.read().strip().decode()
+                    if (f.code == 200 and
+                            len(data.splitlines()) == 1 and
+                            re.match('size=[0-9]', data)):
+                        extension = [ext]
+                        break
+        if not urlparts or not extension:
+            raise InvalidSpeedtestMiniServer('Invalid Speedtest Mini Server: '
+                                             '%s' % server)
+
+        self.servers = [{
+            'sponsor': 'Speedtest Mini',
+            'name': urlparts[1],
+            'd': 0,
+            'url': '%s/speedtest/upload.%s' % (url.rstrip('/'), extension[0]),
+            'latency': 0,
+            'id': 0
+        }]
+
+        return self.servers
+
+    def get_closest_servers(self, limit=5):
+        """Limit servers to the closest speedtest.net servers based on
+        geographic distance
+        """
+
+        if not self.servers:
+            self.get_servers()
+
+        for d in sorted(self.servers.keys()):
+            for s in self.servers[d]:
+                self.closest.append(s)
+                if len(self.closest) == limit:
+                    break
+            else:
+                continue
+            break
+
+        printer(self.closest, debug=True)
+        return self.closest
+
+    def get_best_server(self, servers=None):
+        """Perform a speedtest.net "ping" to determine which speedtest.net
+        server has the lowest latency
+        """
+
+        if not servers:
+            if not self.closest:
+                servers = self.get_closest_servers()
+            servers = self.closest
+
+        results = {}
+        for server in servers:
+            cum = []
+            url = os.path.dirname(server['url'])
+            urlparts = urlparse('%s/latency.txt' % url)
+            printer('%s %s/latency.txt' % ('GET', url), debug=True)
+            for _ in range(0, 3):
+                try:
+                    if urlparts[0] == 'https':
+                        h = HTTPSConnection(urlparts[1])
+                    else:
+                        h = HTTPConnection(urlparts[1])
+                    headers = {'User-Agent': USER_AGENT}
+                    start = timeit.default_timer()
+                    h.request("GET", urlparts[2], headers=headers)
+                    r = h.getresponse()
+                    total = (timeit.default_timer() - start)
+                except HTTP_ERRORS:
+                    e = sys.exc_info()[1]
+                    printer('%r' % e, debug=True)
+                    cum.append(3600)
+                    continue
+
+                text = r.read(9)
+                if int(r.status) == 200 and text == 'test=test'.encode():
+                    cum.append(total)
+                else:
+                    cum.append(3600)
+                h.close()
+
+            avg = round((sum(cum) / 6) * 1000.0, 3)
+            results[avg] = server
+
+        try:
+            fastest = sorted(results.keys())[0]
+        except IndexError:
+            raise SpeedtestBestServerFailure('Unable to connect to servers to '
+                                             'test latency.')
+        best = results[fastest]
+        best['latency'] = fastest
+
+        self.results.ping = fastest
+        self.results.server = best
+
+        self.best.update(best)
+        printer(best, debug=True)
+        return best
+
+    def download(self, callback=do_nothing):
+        """Test download speed against speedtest.net"""
+
+        urls = []
+        for size in self.config['sizes']['download']:
+            for _ in range(0, self.config['counts']['download']):
+                urls.append('%s/random%sx%s.jpg' %
+                            (os.path.dirname(self.best['url']), size, size))
+
+        request_count = len(urls)
+        requests = []
+        for i, url in enumerate(urls):
+            requests.append(build_request(url, bump=i))
+
+        def producer(q, requests, request_count):
+            for i, request in enumerate(requests):
+                thread = HTTPDownloader(i, request, start,
+                                        self.config['length']['download'])
+                thread.start()
+                q.put(thread, True)
+                callback(i, request_count, start=True)
+
+        finished = []
+
+        def consumer(q, request_count):
+            while len(finished) < request_count:
+                thread = q.get(True)
+                while thread.isAlive():
+                    thread.join(timeout=0.1)
+                finished.append(sum(thread.result))
+                callback(thread.i, request_count, end=True)
+
+        q = Queue(self.config['threads']['download'])
+        prod_thread = threading.Thread(target=producer,
+                                       args=(q, requests, request_count))
+        cons_thread = threading.Thread(target=consumer,
+                                       args=(q, request_count))
+        start = timeit.default_timer()
+        prod_thread.start()
+        cons_thread.start()
+        while prod_thread.isAlive():
+            prod_thread.join(timeout=0.1)
+        while cons_thread.isAlive():
+            cons_thread.join(timeout=0.1)
+
+        stop = timeit.default_timer()
+        self.results.bytes_received = sum(finished)
+        self.results.download = (
+            (self.results.bytes_received / (stop - start)) * 8.0
+        )
+        if self.results.download > 100000:
+            self.config['threads']['upload'] = 8
+        return self.results.download
+
+    def upload(self, callback=do_nothing):
+        """Test upload speed against speedtest.net"""
+
+        sizes = []
+
+        for size in self.config['sizes']['upload']:
+            for _ in range(0, self.config['counts']['upload']):
+                sizes.append(size)
+
+        # request_count = len(sizes)
+        request_count = self.config['upload_max']
+
+        requests = []
+        for i, size in enumerate(sizes):
+            # We set ``0`` for ``start`` and handle setting the actual
+            # ``start`` in ``HTTPUploader`` to get better measurements
+            data = HTTPUploaderData(size, 0, self.config['length']['upload'])
+            data._create_data()
+            requests.append(
+                (
+                    build_request(self.best['url'], data),
+                    size
+                )
+            )
+
+        def producer(q, requests, request_count):
+            for i, request in enumerate(requests[:request_count]):
+                thread = HTTPUploader(i, request[0], start, request[1],
+                                      self.config['length']['upload'])
+                thread.start()
+                q.put(thread, True)
+                callback(i, request_count, start=True)
+
+        finished = []
+
+        def consumer(q, request_count):
+            while len(finished) < request_count:
+                thread = q.get(True)
+                while thread.isAlive():
+                    thread.join(timeout=0.1)
+                finished.append(thread.result)
+                callback(thread.i, request_count, end=True)
+
+        q = Queue(self.config['threads']['upload'])
+        prod_thread = threading.Thread(target=producer,
+                                       args=(q, requests, request_count))
+        cons_thread = threading.Thread(target=consumer,
+                                       args=(q, request_count))
+        start = timeit.default_timer()
+        prod_thread.start()
+        cons_thread.start()
+        while prod_thread.isAlive():
+            prod_thread.join(timeout=0.1)
+        while cons_thread.isAlive():
+            cons_thread.join(timeout=0.1)
+
+        stop = timeit.default_timer()
+        self.results.bytes_sent = sum(finished)
+        self.results.upload = (
+            (self.results.bytes_sent / (stop - start)) * 8.0
+        )
+        return self.results.upload
+
+
+def ctrl_c(signum, frame):
+    """Catch Ctrl-C key sequence and set a SHUTDOWN_EVENT for our threaded
+    operations
+    """
+
+    SHUTDOWN_EVENT.set()
+    print_('\nCancelling...')
+    sys.exit(0)
+
+
+def version():
+    """Print the version"""
+
+    print_(__version__)
+    sys.exit(0)
+
+
+def csv_header():
+    """Print the CSV Headers"""
+
+    print_('Server ID,Sponsor,Server Name,Timestamp,Distance,Ping,Download,'
+           'Upload')
+    sys.exit(0)
+
+
+def parse_args():
+    """Function to handle building and parsing of command line arguments"""
+    description = (
+        'Command line interface for testing internet bandwidth using '
+        'speedtest.net.\n'
+        '------------------------------------------------------------'
+        '--------------\n'
+        'https://github.com/sivel/speedtest-cli')
+
+    parser = ArgParser(description=description)
+    # Give optparse.OptionParser an `add_argument` method for
+    # compatibility with argparse.ArgumentParser
+    try:
+        parser.add_argument = parser.add_option
+    except AttributeError:
+        pass
+    parser.add_argument('--bytes', dest='units', action='store_const',
+                        const=('byte', 8), default=('bit', 1),
+                        help='Display values in bytes instead of bits. Does '
+                             'not affect the image generated by --share, nor '
+                             'output from --json or --csv')
+    parser.add_argument('--share', action='store_true',
+                        help='Generate and provide a URL to the speedtest.net '
+                             'share results image')
+    parser.add_argument('--simple', action='store_true', default=False,
+                        help='Suppress verbose output, only show basic '
+                             'information')
+    parser.add_argument('--csv', action='store_true', default=False,
+                        help='Suppress verbose output, only show basic '
+                             'information in CSV format. Speeds listed in '
+                             'bit/s and not affected by --bytes')
+    parser.add_argument('--csv-delimiter', default=',', type=PARSER_TYPE_STR,
+                        help='Single character delimiter to use in CSV '
+                             'output. Default ","')
+    parser.add_argument('--csv-header', action='store_true', default=False,
+                        help='Print CSV headers')
+    parser.add_argument('--json', action='store_true', default=False,
+                        help='Suppress verbose output, only show basic '
+                             'information in JSON format. Speeds listed in '
+                             'bit/s and not affected by --bytes')
+    parser.add_argument('--list', action='store_true',
+                        help='Display a list of speedtest.net servers '
+                             'sorted by distance')
+    parser.add_argument('--server', help='Specify a server ID to test against',
+                        type=PARSER_TYPE_INT)
+    parser.add_argument('--mini', help='URL of the Speedtest Mini server')
+    parser.add_argument('--source', help='Source IP address to bind to')
+    parser.add_argument('--timeout', default=10, type=PARSER_TYPE_INT,
+                        help='HTTP timeout in seconds. Default 10')
+    parser.add_argument('--secure', action='store_true',
+                        help='Use HTTPS instead of HTTP when communicating '
+                             'with speedtest.net operated servers')
+    parser.add_argument('--version', action='store_true',
+                        help='Show the version number and exit')
+    parser.add_argument('--debug', action='store_true',
+                        help=ARG_SUPPRESS, default=ARG_SUPPRESS)
+
+    options = parser.parse_args()
+    if isinstance(options, tuple):
+        args = options[0]
+    else:
+        args = options
+    return args
+
+
+def validate_optional_args(args):
+    """Check if an argument was provided that depends on a module that may
+    not be part of the Python standard library.
+
+    If such an argument is supplied, and the module does not exist, exit
+    with an error stating which module is missing.
+    """
+    optional_args = {
+        'json': ('json/simplejson python module', json),
+        'secure': ('SSL support', HTTPSConnection),
+    }
+
+    for arg, info in optional_args.items():
+        if getattr(args, arg, False) and info[1] is None:
+            raise SystemExit('%s is not installed. --%s is '
+                             'unavailable' % (info[0], arg))
+
+
+def printer(string, quiet=False, debug=False, **kwargs):
+    """Helper function to print a string only when not quiet"""
+
+    if debug and not DEBUG:
+        return
+
+    if debug:
+        out = '\033[1;30mDEBUG: %s\033[0m' % string
+    else:
+        out = string
+
+    if not quiet:
+        print_(out, **kwargs)
+
+
+def shell():
+    """Run the full speedtest.net test"""
+
+    global SHUTDOWN_EVENT, SOURCE, SCHEME, DEBUG
+    SHUTDOWN_EVENT = threading.Event()
+
+    signal.signal(signal.SIGINT, ctrl_c)
+
+    args = parse_args()
+
+    # Print the version and exit
+    if args.version:
+        version()
+
+    if args.csv_header:
+        csv_header()
+
+    if len(args.csv_delimiter) != 1:
+        raise SystemExit('--csv-delimiter must be a single character')
+
+    validate_optional_args(args)
+
+    socket.setdefaulttimeout(args.timeout)
+
+    # If specified bind to a specific IP address
+    if args.source:
+        SOURCE = args.source
+        socket.socket = bound_socket
+
+    if args.secure:
+        SCHEME = 'https'
+
+    debug = getattr(args, 'debug', False)
+    if debug == 'SUPPRESSHELP':
+        debug = False
+    if debug:
+        DEBUG = True
+
+    # Pre-cache the user agent string
+    build_user_agent()
+
+    if args.simple or args.csv or args.json:
+        quiet = True
+    else:
+        quiet = False
+
+    # Don't set a callback if we are running quietly
+    if quiet or debug:
+        callback = do_nothing
+    else:
+        callback = print_dots
+
+    printer('Retrieving speedtest.net configuration...', quiet)
+    try:
+        speedtest = Speedtest()
+    except ConfigRetrievalError:
+        printer('Cannot retrieve speedtest configuration')
+        sys.exit(1)
+
+    if args.list:
+        try:
+            speedtest.get_servers()
+        except ServersRetrievalError:
+            print_('Cannot retrieve speedtest server list')
+            sys.exit(1)
+
+        for _, servers in sorted(speedtest.servers.items()):
+            for server in servers:
+                line = ('%(id)5s) %(sponsor)s (%(name)s, %(country)s) '
+                        '[%(d)0.2f km]' % server)
+                try:
+                    print_(line)
+                except IOError:
+                    e = sys.exc_info()[1]
+                    if e.errno != errno.EPIPE:
+                        raise
+        sys.exit(0)
+
+    # Set a filter of servers to retrieve
+    servers = []
+    if args.server:
+        servers.append(args.server)
+
+    printer('Testing from %(isp)s (%(ip)s)...' % speedtest.config['client'],
+            quiet)
+
+    if not args.mini:
+        printer('Retrieving speedtest.net server list...', quiet)
+        try:
+            speedtest.get_servers(servers)
+        except NoMatchedServers:
+            print_('No matched servers: %s' % args.server)
+            sys.exit(1)
+        except ServersRetrievalError:
+            print_('Cannot retrieve speedtest server list')
+            sys.exit(1)
+        except InvalidServerIDType:
+            print_('%s is an invalid server type, must be int' % args.server)
+            sys.exit(1)
+
+        printer('Selecting best server based on ping...', quiet)
+        speedtest.get_best_server()
+    elif args.mini:
+        speedtest.get_best_server(speedtest.set_mini_server(args.mini))
+
+    results = speedtest.results
+
+    printer('Hosted by %(sponsor)s (%(name)s) [%(d)0.2f km]: '
+            '%(latency)s ms' % results.server, quiet)
+
+    printer('Testing download speed', quiet,
+            end=('', '\n')[bool(debug)])
+    speedtest.download(callback=callback)
+    printer('Download: %0.2f M%s/s' %
+            ((results.download / 1000.0 / 1000.0) / args.units[1],
+             args.units[0]),
+            quiet)
+
+    printer('Testing upload speed', quiet,
+            end=('', '\n')[bool(debug)])
+    speedtest.upload(callback=callback)
+    printer('Upload: %0.2f M%s/s' %
+            ((results.upload / 1000.0 / 1000.0) / args.units[1],
+             args.units[0]),
+            quiet)
+
+    if args.simple:
+        print_('Ping: %s ms\nDownload: %0.2f M%s/s\nUpload: %0.2f M%s/s' %
+               (results.ping,
+                (results.download / 1000.0 / 1000.0) / args.units[1],
+                args.units[0],
+                (results.upload / 1000.0 / 1000.0) / args.units[1],
+                args.units[0]))
+    elif args.csv:
+        print_(results.csv(delimiter=args.csv_delimiter))
+    elif args.json:
+        print_(results.json())
+
+    if args.share:
+        printer('Share results: %s' % results.share(), quiet)
+
+
+def main():
+    try:
+        shell()
+    except KeyboardInterrupt:
+        print_('\nCancelling...')
+    except (SpeedtestException, SystemExit):
+        e = sys.exc_info()[1]
+        if getattr(e, 'code', 1) != 0:
+            raise SystemExit('ERROR: %s' % e)
+
+
+if __name__ == '__main__':
+    main()
+
+# vim:ts=4:sw=4:expandtab

+ 167 - 0
R9/online/squidpass.sh

@@ -0,0 +1,167 @@
+#!/bin/bash
+#19/12/2019
+clear
+msg -bar
+SCPdir="/etc/newadm" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+fun_bar () {
+comando[0]="$1"
+comando[1]="$2"
+ (
+[[ -e $HOME/fim ]] && rm $HOME/fim
+${comando[0]} -y > /dev/null 2>&1
+${comando[1]} -y > /dev/null 2>&1
+touch $HOME/fim
+ ) > /dev/null 2>&1 &
+echo -ne "\033[1;33m ["
+while true; do
+   for((i=0; i<18; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.1s
+   done
+   [[ -e $HOME/fim ]] && rm $HOME/fim && break
+   echo -e "\033[1;33m]"
+   sleep 1s
+   tput cuu1
+   tput dl1
+   echo -ne "\033[1;33m ["
+done
+echo -e "\033[1;33m]\033[1;31m -\033[1;32m 100%\033[1;37m"
+}
+
+#PREENXE A VARIAVEL $IP
+meu_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+
+squidpass () {
+tmp_arq="/tmp/arq-tmp"
+if [ -d "/etc/squid" ]; then
+pwd="/etc/squid/passwd"
+config_="/etc/squid/squid.conf"
+service_="squid"
+squid_="0"
+elif [ -d "/etc/squid3" ]; then
+pwd="/etc/squid3/passwd"
+config_="/etc/squid3/squid.conf"
+service_="squid3"
+squid_="1"
+fi
+[[ ! -e $config_ ]] && 
+msg -bar && 
+echo -e " \033[1;36m Proxy Squid no Instalado no puede proseguir" && 
+msg -bar && 
+return 0
+if [ -e $pwd ]; then 
+echo -e "${cor[3]} Desea Desactivar Autentificasion del Proxy Squid"
+read -p " [S/N]: " -e -i n sshsn
+[[ "$sshsn" = @(s|S|y|Y) ]] && {
+msg -bar
+echo -e " \033[1;36mDesintalando Dependencias:"
+rm -rf /usr/bin/squid_log1
+fun_bar 'apt-get remove apache2-utils'
+msg -bar
+cat $config_ | grep -v '#Password' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^auth_param.*passwd*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^auth_param.*proxy*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^acl.*REQUIRED*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^http_access.*authenticated*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^http_access.*all*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+echo -e "
+http_access allow all" >> "$config_"
+rm -f $pwd
+service $service_ restart  > /dev/null 2>&1 &
+echo -e " \033[1;31m Desautentificasion de Proxy Squid Desactivado"
+msg -bar
+} 
+else
+echo -e "${cor[3]} "Habilitar Autenfificasion de Proxy Squid?""
+read -p " [S/N]: " -e -i n sshsn
+[[ "$sshsn" = @(s|S|y|Y) ]] && {
+msg -bar
+echo -e " \033[1;36mInstalando Dependencias:"
+echo "Archivo SQUID PASS" > /usr/bin/squid_log1
+fun_bar 'apt-get install apache2-utils'
+msg -bar
+read -e -p " Tu nombre de usuario deseado: " usrn
+[[ $usrn = "" ]] && 
+msg -bar && 
+echo -e " \033[1;31mEl usuario no puede ser nulo" && 
+msg -bar && 
+return 0
+htpasswd -c $pwd $usrn
+succes_=$(grep -c "$usrn" $pwd)
+if [ "$succes_" = "0" ]; then
+rm -f $pwd
+msg -bar
+echo -e " \033[1;31m Error al generar la contraseña, no se inició la autenticación de Squid"
+msg -bar
+return 0
+elif [[ "$succes_" = "1" ]]; then
+cat $config_ | grep -v '^http_access.*all*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+if [ "$squid_" = "0" ]; then
+echo -e "#Password
+auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
+auth_param basic realm proxy
+acl authenticated proxy_auth REQUIRED
+http_access allow authenticated
+http_access deny all" >> "$config_"
+service squid restart  > /dev/null 2>&1 &
+update-rc.d squid defaults > /dev/null 2>&1 &
+elif [ "$squid_" = "1" ]; then
+echo -e "#Password
+auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
+auth_param basic realm proxy
+acl authenticated proxy_auth REQUIRED
+http_access allow authenticated
+http_access deny all" >> "$config_"
+service squid3 restart > /dev/null 2>&1 &
+update-rc.d squid3 defaults > /dev/null 2>&1 &
+fi
+msg -bar
+echo -e " \033[1;32m PROTECCION DE PROXY INICIADA"
+msg -bar
+fi
+}
+fi 
+}
+
+echo -e "${cor[3]}    AUTENTIFICAR PROXY SQUID ${cor[2]}[VPS-MX]"
+msg -bar
+unset squid_log1
+[[ -e /usr/bin/squid_log1 ]] && squid_log1="\033[1;32m$(source trans -b pt:${id} "ACTIVO")"
+echo -e "${cor[2]} [1] > ${cor[3]}AUTENTIFICAR O DESAUTENTIFICAR PROXY $squid_log1"
+echo -e "${cor[2]} [0] > ${cor[4]}VOLVER"
+msg -bar
+echo -ne "\033[1;37mEscoja una Opcion: "
+read optons
+case $optons in
+0)
+msg -bar
+exit
+;;
+1)
+msg -bar
+squidpass
+;;
+esac
+#Reinicia ADM
+
+[[ "$1" = "1" ]] && squidpass
+####_Eliminar_Tmps_####
+[[ -e $_tmp ]] && rm $_tmp
+[[ -e $_tmp2 ]] && rm $_tmp2
+[[ -e $_tmp3 ]] && rm $_tmp3
+[[ -e $_tmp4 ]] && rm $_tmp4

+ 86 - 0
R9/online/ultrahost

@@ -0,0 +1,86 @@
+#!/bin/bash
+#19/12/2019
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+subdom () {
+SUBDOM="$1"
+[[ "$SUBDOM" = "" ]] && return
+randomize="$RANDOM"
+    for sites in `cat $log`; do
+    [[ $(echo ${DNS[@]}|grep $sites) = "" ]] && DNS+=($sites)
+    [[ $(echo ${DNS[@]}|grep $sites) != "" ]] && cat $log|grep -v "$sites" > $log
+    done
+    while true; do
+    [[ "$(pidof lynx | wc -w)" -lt "20" ]] && break
+    done
+    (
+    HOST[$randomize]="$SUBDOM"
+    curl -sSL "${HOST[$randomize]}"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}' >> $log
+    ) > /dev/null 2>&1 &
+}
+
+iniciar () {
+while [[ -z $SUB_DOM ]]; do
+echo -ne "\033[1;33m$(fun_trans "Introduzca el Dominio para realizar la prueba"): " && read SUB_DOM
+done
+[[ -z $limite ]] && echo -ne "\033[1;33m$(fun_trans "Escriba el Limite de Resultados"): " && read limite
+[[ -z ${limite} ]] && limite="300"
+msg -bar
+#CRIA LOG
+log="./loog" && touch $log
+#INICIA PRIMEIRA BUSCA
+_DOM=$(curl -sSL "$SUB_DOM"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}')
+  for _DOMS in `echo $_DOM`; do
+ [[ $(echo ${DNS[@]}|grep ${_DOMS}) = "" ]] && DNS+=(${_DOMS})
+  done
+#INICIA THREADS
+i=0
+while true; do
+DOMAIN=$(echo "${DNS[$i]}")
+[[ $DOMAIN = "" ]] && break
+ if [[ $(echo -e "${PESQ[@]}"|grep "$DOMAIN") = "" ]]; then
+  subdom "$DOMAIN"
+  echo -e "\033[1;31m(Scan\033[1;32m $((${#PESQ[@]}+1))\033[1;31m de \033[1;32m${#DNS[@]}\033[1;31m) - $(fun_trans "Escaneando") ---> \033[1;36mhttp://$DOMAIN\033[1;37m"
+  PESQ+=($DOMAIN)
+ fi
+[[ "$(echo ${#DNS[@]})" -gt "$limite" ]] && break
+i=$(($i+1))
+sleep 1s
+done
+rm $log
+msg -bar
+echo -e "\033[1;32m$(fun_trans "Scan Finalizado Inicio de la colección de IPs")\033[1;31m\033[0m"
+[[ -e $HOME/subresult ]] && rm $HOME/subresult
+[[ ! -e $HOME/subresult ]] && touch $HOME/subresult
+for result in $(echo "${DNS[@]}"); do
+(
+rand="$RANDOM"
+dns[rand]="$result"
+scan[rand]=$(echo ${result}|cut -d'/' -f1)
+IP[rand]=$(nslookup "${scan[rand]}"|grep -Eo 'Address: [0-9.]+'|grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|tail -1) > /dev/null 2>&1
+echo -e "====================================\nDNS: ${dns[rand]}\nIP: ${IP[rand]}\n====================================" >> $HOME/subresult
+unset IP
+) &
+done
+while true; do
+[[ $(pidof nslookup|wc -w) -lt "1" ]] && break
+done
+msg -bar
+RSLT=$(($(cat $HOME/subresult|wc -l)/4)) && echo -e "\033[1;32m$RSLT $(fun_trans "Hosts Capturados")\033[0m"
+msg -bar
+echo -ne "$(fun_trans "Desea Imprimir Resultados")? [S/N]: "; read yn
+   [[ $yn = @(s|S|y|Y) ]] && {
+   echo -ne "\033[1;32m"
+   cat $HOME/subresult|grep -v =
+   echo -e "$barra\033[0m"
+   }
+return 0
+}
+#INICIA SCRIPT
+echo -e "\033[1;33m $(fun_trans "INICIALIZANDO PROCEDIMENTOS") (SCAN By Mod MEX)"
+msg -bar
+iniciar
+[[ $? = "0" ]] &&
+echo -e "\033[1;32m$(fun_trans "Registro generado en el archivo") $HOME/subresult\033[0m" &&
+msg -bar

+ 135 - 0
R9/online/utils.sh

@@ -0,0 +1,135 @@
+#!/bin/bash
+#06/05/2020
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPinst} ]] && exit
+
+TCPspeed () {
+if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
+#INSTALA
+msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+echo "#ADM" >> /etc/sysctl.conf
+echo "net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Activo Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+ else
+#REMOVE
+msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+grep -v "^#ADM
+net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Parado Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+fi
+}
+SquidCACHE () {
+msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
+msg -ama "$(fun_trans "Mejora la velocidad del squid")"
+msg -bar
+if [ -e /etc/squid/squid.conf ]; then
+squid_var="/etc/squid/squid.conf"
+elif [ -e /etc/squid3/squid.conf ]; then
+squid_var="/etc/squid3/squid.conf"
+else
+msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
+fi
+teste_cache="#CACHE DO SQUID"
+if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
+  [[ -e ${squid_var}.bakk ]] && {
+  msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
+  mv -f ${squid_var}.bakk $squid_var
+  msg -ama "$(fun_trans "Cache squid Removido")!"
+  service squid restart > /dev/null 2>&1 &
+  service squid3 restart > /dev/null 2>&1 &
+  return 0
+  }
+fi
+msg -ama "$(fun_trans "Aplicando Cache Squid")!"
+msg -bar
+_tmp="#CACHE DO SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
+[[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
+while read s_squid; do
+[[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
+done < $squid_var
+cp ${squid_var} ${squid_var}.bakk
+echo -e "${_tmp}" > $squid_var
+msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
+service squid restart > /dev/null 2>&1 &
+service squid3 restart > /dev/null 2>&1 &
+}
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " $(fun_trans "FECHA LOCAL MX APLICADA!")"
+}
+resetiptables () {
+echo -e "Reiniciando Ipetables espere"
+iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
+echo -e "iptables reiniciadas con exito"
+}
+packobs () {
+msg -ama "Buscando Paquetes Obsoletos"
+dpkg -l | grep -i ^rc
+msg -ama "Limpiando Paquetes Obsoloteos"
+dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
+msg -ama "Limpieza Completa"
+}
+
+
+on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+[[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && tcp=$off || tcp=$on
+if [ -e /etc/squid/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+elif [ -e /etc/squid3/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid3/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+fi
+msg -bar
+msg -ama "                OPTIMIZADORES BASICOS "
+msg -bar
+echo -ne "$(msg -verd "  [1]") $(msg -verm2 ">") " && msg -azu "TCP-SPEED $tcp"
+echo -ne "$(msg -verd "  [2]") $(msg -verm2 ">") " && msg -azu "CACHE PARA SQUID $squid"
+echo -ne "$(msg -verd "  [3]") $(msg -verm2 ">") " && msg -azu "LIMPIAR PAQUETES  OBSOLETOS"
+echo -ne "$(msg -verd "  [4]") $(msg -verm2 ">") " && msg -azu "$(fun_trans "RESET IPTABLES")"
+msg -bar
+echo -ne "$(msg -verd "  [0]") $(msg -verm2 ">") " && msg -bra " \033[1;41m VOLVER \033[0m"
+msg -bar
+while [[ ${arquivoonlineadm} != @(0|[1-5]) ]]; do
+	echo -ne "$(msg -azu "opcion:") "
+read arquivoonlineadm
+tput cuu1 && tput dl1
+done
+case $arquivoonlineadm in
+1)TCPspeed;;
+2)SquidCACHE;;
+3)packobs;;
+4)resetiptables;;
+0)exit;;
+esac
+msg -bar

+ 8 - 0
Source-List/10.list

@@ -0,0 +1,8 @@
+## Debian 10
+
+deb http://deb.debian.org/debian/ buster main contrib non-free
+deb-src http://deb.debian.org/debian/ buster main contrib non-free
+deb http://security.debian.org/debian-security buster/updates main contrib non-free
+deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
+deb http://deb.debian.org/debian/ buster-updates main contrib non-free
+deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free

+ 8 - 0
Source-List/11.list

@@ -0,0 +1,8 @@
+## Debian 11
+
+deb http://deb.debian.org/debian/ bullseye main contrib non-free
+deb-src http://deb.debian.org/debian/ bullseye main contrib non-free
+deb http://security.debian.org/debian-security bullseye/updates main contrib non-free
+deb-src http://security.debian.org/debian-security bullseye/updates main contrib non-free
+deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
+deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free

+ 12 - 0
Source-List/14.04.list

@@ -0,0 +1,12 @@
+## Ubuntu 14.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ trusty universe
+deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu trusty-security main restricted
+deb http://security.ubuntu.com/ubuntu trusty-security universe
+deb http://security.ubuntu.com/ubuntu trusty-security multiverse

+ 12 - 0
Source-List/16.04.list

@@ -0,0 +1,12 @@
+## Ubuntu 16.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu xenial-security main restricted
+deb http://security.ubuntu.com/ubuntu xenial-security universe
+deb http://security.ubuntu.com/ubuntu xenial-security multiverse

+ 11 - 0
Source-List/18.04.list

@@ -0,0 +1,11 @@
+## Ubuntu 18.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ bionic universe
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
+deb http://security.ubuntu.com/ubuntu bionic-security main restricted
+deb http://security.ubuntu.com/ubuntu bionic-security universe
+deb http://security.ubuntu.com/ubuntu bionic-security multiverse

+ 12 - 0
Source-List/20.04.list

@@ -0,0 +1,12 @@
+## Ubuntu 20.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ focal main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ focal universe
+deb http://us.archive.ubuntu.com/ubuntu/ focal-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu focal-security main restricted
+deb http://security.ubuntu.com/ubuntu focal-security universe
+deb http://security.ubuntu.com/ubuntu focal-security multiverse

+ 12 - 0
Source-List/20.10.list

@@ -0,0 +1,12 @@
+## Ubuntu 20.10
+
+deb http://us.archive.ubuntu.com/ubuntu/ groovy main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ groovy-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ groovy universe
+deb http://us.archive.ubuntu.com/ubuntu/ groovy-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ groovy multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ groovy-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ groovy-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu groovy-security main restricted
+deb http://security.ubuntu.com/ubuntu groovy-security universe
+deb http://security.ubuntu.com/ubuntu groovy-security multiverse

+ 12 - 0
Source-List/21.04.list

@@ -0,0 +1,12 @@
+## Ubuntu 21.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute universe
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
+deb http://security.ubuntu.com/ubuntu hirsute-security universe
+deb http://security.ubuntu.com/ubuntu hirsute-security multiverse

+ 12 - 0
Source-List/21.10.list

@@ -0,0 +1,12 @@
+## Ubuntu 21.10
+
+deb http://us.archive.ubuntu.com/ubuntu/ impish main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ impish-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ impish universe
+deb http://us.archive.ubuntu.com/ubuntu/ impish-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ impish multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ impish-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ impish-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu impish-security main restricted
+deb http://security.ubuntu.com/ubuntu impish-security universe
+deb http://security.ubuntu.com/ubuntu impish-security multiverse

+ 12 - 0
Source-List/22.04.list

@@ -0,0 +1,12 @@
+## Ubuntu 22.04
+
+deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
+deb http://us.archive.ubuntu.com/ubuntu/ jammy universe
+deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe
+deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
+deb http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu jammy-security main restricted
+deb http://security.ubuntu.com/ubuntu jammy-security universe
+deb http://security.ubuntu.com/ubuntu jammy-security multiverse

+ 8 - 0
Source-List/8.list

@@ -0,0 +1,8 @@
+## Debian 8
+
+deb http://deb.debian.org/debian/ jessie main contrib non-free
+deb-src http://deb.debian.org/debian/ jessie main contrib non-free
+deb http://security.debian.org/debian-security jessie/updates main contrib non-free
+deb-src http://security.debian.org/debian-security jessie/updates main contrib non-free
+deb http://deb.debian.org/debian/ jessie-updates main contrib non-free
+deb-src http://deb.debian.org/debian/ jessie-updates main contrib non-free

+ 8 - 0
Source-List/9.list

@@ -0,0 +1,8 @@
+## Debian 9
+
+deb http://deb.debian.org/debian/ stretch main contrib non-free
+deb-src http://deb.debian.org/debian/ stretch main contrib non-free
+deb http://security.debian.org/debian-security stretch/updates main contrib non-free
+deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
+deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
+deb-src http://deb.debian.org/debian/ stretch-updates main contrib non-free

+ 5 - 0
Source-List/README.md

@@ -0,0 +1,5 @@
+# Lista de APT sources.list
+
+Ubuntu 14, 16, 18.04, 20.04, 20.10, 21.04, 21.10, 22.04
+
+Debian 8, 9, 10, 11