#! /bin/bash

## Twist Ver 0.5.6 beta* Written by Unbinilium https://github.com/Unbinilium/Twist
## Update Ver 1.0 will provide mptcp feature, this script will be rewrite and use standard commands

function shadowsocksconfig(){
    SSLOCAL="[\"[::0]\",\"0.0.0.0\"]"
    PORT="443"
    PASSWORD=""
    METHOD="xchacha20-ietf-poly1305"
    TIMEOUT="1800"
    OBFS="tls"
    OBFSHOST="mzstatic.com"
    OBFSURI="/"
    FASTOPEN="true"
    REUSEPORT="true"
    DNS1="8.8.8.8"
    DNS2="8.8.4.4"
    DNSv6a="2001:4860:4860::8888"
    DNSv6b="2001:4860:4860::8844"
    DSCP="EF"
    MODE="tcp_and_udp"
    MTU=""
    MPTCP="false"
    IPV6FIRST="false"
    SYSLOG="true"
    NODELAY="true"
    FWS="enable"
    BBR="enable"
}

function systemconfig(){
    libsodiumver=""
    mbedtlsver=""
    sslibevtag=""
    ssobfstag=""
    elrepover7="7.0-3"
    elrepover6="6-8"
    ETH=""
    PUBLICIP=""
    PUBLICIPv6=""
    IPREGEX="^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"
}

function install_twist(){
    clear
    twistprint
    echo -e "#[\033[32;1m   A Light Script For You To Setup Shadowsocks-libev Server       \033[0m]#"
    echo -e "#[\033[32;1m              Twist Script Written By Unbinilium                  \033[0m]#"
    echo -e "#[\033[32;1m             Installation will Start in 5 Seconds                 \033[0m]#"
    twistprint banner
    echo ""
    sleep 5
    rootness
    selinuxdisable
    [ -d /etc/twist ] || mkdir -p /etc/twist
    twistlog "[TWIST Installing]"
    shadowsocksconfig
    systemconfig
    systemdetect
    dependenciesinstall
    tcpbbrenable
    sslibevinstall "install"
    sslibevconfigure
    firewallconfigure
    servicesstart
    servicesstatus
}

function update_twist(){
    clear
    twistprint
    echo -e "#[\033[32;1m                 Update Twist Shadowsocks-libev                   \033[0m]#"
    echo -e "#[\033[32;1m                 Update will Start in 5 Seconds                   \033[0m]#"
    twistprint banner
    echo ""
    sleep 5
    rootness
    twistlog "[TWIST Updating]"
    shadowsocksconfig
    systemconfig
    selinuxdisable
    systemdetect
    if [ "$twistinstalled" = "false" ]; then
        twistprint banner nofile
    else
        if [ -r /var/run/shadowsocks-libev.pid ]; then
            read pid < /var/run/shadowsocks-libev.pid
            [ -e /etc/twist/twistprotect ] && { echo -e "# \${date} Shadowsocks-libev Service Stopped Due To Update " >> /var/log/twist; rm -f /etc/twist/twistprotect; }
            kill -9 $pid
            rm -f /var/run/shadowsocks-libev.pid
        fi
    fi
    dependenciesinstall
    sslibevinstall "install"
    echo ""
    servicesstart
    sleep 2
    clear
    twistprint
    echo -e "#[\033[32;1m                      Twist Update Finished                       \033[0m]#"
    twistprint banner
    serverrestart "Update"
    echo ""
    exit 0
}

function uninstall_twist(){
    clear
    twistprint
    echo -e "#[\033[31;1m               Uninstall Twist Shadowsocks-libev                  \033[0m]#"
    echo -e "#[\033[31;1m               Uninstall will Start in 5 Seconds                  \033[0m]#"
    twistprint banner
    echo ""
    sleep 5
    rootness
    if ! grep -qs "Twist" /etc/sysctl.conf; then
        twistprint banner nofile
    else
        sed -i "/# Twist/d" /etc/sysctl.conf
        sed -i "/twistprotect/d" /etc/crontab
        if [ "$packagemanagertype" = "p" ]; then
            systemctl restart cronie.service
        else
            systemctl restart cron.service
        fi
        rm -f /root/twistprotect
        twist stop
        echo ""
        sleep 2
    fi
    sslibevinstall "uninstall"
    timemachine "restore" "/etc/twist/sysctl.conf" "/etc/sysctl.conf" && sysctl -e -p
    timemachine "restore" "/etc/twist/limits.conf" "/etc/security/limits.conf"
    timemachine "restore" "/etc/twist/login" "/etc/pam.d/login"
    timemachine "restore" "/etc/twist/resolv.conf" "/etc/resolv.conf"
    timemachine "restore" "/etc/twist/iptables.rules" "/etc/iptables.rules" && iptables-restore < /etc/iptables.rules
    timemachine "restore" "/etc/twist/ip6tables.rules" "/etc/ip6tables.rules" && ip6tables-restore < /etc/ip6tables.rules
    timemachine "restore" "/etc/twist/iptablesload" "/etc/network/if-pre-up.d/iptablesload"
    timemachine "restore" "/etc/twist/ip6tablesload" "/etc/network/if-pre-up.d/ip6tablesload"
    timemachine "restore" "/etc/twist/crontab" "/etc/crontab"
    timemachine "restore" "/etc/twist/rc.local" "/etc/rc.local"
    timemachine "restore" "/etc/twist/.htaccess" "/var/www/html/.htaccess"
    timemachine "restore" "/etc/twist/index.html" "/var/www/html/index.html"
    rm -f /usr/bin/twist /root/twistprotect /var/log/twist
    rm -fr /etc/twist /etc/shadowsocks-libev
    systemctl restart fail2ban apache2
    [ -e /var/www/html/index.html ] || systemctl stop apache2
    ldconfig
    clear
    twistprint
    echo -e "#[\033[32;1m                Twist Uninstallation Finished                     \033[0m]#"
    twistprint banner
    echo ""
    exit 1
}

function twistprint(){
    if [ -z "$1" ]; then
        echo "######################################################################"
        echo "#####################################################################"
        echo "       ###       ###         ###     ###      #########    #########"
        echo "       ###        ###    #  ###     ###      ##               ##"
        echo "       ###         ###  ## ###     ###      #########        ##"
        echo "       ###          ### ## ##     ###             ##        ##"
        echo "       ###           ### ###     ###      #########        ##"
        echo ""
    elif [ -z "$3" ]; then
        echo "######################################################################"
    else
        twistlog "Twist was not found on Your Server"
        echo -e "#[\033[31;1m              Twist was not found on Your Server!                 \033[0m]#"
        echo ""
        exit 1
    fi
}

function twistlog(){
    [ -e /var/log/twist ] || touch /var/log/twist
    echo "# ${date} ${1} " >> /var/log/twist
}

function kernelupdateerr(){
    BBR="disable"
    echo ""
    twistlog "${1}"
    echo -e "# [\033[31;1m${1}! \033[0m]"
    echo ""
    sleep 3
}

function dependenciesinstallerr(){
    echo ""
    twistlog "Cannot ${1} Dependencies"
    echo -e "# [\033[31;1mCannot ${1} Dependencies, Please check your network or errors displayed! \033[0m]"
    echo ""
    exit 1
}

function sslibevinstallerr(){
    rm -rf libsodium-${libsodiumver}.tar.gz libsodium-${libsodiumver} mbedtls-${mbedtlsver}-gpl.tgz mbedtls-${mbedtlsver} ${sslibevver}.tar.gz $sslibevver ${ssobfsver}.tar.gz $ssobfsver
    echo ""
    if [ -z "$2" ]; then
        twistlog "Cannot download ${1} source"
        echo -e "# [\033[31;1mCannot download ${1} source. Aborting! \033[0m]"
    else
        twistlog "Error ${1} failed to build"
        echo -e "# [\033[31;1mError ${1} failed to build. Aborting! \033[0m]"
    fi
    echo ""
    exit 1
}

function systemdetecterr(){
    twistlog "Twist could only run on Ubuntu, Debian, Raspbian, Arch Linux, CentOS, Red Hat or Fedora"
    echo -e "# [\033[31;1mTwist could only run on Ubuntu, Debian, Raspbian, Arch Linux, CentOS, Red Hat or Fedora. Aborating! \033[0m]"
    echo ""
    exit 1
}

function timemachine(){
    if [ "$1" = "backup" ]; then
        twistlog "Backing up ${2} to ${3}"
        if [ -e "$3" ]; then
            [ -e "$2" ] && cp -f "${2}" "${3}.old-${date}"
        else
            [ -e "$2" ] && { cp -f "${2}" "${3}"; cp -f "${2}" "${3}.old-${date}"; }
        fi
    else
        if [ -e "$2" ]; then
            twistlog "Restore ${3} from ${2}"
            cp -f "${2}" "${3}"
        else
            rm -f "${3}"
        fi
    fi
}

function serverrestart(){
    if [ "$serverrestart" = "true" ]; then
        twistlog "[TWIST Required Server Restart]"
        echo -e "# [\033[31;1mThe Server Requires Restart to Finish ${1}, Please Press Enter to Reboot! \033[0m]"
        read -p ""
        sleep 3
        reboot
    fi
}

function rootness(){
    if [ "$(id -u)" != 0 ]; then
        echo -e "# [\033[31;1mError:Twist must run by root. Please run Twist with root access! \033[0m]"
        echo ""
        exit 1
    fi
}

function selinuxdisable(){
    [ -z "$(which grep)" ] && { echo ""; echo -e "# [\033[31;1mTwist requires the basic dependencies\033[0m \033[32;1mgrep\033[0m, \033[31;1mPlease Install the Dependencies first. \033[0m]"; echo ""; exit 1; }
    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
}

function systemdetect(){
    if grep -Eqi "Ubuntu|Debian|Raspbian|Arch Linux" /etc/*-release || grep -Eqi "Ubuntu|Debian|Raspbian|Arch Linux" /proc/version; then
        systemtype="1"
    elif grep -Eqi "CentOS|Red Hat|Fedora" /etc/*-release || grep -Eqi "CentOS|Red Hat|Fedora" /proc/version; then
        systemtype="0"
    else
        systemdetecterr
    fi
    if [ ! -z "$(which apt)" ]; then
        packagemanagertype="a"
        webservername="apache2"
    elif [ ! -z "$(which yum)" ]; then
        packagemanagertype="y"
        webservername="httpd"
    elif [ ! -z "$(which pacman)" ]; then
        packagemanagertype="p"
        webservername="apache"
    else
        systemdetecterr
    fi
    if [ -f /proc/user_beancounters ]; then
        BBR="disable"
        if [ "$packagemanagertype" = "a" ]; then
            systemtype="1"
        elif [ "$packagemanagertype" = "y" ]; then
            systemtype="0"
        elif [ "$packagemanagertype" = "p" ]; then
            systemtype="1"
        fi
    fi
    if [ "$packagemanagertype" = "a" ]; then
        tries="0"
        while fuser /var/lib/apt/lists/lock /var/cache/apt/archives/lock /var/lib/dpkg/lock; do
            [ "$tries" = "0" ] && { echo ""; echo -e "# [\033[31;1mTrying to lock the Administration Directory, another Process may using it. \033[0m]"; echo ""; }
            [ "$tries" = "20" ] && { rm -f /var/lib/apt/lists/lock; rm -f /var/cache/apt/archives/lock; rm -f /var/lib/dpkg/lock; }
            [ "$tries" = "21" ] && dpkg --configure -a
            [ "$tries" -ge "22" ] && { echo ""; echo -e "# [\033[31;1mUnable to lock the Administration Directory. \033[0m]"; echo ""; break; }
            tries=$((tries+1))
            sleep 3
        done
    fi
    if [ -z "$(which awk)" ] || [ -z "$(which route)" ] || [ -z "$(which ip)" ] || [ -z "$(which dig)" ] || [ -z "$(which curl)" ]; then
        if [ "$packagemanagertype" = "a" ]; then
            apt-get update || dependenciesinstallerr "Update"
            apt-get -yq install gawk curl net-tools dnsutils || dependenciesinstallerr "Install"
        elif [ "$packagemanagertype" = "y" ]; then
            yum -y update || dependenciesinstallerr "Update"
            yum -y install gawk curl net-tools bind-utils || dependenciesinstallerr "Install"
        else
            pacman -Syyu --noconfirm || dependenciesinstallerr "Update and Upgrade"
            pacman -Syu --noconfirm gawk curl net-tools || dependenciesinstallerr "Install"
        fi
        clear
    fi
    if ! grep -qs "Twist" /etc/sysctl.conf; then
        twistinstalled="false"
    fi
    kernelverheader="$(uname -r | grep -oE '[0-9]+\.[0-9]+')"
    kernelverheaderold="$kernelverheader"
    if [ $(echo ${kernelverheader} | awk -v ver=4.8 '{print($1>ver)? "1":"0"}') -eq "0" ]; then
        [ "$BBR" = "enable" ] && serverrestart="true"
    fi
    if [ -z "$ETH" ]; then
        ETH="$(route | grep '^default' | grep -o '[^ ]*$')"
        [ -z "$ETH" ] && ETH="$(ip -4 route list 0/0 | grep -Po '(?<=dev )(\S+)')"
        if [ ! "$(echo "$ETH" | xargs | awk '{print $2}')" = "" ]; then
            if [ ! "$(echo "$ETH" | xargs | awk '{print $1}')" = "$(echo "$ETH" | xargs | awk '{print $2}')" ]; then
                twistlog "More than 2 Default Network Interface detected"
                echo -e "# [\033[31;1mThere are more than 2 Default Network Interface. Please choose it manually! \033[0m]"
                echo ""
                ip link
                echo ""
                echo -e "Please Enter [\033[32;1mNetwork Interface Name\033[0m]:"
                read -p "Input Interface Name:" ETH
            else
                ETH="$(echo "$ETH" | xargs | awk '{print $1}')"
            fi
        else
            ETH="$(echo "$ETH" | xargs | awk '{print $1}')"
        fi
    fi
    ethstatus="$(cat /sys/class/net/${ETH}/operstate)"
    if [ -z "$ethstatus" ] || [ "$ethstatus" = "down" ]; then
        twistlog "The Network Interface:${ETH} is not available"
        echo -e "# [\033[31;1mNetwork Interface '${ETH}' is not available. Please try another Network Interface listed below! \033[0m]"
        echo ""
        ip link
        echo ""
        echo -e "Please Enter [\033[32;1mNetwork Interface Name\033[0m]:"
        read -p "Input Interface Name:" eth
     	if [ ! "$eth" = "" ]; then
            ethstatus="$(cat /sys/class/net/${eth}/operstate)"
            if [ -z "$ethstatus" ] || [ "$ethstatus" = "down" ]; then
                echo ""
                twistlog "The Network Interface:${eth} is not available"
                echo -e "# [\033[31;1mThe Network Interface:${eth} you entered is not available. Aborting! \033[0m]"
                echo ""
                exit 1
            else
                ETH="$eth"
                echo ""
                twistlog "Using the new Network Interface ${ETH}"
                echo -e "# [\033[33;1mNetwork Interface check passed, Using the new Interface\033[0m \033[32;1m${ETH} \033[0m]"
                echo ""
            fi
        fi
    fi
    [ -z "$PUBLICIP" ] && PUBLICIP="$(dig @resolver1.opendns.com -t A -4 myip.opendns.com +short)"
    if ! printf %s "$PUBLICIP" | grep -Eq "$IPREGEX"; then
        echo ""
        twistlog "Cannot detect a valid Public IP"
        echo -e "# [\033[31;1mCannot detect a valid Public IP. Please fill your Public IP address below! \033[0m]"
        read -p "Input Your Public IP:" publicip
        if ! printf %s "$publicip" | grep -Eq "$IPREGEX"; then
            echo ""
            twistlog "# The IP:${publicip} is not vailed"
            echo -e "# [\033[31;1mThe IP:${publicip} you entered is not vailed. Aborting! \033[0m]"
            echo ""
            exit 1
        else
            PUBLICIP="$publicip"
            echo ""
            twistlog "Using Public IP:${PUBLICIP}"
            echo -e "# [\033[32;1mYou are now using Public IP:${PUBLICIP} \033[0m]"
            echo ""
        fi
    fi
    DNS="${DNS1},${DNS2},${DNSv6a},${DNSv6b}"
    if [ -z "$(ip -6 addr show ${ETH})" ] || [ -z "$PUBLICIPv6" ]; then
        PUBLICIPv6="$(curl -s diagnostic.opendns.com/myip)"
        if [ -z "$PUBLICIPv6" ] || [ "$PUBLICIPv6" = "$PUBLICIP" ]; then
            SSLOCAL="\"0.0.0.0\""
            DNS="${DNS1},${DNS2}"
            IPV6ENABLE="false"
            IPV6FIRST="false"
        fi
     fi
     [ -z "$MTU" ] && MTU="$(cat /sys/class/net/${ETH}/mtu)"
     [ -z "$MTU" ] && MTU="1492"
}

function dependenciesinstall(){
    if [ "$packagemanagertype" = "a" ]; then
        apt-get -yq update || dependenciesinstallerr "Update"
        apt-get -yq upgrade || dependenciesinstallerr "Upgrade"
        apt-get -yq install wget gawk grep curl sed git gcc swig gettext autoconf automake make libtool perl cpio xmlto asciidoc cron fail2ban net-tools dnsutils rng-tools libc-ares-dev libev-dev openssl libssl-dev zlib1g-dev libpcre3-dev libevent-dev build-essential python-dev python-pip python-setuptools python-m2crypto
        [ "$?" != "0" ] && dependenciesinstallerr "Install"
        [ "$FWS" = "enable" ] && { apt-get -yq install apache2 || dependenciesinstallerr "Apache"; }
    elif [ "$packagemanagertype" = "y" ]; then
        yum -y update || dependenciesinstallerr "Update"
        yum -y upgrade || dependenciesinstallerr "Upgrade"
        [ -e /etc/yum.repos.d/epel.repo ] || { yum -y install epel-release yum-utils || { twistlog "Cannot add EPEL repository"; echo -e "# [\033[31;1mCannot add EPEL repository. Aborting! \033[0m]"; exit 1; }; }
        yum -y install wget gawk grep curl sed git gcc swig gettext-devel autoconf automake make libtool pcre-devel perl-devel cpio xmlto asciidoc vixie-cron crontabs fail2ban net-tools bind-utils rng-tools expat-devel openssl-devel zlib-devel libev-devel c-ares-devel python-devel python-setuptools python-pip
        [ "$?" != "0" ] && dependenciesinstallerr "Install"
        [ "$FWS" = "enable" ] && { yum -y install ${webservername} || dependenciesinstallerr "Apache"; }
    else
        pacman -Syyu --noconfirm || dependenciesinstallerr "Update and Upgrade"
        pacman -Syu --noconfirm wget gawk grep curl sed git gcc swig gettext autoconf automake make libtool pcre perl cpio xmlto asciidoc cronie fail2ban net-tools rng-tools openssl zlib c-ares libev python-devel python-setuptools python-pip python2-m2crypto
        [ "$?" != "0" ] && dependenciesinstallerr "Install"
        [ "$FWS" = "enable" ] && { pacman -Syu --noconfirm apache || dependenciesinstallerr "Apache"; }
    fi
    pip install -q qrcode || { echo ""; twistlog "Cannot Install QRCode"; echo -e "# [\033[31;1mCannot Install QRCode, You may unable to configure clients by QRCode! \033[0m]"; echo ""; sleep 3; }
}

function tcpbbrenable(){
    if [ "$BBR" = "enable" ]; then
        timemachine "backup" "/etc/sysctl.conf" "/etc/twist/sysctl.conf"
        if [ "$(printf '%s\n' ${kernelverheader} "4.8" | sort -V | head -n1)" != ${kernelverheader} ] || [ "$kernelupdated" = "true" ]; then
            if [ ! "$(sysctl net.ipv4.tcp_available_congestion_control | awk '{print $3}')" = "bbr" ]; then
                sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
                echo "net.ipv4.tcp_congestion_control = bbr" >> /etc/sysctl.conf
            fi
        else
            echo "net.ipv4.tcp_congestion_control = hybla" >> /etc/sysctl.conf
            kernelupdate
        fi
    fi
}

function kernelupdate(){
    if [ "$packagemanagertype" = "a" ]; then
        KERNELURL="http://kernel.ubuntu.com/~kernel-ppa/mainline/"
        KERNELVER="$(wget -qO- ${KERNELURL} | awk -F'\"v' '/v[4-9]./{print $2}' | cut -d/ -f1 | grep -v -  | sort -V | tail -1)"
        [ -z "$KERNELVER" ] && kernelupdateerr "Cannot get the newest linux kernel verison, bbr disabled"
        if [ "$BBR" = "enable" ]; then
            case "$(dpkg --print-architecture)" in
                amd64)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "lowlatency" | awk -F'\">' '/amd64.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                i386)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "lowlatency" | awk -F'\">' '/i386.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                armhf)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "generic" | awk -F'\">' '/armhf.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                arm64)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "generic" | awk -F'\">' '/arm64.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                ppc64el)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "generic" | awk -F'\">' '/ppc64el.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                s390x)
                    KERNEL="$(wget -qO- ${KERNELURL}v${KERNELVER}/ | grep "linux-image" | grep "generic" | awk -F'\">' '/s390x.deb/{print $2}' | cut -d'<' -f1 | head -1)"
                    ;;
                *)
                    kernelupdateerr "Cannot get the newest linux kernel verison, bbr disabled"
                    ;;
            esac
            [ "$BBR" = "enable" ] && wget -t 3 -T 30 -nv -O "$KERNEL" "${KERNELURL}v${KERNELVER}/${KERNEL}"
            [ "$BBR" = "enable" ] && { dpkg -i $KERNEL || kernelupdateerr "Cannot update linux kernel verison, bbr disabled"; }
            [ "$BBR" = "enable" ] && { dpkg -l | grep linux-image; rm -f $KERNEL; update-grub; }
        fi
    elif [ "$packagemanagertype" = "y" ]; then
        rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org || kernelupdateerr "Cannot get ELRepo key, you may unable to install ELRepo packages"
        if grep -qs "release 7" /etc/*-release; then
            rpm -Uvh "http://www.elrepo.org/elrepo-release-${elrepover7}.el7.elrepo.noarch.rpm" || kernelupdateerr "Cannot Install ELRepo repository. Aborting"
            [ "$BBR" = "enable" ] && { yum --enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel || kernelupdateerr "Cannot update linux kernel verison, bbr disabled"; }
            [ "$BBR" = "enable" ] && grub2-set-default 0
        elif grep -qs "release 6" /etc/*-release; then
            rpm -Uvh "http://www.elrepo.org/elrepo-release-${elrepover6}.e16.elrepo.noarch.rpm" || kernelupdateerr "Cannot Install ELRepo repository. Aborting"
            [ "$BBR" = "enable" ] && { yum --enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel || kernelupdateerr "Cannot update linux kernel verison, bbr disabled"; }
            [ "$BBR" = "enable" ] && sed -i 's/^default=.*/default=0/g' /boot/grub/grub.conf
        fi
    elif [ "$packagemanagertype" = "p" ]; then
        if grep -Eqi "IgnorePkg|IgnoreGroup" /etc/pacman.conf; then
            sed -i "/IgnorePkg/d;/IgnoreGroup/d" /etc/pacman.conf
        fi
        pacman -Syyu --noconfirm || kernelupdateerr "Cannot update linux kernel verison, bbr disabled"
    fi
    [ "$BBR" = "enable" ] && { kernelupdated="true"; serverrestart="true"; }
    kernelverheader="$(uname -r | grep -oE '[0-9]+\.[0-9]+')"
    tcpbbrenable
}

function sslibevinstall(){
    MAKECORES="$(grep -c ^processor /proc/cpuinfo)"
    [ -z "$MAKECORES" ] && MAKECORES="1"
	if [ "$1" = "install" ]; then
        [ -z "$libsodiumver" ] && libsodiumver="$(wget -qO- https://api.github.com/repos/jedisct1/libsodium/releases/latest | grep 'tag_name' | cut -d\" -f4 | cut -d'-' -f1)"
        wget -t 3 -T 30 -nv -O libsodium-${libsodiumver}.tar.gz https://github.com/jedisct1/libsodium/releases/download/${libsodiumver}-RELEASE/libsodium-${libsodiumver}.tar.gz
        [ "$?" != "0" ] && sslibevinstallerr "libsodium-${libsodiumver}"
        [ -d libsodium-${libsodiumver} ] && rm -rf libsodium-${libsodiumver}
        tar zxf libsodium-${libsodiumver}.tar.gz
        pushd libsodium-${libsodiumver}
        ./configure --prefix=/usr && make "-j$((MAKECORES+1))" && make install || sslibevinstallerr "libsodium-${libsodiumver}" err
        popd
        if ! ldconfig -p | grep -wq "/usr/lib"; then
            echo "/usr/lib" > /etc/ld.so.conf.d/lib.conf
        fi
        ldconfig
        [ -z "$mbedtlsver" ] && mbedtlsver="$(wget -qO- https://tls.mbed.org/download-archive | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | cut -d'.' -f1,2,3 | sort -V | tail -1)"
        wget -t 3 -T 30 -nv -O mbedtls-${mbedtlsver}-gpl.tgz https://tls.mbed.org/download/mbedtls-${mbedtlsver}-gpl.tgz
        [ "$?" != "0" ] && sslibevinstallerr "mbedtls-${mbedtlsver}"
        [ -d mbedtls-${mbedtlsver} ] && rm -rf mbedtls-${mbedtlsver}
        tar xf mbedtls-${mbedtlsver}-gpl.tgz
        pushd mbedtls-${mbedtlsver}
        make SHARED=1 CFLAGS=-fPIC "-j$((MAKECORES+1))" && make DESTDIR=/usr install || sslibevinstallerr "mbedtls-${mbedtlsver}" err
        popd
        ldconfig
        rm -rf libsodium-${libsodiumver}.tar.gz libsodium-${libsodiumver} mbedtls-${mbedtlsver}-gpl.tgz mbedtls-${mbedtlsver}
    fi
    [ -z "$sslibevtag" ] && sslibevtag="$(wget -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)"
    sslibevver="shadowsocks-libev-$(echo ${sslibevtag} | sed -e 's/^[a-zA-Z]//g')"
    wget -t 3 -T 30 -nv -O ${sslibevver}.tar.gz https://github.com/shadowsocks/shadowsocks-libev/releases/download/${sslibevtag}/${sslibevver}.tar.gz
    [ "$?" != "0" ] && sslibevinstallerr "shadowsocks-libev-$(echo ${sslibevtag} | sed -e 's/^[a-zA-Z]//g')"
    [ -d ${sslibevver} ] && rm -rf $sslibevver
    tar zxf ${sslibevver}.tar.gz
    pushd $sslibevver
    ./configure --disable-documentation
    make "-j$((MAKECORES+1))" && make ${1} || sslibevinstallerr "shadowsocks-libev-$(echo ${sslibevtag} | sed -e 's/^[a-zA-Z]//g')" err
    popd
    ldconfig
    [ -z "$ssobfstag" ] && ssobfstag="$(wget -qO- https://api.github.com/repos/shadowsocks/simple-obfs/releases/latest | grep 'tag_name' | cut -d\" -f4)"
    ssobfsver="simple-obfs-$(echo ${ssobfstag} | sed -e 's/^[a-zA-Z]//g')"
    wget -t 3 -T 30 -nv -O ${ssobfsver}.tar.gz https://github.com/shadowsocks/simple-obfs/archive/${ssobfstag}.tar.gz
    [ "$?" != "0" ] && sslibevinstallerr "simple-obfs-$(echo ${ssobfstag} | sed -e 's/^[a-zA-Z]//g')"
    [ -d ${ssobfsver} ] && rm -rf $ssobfsver
    tar zxf ${ssobfsver}.tar.gz
    pushd $ssobfsver
    [ -d libcork ] && rm -rf libcork
    git clone https://github.com/shadowsocks/libcork.git -b simple-obfs
    [ "$?" != "0" ] && sslibevinstallerr "libcork"
    ./autogen.sh
    ./configure
    make "-j$((MAKECORES+1))" && make ${1} || sslibevinstallerr "simple-obfs-$(echo ${ssobfstag} | sed -e 's/^[a-zA-Z]//g')" err
    popd
    ldconfig
    [ -f /usr/local/bin/obfs-server ] && ln -s /usr/local/bin/obfs-server /usr/bin
    rm -rf ${sslibevver}.tar.gz $sslibevver ${ssobfsver}.tar.gz $ssobfsver
}

function sslibevconfigure(){
    OBFSLOCAL="obfs-host"
    [ "$FWS" = "enable" ] && OBFSLOCAL="failover"
    OBFSTFO="fast-open;"
    [ "$FASTOPEN" = "true" ] || OBFSTFO=""
    OBFSURL=";obfs-uri=${OBFSURI}"
    [ -z "$OBFSURI" ] && OBFSURL=""
    [ "$OBFSURI" = "/" ] && OBFSURL=""
    [ -z "$PASSWORD" ] && PASSWORD="$(< /dev/urandom tr -dc 'A-HJ-NPR-Za-km-z2-9-._+?%^&*()' | head -c 8)"
    [ -d /etc/shadowsocks-libev ] || mkdir -p /etc/shadowsocks-libev
    timemachine "backup" "/etc/shadowsocks-libev/config.json" "/etc/twist/config.json"
    cat > /etc/shadowsocks-libev/config.json <<-EOF
{
    "server":${SSLOCAL},
    "server_port":${PORT},
    "password":"${PASSWORD}",
    "method":"${METHOD}",
    "timeout":${TIMEOUT},
    "udp_timeout":${TIMEOUT},
    "plugin":"obfs-server",
    "plugin_opts":"obfs=${OBFS};${OBFSTFO}${OBFSLOCAL}=${OBFSHOST}:${PORT}${OBFSURL}",
    "fast_open":${FASTOPEN},
    "reuse_port":${REUSEPORT},
    "nofile":512000,
    "nameserver":"${DNS}",
    "dscp":"${DSCP}",
    "mode":"${MODE}",
    "mtu":${MTU},
    "mptcp":${MPTCP},
    "ipv6_first":${IPV6FIRST},
    "use_syslog":${SYSLOG},
    "no_delay":${NODELAY},
}
EOF
    if [ "$twistinstalled" = "false" ]; then
        timemachine "backup" "/etc/sysctl.conf" "/etc/twist/sysctl.conf"
        cat >> /etc/sysctl.conf <<-EOF
# Twist
fs.file-max = 512000
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.core.netdev_max_backlog = 256000
net.core.somaxconn = 4096
net.ipv4.udp_mem = 25600 51200 102400
net.ipv4.tcp_mem = 25600 51200 102400
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.ip_local_port_range = 49152 65535
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 4096
net.core.default_qdisc = fq
net.ipv4.ip_forward = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_fwmark_accept = 1
net.ipv4.tcp_stdurg = 1
net.ipv4.tcp_synack_retries = 30
net.ipv4.tcp_syn_retries = 30
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_keepalive_time = ${TIMEOUT}
net.ipv4.tcp_mtu_probing = 2
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_low_latency = 1
net.ipv4.udp_l3mdev_accept = 1
net.ipv4.fib_multipath_hash_policy = 1
net.ipv4.fib_multipath_use_neigh = 1
net.ipv4.cipso_rbm_optfmt = 1
net.ipv4.fwmark_reflect = 1
net.ipv4.conf.all.accept_source_route = 1
net.ipv4.conf.all.accept_redirects = 1
net.ipv4.conf.all.send_redirects = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.arp_accept = 1
net.ipv4.conf.all.arp_announce = 1
net.ipv4.conf.all.proxy_arp = 1
net.ipv4.conf.all.proxy_arp_pvlan = 1
net.ipv4.conf.all.mc_forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.accept_source_route = 1
net.ipv6.conf.all.accept_redirects = 1
net.ipv6.conf.all.autoconf = 1
net.ipv6.conf.all.accept_ra = 2
net.ipv6.conf.all.seg6_enabled = 1
EOF
        timemachine "backup" "/etc/security/limits.conf" "/etc/twist/limits.conf"
        echo "*                soft    nofile          512000" >> /etc/security/limits.conf
        echo "*                hard    nofile          512000" >> /etc/security/limits.conf
        echo "" >> /etc/security/limits.conf
        if ! grep -qs "pam_limits.so" /etc/pam.d/login; then
            timemachine "backup" "/etc/pam.d/login" "/etc/twist/login"
            [ "$systemtype" = "0" ] && echo "session    required     pam_limits.so" >> /etc/pam.d/login
        fi
        timemachine "backup" "/etc/resolv.conf" "/etc/twist/resolv.conf"
        echo "nameserver ${DNS1}" >> /etc/resolv.conf
        echo "nameserver ${DNS2}" >> /etc/resolv.conf
        [ "$IPV6ENABLE" = "false" ] || echo "nameserver ${DNSv6a}" >> /etc/resolv.conf
        [ "$IPV6ENABLE" = "false" ] || echo "nameserver ${DNSv6b}" >> /etc/resolv.conf
        echo "" >> /etc/resolv.conf
    fi
}

function firewallconfigure(){
    iptables-save > "/etc/twist/iptables.rules"
    iptables-save > "/etc/twist/iptables.rules.old-${date}"
    iptables -I INPUT -m conntrack --ctstate INVALID -j DROP
    iptables -I INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    iptables -I INPUT -p tcp -m multiport --dports $PORT -j ACCEPT
    iptables -I INPUT -p udp -m multiport --dports $PORT -j ACCEPT
    iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport $PORT -j ACCEPT
    iptables -I INPUT -m state --state NEW -m udp -p udp --dport $PORT -j ACCEPT
    iptables -I FORWARD -m conntrack --ctstate INVALID -j DROP
    iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
    iptables -t nat -A POSTROUTING -o $ETH -j MASQUERADE
    iptables-save > "/etc/iptables.rules"
    timemachine "backup" "/etc/ip6tables.rules" "/etc/twist/ip6tables.rules"
    cp -f "/etc/iptables.rules" "/etc/ip6tables.rules"
    [ -d /etc/network/if-pre-up.d ] || mkdir -p /etc/network/if-pre-up.d
    timemachine "backup" "/etc/network/if-pre-up.d/iptablesload" "/etc/twist/iptablesload"
    cat > /etc/network/if-pre-up.d/iptablesload <<-EOF
#!/bin/sh
iptables-restore < /etc/iptables.rules
exit 0
EOF
    timemachine "backup" "/etc/network/if-pre-up.d/ip6tablesload" "/etc/twist/ip6tablesload"
    cat > /etc/network/if-pre-up.d/ip6tablesload <<-EOF
#!/bin/sh
ip6tables-restore < /etc/ip6tables.rules
exit 0
EOF
}

function servicesstart(){
    recheckkernelverheader="$(uname -r | grep -oE '[0-9]+\.[0-9]+')"
    if [ $(echo ${recheckkernelverheader} | awk -v ver="${kernelverheaderold}" '{print($1>ver)? "1":"0"}') -eq "1" ]; then
        serverrestart="true"
        [ "$recheckkernelverheader" = "$kernelverheaderold" ] && serverrestart="false"
    fi
    if [ -f /usr/local/bin/ss-server ]; then
        ssserverpath="/usr/local/bin/ss-server"
    else
        ssserverpath="/usr/bin/ss-server"
    fi
    if [ "$twistinstalled" = "false" ]; then
        timemachine "backup" "/etc/rc.local" "/etc/twist/rc.local"
        [ -e /etc/rc.local ] || echo "#!/bin/bash" > /etc/rc.local
        sed --follow-symlinks -i '/^exit 0/d' /etc/rc.local
        cat >> /etc/rc.local <<-EOF
sysctl -q -p
iptables-restore < /etc/iptables.rules
ip6tables-restore < /etc/ip6tables.rules
systemctl restart fail2ban cron ${webservername}
if [ -e /etc/twist/twistprotect ]; then
    if [ -r /var/run/shadowsocks-libev.pid ]; then
        read pid < /var/run/shadowsocks-libev.pid
        [ -d "/proc/\${pid}" ] || ${ssserverpath} -uv -c /etc/shadowsocks-libev/config.json -f /var/run/shadowsocks-libev.pid
    else
        ${ssserverpath} -uv -c /etc/shadowsocks-libev/config.json -f /var/run/shadowsocks-libev.pid
    fi
fi
exit 0
EOF
    else
        [ -e /etc/rc.local ] && cp -f "/etc/rc.local" "/etc/twist/rc.local.old-${date}"
    fi
    cat > /usr/bin/twist <<-EOF
#!/bin/bash
date="\$(date +%Y-%m-%d-%H:%M:%S)"
status="0"
if [ ! -f /etc/shadowsocks-libev/config.json ]; then
    twistlog "Shadowsocks-libev Service Error Due To No Config File"
    echo -e "# \033[31;1mError: Shadowsocks-libev config file\033[0m \033[32;1m/etc/shadowsocks-libev/config.json\033[0m \033[31;1mwas not found \033[0m"
    exit 1
else
    [ -e /var/log/twist ] || touch /var/log/twist
fi
twistlog(){
    echo "# \${date} \${1} " >> /var/log/twist
    [ "\$2" = "echo" ] && echo -e "# \033[\${3};1m\${1} \033[0m"
}
ssserverstatus(){
    if [ -r /var/run/shadowsocks-libev.pid ]; then
        read pid < /var/run/shadowsocks-libev.pid
        if [ -d "/proc/\${pid}" ]; then
            twistlog "Shadowsocks-libev Service is Running" "\$1" "32"
            status="0"
            return 0
        else
            twistlog "Shadowsocks-libev Service is Stoped" "\$1" "31"
            rm -f /var/run/shadowsocks-libev.pid
            status="1"
            return 1
        fi
    else
        twistlog "Shadowsocks-libev Service is Stoped" "\$1" "31"
        status="2"
        return 2
    fi
}
componentps(){
    if [ "\$(pgrep \${1} | wc -l)" = "0" ]; then
        if [ "\$4" = "enable" ]; then
            twistlog "\${2} Service is Stoped" "\$3" "31"
            return 1
        else
            twistlog "\${2} Service is Disabled" "\$3" "33"
            return 2
        fi
    else
        twistlog "\${2} Service is Running" "\$3" "32"
        return 0
    fi
}
echostatus(){
    if [ "\$2" = "Starting" ]; then
        statusa="Success" && statusb="Failed"
        colora="32" && colorb="31"
    else
        statusa="Failed" && statusb="Success"
        colora="31" && colorb="32"
    fi
    if [ "\$1" = "0" ]; then
        twistlog "\${2} \${3} Service \${statusa}" "echo" "\${colora}"
    else
        twistlog "\${2} \${3} Service \${statusb}" "echo" "\${colorb}"
    fi
}
twist_status(){
    twistlog "[TWIST Checking Server Status]" "echo" "34"
    ssserverstatus "echo"
    componentps "fail2ban" "Fail2ban Protect" "echo" "enable"
    componentps "$webservername" "Fake Web Redirect" "echo" "$FWS"
    if [ "\$(lsmod | grep bbr)" = "" ]; then
        twistlog "TCP BBR Support is Disabled" "echo" "33"
    else
        twistlog "TCP BBR Support is Enabled" "echo" "32"
    fi
}
twist_start(){
    twistlog "[TWIST Starting Server Service]" "echo" "34"
    ssserverstatus
    if [ "\$?" = "0" ]; then
       twistlog "Shadowsocks-libev Service is Already Running" "echo" "32"
        status="0"
    else
        ${ssserverpath} -uv -c /etc/shadowsocks-libev/config.json -f /var/run/shadowsocks-libev.pid
        [ -e /etc/twist/twistprotect ] || echo -e "# \${date} [Shadowsocks Protect Services Enabled] " >> /etc/twist/twistprotect
        ssserverstatus
        echostatus "\$?" "Starting" "Shadowsocks-libev"
    fi
    componentps "fail2ban" "Fail2ban Protect" "hide" "enable"
    if [ "\$?" = "0" ]; then
        twistlog "Fail2ban Protect Service is Already Running" "echo" "32"
    else
        systemctl start fail2ban
        componentps "fail2ban" "Fail2ban Protect" "hide" "enable"
        echostatus "\$?" "Starting" "Fail2ban Protect"
    fi
    componentps "$webservername" "Fake Web Redirect" "hide" "$FWS"
    case "\$?" in
        0)
            twistlog "Fake Web Redirect Service is Already Running" "echo" "32"
            ;;
        1)
            systemctl start ${webservername}
            componentps "$webservername" "Fake Web Redirect" "hide" "$FWS"
            echostatus "\$?" "Starting" "Fake Web Redirect"
            ;;
        2)
            componentps "$webservername" "Fake Web Redirect" "echo" "disabled"
            ;;
    esac
}
twist_stop(){
    twistlog "[TWIST Stopping Server Service]" "echo" "34"
    ssserverstatus
    if [ "\$?" = "0" ]; then
        [ -e /etc/twist/twistprotect ] && { echo -e "# \${date} [Shadowsocks Protect Services Disabled] " >> /var/log/twist; rm -f /etc/twist/twistprotect; }
        kill -9 \$pid
        rm -f /var/run/shadowsocks-libev.pid
        [ -e /etc/systemd/system/shadowsocks-libev.service ] && systemctl stop shadowsocks-libev
        ssserverstatus
        echostatus "\$?" "Stopping" "Shadowsocks-libev"
    else
        twistlog "Shadowsocks-libev is Already Stopped" "echo" "31"
        status="0"
    fi
    componentps "fail2ban" "Fail2ban Protect" "hide" "enable"
    if [ "\$?" = "0" ]; then
        systemctl stop fail2ban
        componentps "fail2ban" "Fail2ban Protect" "hide" "enable"
        echostatus "\$?" "Stopping" "Fail2ban Protect"
    else
        twistlog "Fail2ban Protect Service is Already Stopped" "echo" "31"
    fi
    componentps "$webservername" "Fake Web Redirect" "hide" "$FWS"
    case "\$?" in
        0)
            systemctl stop ${webservername}
            componentps "$webservername" "Fake Web Redirect" "hide" "$FWS"
            echostatus "\$?" "Stopping" "Fake Web Redirect"
            ;;
        1)
            twistlog "Fake Web Redirect Service is Already Stopped" "echo" "31"
            ;;
        2)
            componentps "$webservername" "Fake Web Redirect" "echo" "disabled"
            ;;
    esac
}
twist_restart(){
    twistlog "[TWIST Restarting Server Service]" "echo" "34"
    twistlog "Twist Trying to Restart Service" "echo" "32"
    /usr/bin/twist stop
    sleep 2
    /usr/bin/twist start
}
twist_custom(){
    twistlog "[TWIST Loading Shadowsocks Configurator]" "echo" "34"
    sleep 2
    nano /etc/shadowsocks-libev/config.json
    /usr/bin/twist restart
}
twist_do(){
    twistlog "[TWIST Preparing \${2}]" "echo" "34"
    sleep 2
    cd /tmp
    wget -t 3 -T 30 -nv -O "twist.sh" "https://raw.githubusercontent.com/Unbinilium/Twist/master/twist" && { chmod -x twist.sh; bash twist.sh \${1}; }
    if [ "\$?" = "0" ]; then
        status="0"
    else
        status="1"
    fi
}
case "\$1" in
    status|start|stop|restart|custom)
        twist_\${1}
        ;;
    update)
        twist_do "update" "Update"
        ;;
    uninstall)
        twist_do "uninstall" "Uninstall"
        ;;
    *)
        if [ -z "$1" ]; then
            twist_status
        else
            echo "Usage: \$0 { status | start | stop | restart | custom | update | uninstall }"
            status="0"
        fi
        ;;
esac
exit \$status
EOF
    cat > /root/twistprotect <<-EOF
#!/bin/bash
date="\$(date +%Y-%m-%d-%H:%M:%S)"
echo -e "# [\033[34;1mTWIST Shadowsocks-libev Service Protect Services\033[0m]"
twistlog(){
    [ -e /var/log/twist ] || touch /var/log/twist
    echo "# \${date} \${1} " >> /var/log/twist
}
twistprotect(){
    echo -e "# \033[32;1mTWIST Shadowsocks Protect Services Enabled \033[0m"
    if [ "\$(ps -ef | grep -v grep | grep -i "${ssserverpath}" | awk '{print \$2}')" = "" ]; then
        echo -e "# \033[31;1mShadowsocks-libev Service Stopped Detected \033[0m"
        twistlog "Shadowsocks-libev Service Stopped Detected"
        /usr/bin/twist restart
        if [ "\$(ps -ef | grep -v grep | grep -i "${ssserverpath}" | awk '{print \$2}')" = "" ]; then
            twistlog "Shadowsocks-libev Service Restart Failed"
            twistlog "[Shadowsocks Protect Services Disabled Due To Error]"
            rm -f /etc/twist/twistprotect
        else
            twistlog "Shadowsocks-libev Service Restart Success"
        fi
    else
        echo -e "# \033[32;1mShadowsocks-libev Service Running Detected \033[0m"
    fi
}
if [ -e /etc/twist/twistprotect ]; then
    twistprotect
else
    echo -e "# \033[31;1mTWIST Shadowsocks Protect Services Disabled \033[0m"
fi
EOF
    chmod +x /etc/network/if-pre-up.d/iptablesload /etc/network/if-pre-up.d/ip6tablesload /etc/rc.local /usr/bin/twist /root/twistprotect
    chmod 600 /etc/shadowsocks-libev/config.json
    systemctl enable iptables fail2ban cron
    systemctl restart iptables fail2ban cron
    iptables-restore < /etc/iptables.rules
    ip6tables-restore < /etc/ip6tables.rules
    sysctl -p
    ldconfig
    if [ "$FWS" = "enable" ]; then
        timemachine "backup" "/var/www/html/.htaccess" "/etc/twist/.htaccess"
        timemachine "backup" "/var/www/html/index.html" "/etc/twist/index.html"
        cat > /var/www/html/.htaccess <<-EOF
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*) http://${OBFSHOST}/\$1 [R=301,L]
</IfModule>
EOF
        cat > /var/www/html/index.html <<-EOF
<head><meta http-equiv="refresh" content="0;url=http://${OBFSHOST}"></head>
EOF
        systemctl restart ${webservername}
    fi
    twistlog "[TWIST Installed]"
    sleep 3
    echo ""
    twist start
    sleep 3
    timemachine "backup" "/etc/crontab" "/etc/twist/crontab"
    [ -e /etc/crontab ] || touch /etc/crontab
    echo "*/1 * * * * root bash /root/twistprotect" >> /etc/crontab
    sleep 2
}

function servicesstatus(){
    clear
    twistprint
    echo -e "                            [\033[32;1mInstall Complete\033[0m]"
    echo -e "        [\033[32;1mPlease Press Enter to Show Connect Infomation and EXIT\033[0m]"
    twistprint banner
    read -p ""
    echo "ss://$(echo -n "${METHOD}:${PASSWORD}@${PUBLICIP}:${PORT}?plugin=obfs-local;obfs-host=${OBFSHOST};obfs-uri=${OBFSURI};obfs=${OBFS}#Twist" | base64 -w 0)" | qr
    echo -e "# [\033[32;1mss://\033[0m\033[34;1m$(echo -n "${METHOD}:${PASSWORD}@${PUBLICIP}:${PORT}?plugin=obfs-local;obfs-host=${OBFSHOST};obfs-uri=${OBFSURI};obfs=${OBFS}#Twist" | base64 -w 0)\033[0m]"
    echo -e "# [\033[32;1mServer IP:\033[0m \033[34;1m${PUBLICIP}\033[0m\c"
    [ ! "$IPV6ENABLE" = "false" ] && echo -e "(\033[34;1m${PUBLICIPv6}\033[0m)\c"
    echo -e " \033[32;1mPassWord:\033[0m \033[34;1m${PASSWORD}\033[0m \033[32;1mEncryption:\033[0m \033[34;1m${METHOD}\033[0m \033[32;1mOBFS:\033[0m \033[34;1m${OBFS}\033[0m \033[32;1mOBFS-HOST:\033[0m \033[34;1m${OBFSHOST}\033[0m \033[32;1mOBFS-URI:\033[0m \033[34;1m${OBFSURI}\033[0m]"
    serverrestart "Installation"
}

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
date="$(date +%Y-%m-%d-%H:%M:%S)"
[ -d /tmp ] || mkdir /tmp
cd /tmp

case "$1" in
    install|update|uninstall)
        ${1}_twist
        exit 0
        ;;
    *)
        if [ -z "$1" ]; then
            install_twist
        else
            echo "Usage: $0 { install | update | uninstall }"
            exit 1
        fi
        ;;
esac


[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/terminus-build-tools-plugin/master/assets/images/visit-site-36.png)](https://ci-1128-cgsiweb.pantheonsite.io/)

Created multidev environment [ci-1128](https://dashboard.pantheon.io/sites/806fd996-4d92-45f6-a74e-dc88955a747a#ci-1128) for cgsiweb.


Ah! ahora entendí lo que me querías decir! Si, totalmente, lo voy a reagrupar asi, no habia entendido bien a que te referías. Los componentes los agrupe asi porque me parecio que habia muchos componentes tirados en la carpeta components, pero sigo la lógica de los demas y los meto a todos directamente en la carpeta components.


Successfully deployed to following URLs:

* https://now-1v5iy2djz.now.sh
* https://now-rho-two.now.sh
* https://api-frameworks.zeit.sh
* https://now.zeit.now.sh
* https://now-git-master.zeit.now.sh


Successfully deployed to following URLs:

* https://anywherefitnessfrontend-kuc2b09ed.now.sh
* https://anywherefitnessfrontend.now.sh
* https://anywherefitnessfrontend.dmilano857.now.sh
* https://anywherefitnessfrontend-git-master.dmilano857.now.sh


Successfully deployed to following URLs:

* https://image-tester-dbjw61yzu.now.sh
* https://image-tester.now.sh
* https://image-tester.gsylvest.now.sh
* https://image-tester-git-master.gsylvest.now.sh


Successfully deployed to following URLs:

* https://client-gbdt0z0hi.now.sh
* https://career-debut.now.sh
* https://client.career-launchpad.now.sh
* https://client-git-master.career-launchpad.now.sh


![Difference between blocks](https://raw.githubusercontent.com/2ndclemens/pergamon-arcade/d42ceb1ac07028a9d7177f3e0fe4a1dbd807688f/.github/makecode/blocksdiff.png)


WHy


Successfully deployed to following URLs:

* https://formik-docs-5a5qtjfp5.now.sh
* https://formik-docs.now.sh
* https://formik-docs.jared.now.sh
* https://formik-docs-git-master.jared.now.sh


are we here to suffer, do you like my story?


Failed to assign a domain to your deployment due to the following error:

~~~
The domain ibrahimcesar.com is not verfied and cannot be used as an alias.
~~~

([Learn more](https://zeit.co/ibrahimcesar/ibrahimcesardev/pprx9t4fx) or [visit](https://ibrahimcesardev-pprx9t4fx.now.sh) the non-aliased deployment)


are these mapped exactly to V2?


don't reset the head every time, or you can't use the linked list again. It will lose all its data. Make a new variable to traverse again.


Successfully deployed to following URLs:

* https://zacharyweissgithubio-n95e4rf75.now.sh
* https://zachary.ws
* https://zacharyweissgithubio.zacharyws.now.sh
* https://zacharyweissgithubio-git-master.zacharyws.now.sh


Found spelling mistakes in documentation file ANNMODPP.md<<
 annfunc feedforward annfunc ANNfunc ANNfunc ANNfunc ANNfunc
 Found spelling mistakes in documentation file GlossaryPP.md<<
 ANNMOD Multithermal multibaric
 Found spelling mistakes in documentation file ModulesPP.md<<
 annfunc
 Found spelling mistakes in documentation file VESPP.md<<
 Multithermal multibaric
 Found spelling mistakes in documentation file automatic/amber18.txt<<
 pmemd pmemd pmemd
 Found spelling mistakes in documentation file automatic/ANN.txt<<
 annfunc annfunc feedforward ann ann th
 Found spelling mistakes in documentation file automatic/MAZE_MEMETIC_SAMPLING.txt<<
 memetics
 Found spelling mistakes in documentation file automatic/MAZE_OPTIMIZER_BIAS.txt<<
 Rescaled
 Found spelling mistakes in documentation file automatic/MAZE_RANDOM_ACCELERATION_MD.txt<<
 acceleratiob
 Found spelling mistakes in documentation file automatic/MOLINFO.txt<<
 subprocess subprocess ok ok
 Found spelling mistakes in documentation file automatic/REWEIGHT_TEMP_PRESS.txt<<
 isothermal mathcal mathcal mathcal isothermal mathcal mathcal isothermal NP'T mathcal mathcal isothermal NP'T mathcal mathcal mathcal postprocess postprocess
 Found spelling mistakes in documentation file automatic/TD_MULTICANONICAL.txt<<
 multicanonical TRESHOLD smooting multicanonical multicanonical
 Found spelling mistakes in documentation file automatic/TD_MULTITHERMAL_MULTIBARIC.txt<<
 Multithermal multibaric multithermal multibaric barostat rigurously multicanonical mathcal mathcal TP multicanonical barostat smooting multithermal multibaric multithermal multibaric fcc GPa fcc
 Found spelling mistakes in documentation file automatic/VES_DELTA_F.txt<<
 AdaGrad rescale STRIDEs rescaled indipendent MetaD oufile fesA fesA
 Found spelling mistakes in documentation file ../CHANGES/v2.6.md<<
 sidechain PMEMD Viktor Drobot previosly ADDEXP removerd
 Found spelling mistakes in documentation file tutorials/aaa-master-ISDD-1.txt<<
 ISDD handson
 Found spelling mistakes in documentation file tutorials/aaa-master-ISDD-2.txt<<
 ISDD handson ISDD ISDD


Successfully deployed to following URLs:

* https://goal-tracker-3h302l428.now.sh
* https://goal-tracker.now.sh
* https://goal-chart.now.sh
* https://goal-tracker.joshcollinsworth.now.sh
* https://goal-tracker-git-master.joshcollinsworth.now.sh


Successfully deployed to following URLs:

* https://visasite-1brep4t27.now.sh
* https://visasite-six-umber.now.sh
* https://visasite.tech
* https://visasite.bengrunfeld.now.sh
* https://visasite-git-master.bengrunfeld.now.sh


Issue7187 (dareumnam) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (11 of 11 tests passed, 0 test warnings)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.png)


Successfully deployed to following URLs:

* https://are-you-testing-your-observability-q4nusmjh8.now.sh
* https://are-you-testing-your-observability.now.sh
* https://are-you-testing-your-observability.kakkoyun.now.sh
* https://are-you-testing-your-observability-git-master.kakkoyun.now.sh


Successfully deployed to following URLs:

* https://osde8info-canwego-zeit-m5ilfmw6x.now.sh
* https://osde8info-canwego-zeit.now.sh
* https://where.canwego.today
* https://osde8info-canwego-zeit.osde8info.now.sh
* https://osde8info-canwego-zeit-git-master.osde8info.now.sh


TeamCity Bvcms / Build [Build 3399](https://builds.tpsdb.com/viewLog.html?buildId=11322&buildTypeId=Bvcms_Build) outcome was **SUCCESS**
Summary: Tests passed: 224 Build time: 00:26:19


TeamCity Bvcms / Build [Build 3400](https://builds.tpsdb.com/viewLog.html?buildId=11323&buildTypeId=Bvcms_Build) is now running


das ist cool.
![Ann](https://www.radcortez.com/wp-content/uploads/2014/12/annotations-everywhere.jpg)

Ersetzt das manuelle starten einer MongoDB wie wirs in https://github.com/bendsoft/MultitrackRecorderServer noch tun mussten :)


Failed to assign a domain to your deployment due to the following error:

~~~
The domain ebenezerbaptistjc.org couldn't be found.
~~~

([Learn more](https://zeit.co/roblindsey/ebenezerbaptistjcorg/bp4jd10i7) or [visit](https://ebenezerbaptistjcorg-bp4jd10i7.now.sh) the non-aliased deployment)


Successfully deployed to following URLs:

* https://wiki-q6q3mrkte.now.sh
* https://wiki-nine-liart.now.sh
* https://wiki.gndclouds.cc
* https://wiki.gndclouds.now.sh
* https://wiki-git-master.gndclouds.now.sh


Successfully deployed to following URLs:

* https://tejaskumarcom-orz1d91me.now.sh
* https://tejaskumar.com
* https://www.tejaskumar.com
* https://xn--pn8hl7g.ws
* https://tejaskumarcom.tejask.now.sh
* https://tejaskumarcom-git-master.tejask.now.sh


Successfully deployed to following URLs:

* https://website-n2abe0q7m.now.sh
* https://website.undataforum.now.sh
* https://website-git-master.undataforum.now.sh


`console.log()` should be removed 🤦♂


EIR_AWHP (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2612 of 2612 tests passed, 0 test warnings)

![Build Badge](http://img.shields.io/badge/build%20status-passing-green.png) ![Test Badge](http://img.shields.io/badge/tests%20passed-100.0%25-green.png)


fast-forwarding master to auto = abc52a31


❌ [Build was (probably) aborted](https://jenkins.internalx.com/job/macios/job/test-device-error/1/display/redirect)

🔥 [Jenkins job](https://jenkins.internalx.com/job/macios/job/test-device-error/1/display/redirect) (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.15', Running XM tests on '10.15'' 🔥

✅ [Build succeeded](https://jenkins.internalx.com/job/macios/job/test-device-error/1//console)
✅ Packages:
* [xamarin.ios-13.15.1.65.pkg (Not notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/package/xamarin.ios-13.15.1.65.pkg)
* [xamarin.mac-6.15.1.65.pkg (Not notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/package/xamarin.mac-6.15.1.65.pkg)
* [xamarin.ios-13.15.1.65.pkg (Notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/package/notarized/xamarin.ios-13.15.1.65.pkg)
* [xamarin.mac-6.15.1.65.pkg (Notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/package/notarized/xamarin.mac-6.15.1.65.pkg)

✅ [API Diff (from stable)](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/jenkins-results/api-diff/index.html)
✅ [API Diff (from PR only)](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/jenkins-results/apicomparison/api-diff.html) (no change)
✅ [Generator Diff](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/jenkins-results/generator-diff/index.html) (no change)
🔥 [Xamarin.Mac tests on 10.15 failed: Xamarin.Mac tests on macOS 10.15 failed (apitest)](https://jenkins.internalx.com/job/macios/job/test-device-error/1/display/redirect) 🔥
🔥 [Test run failed](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/bf1b50dc6bd11f35855f06eae63ae3b5efdd1e1b/1/jenkins-results/tests/index.html) 🔥

# Test results

<details>
<summary>1 tests failed, 177 tests passed.</summary>

## Failed tests

 * monotouch-test/watchOS 32-bits - simulator/Debug: Crashed
</details>


this is dumb because if there is multiple actions in a hook, it will override the results for each action  :/


*basic


I tried copying the icon to `/usr/share/icons/hicolor/128x128/` but that didn't work. I'll give a try on the folder you suggested.


Successfully deployed to following URLs:

* https://nateradebaughreact-datetime-krvvvb2gu.now.sh
* https://nateradebaugh-datetime.now.sh
* https://react-datetime.now.sh
* https://react-datetime.naterad.com
* https://nateradebaugh-react-datetime.nateradebaugh.now.sh
* https://nateradebaugh-react-datetime-git-master.nateradebaugh.now.sh


Successfully deployed to following URLs:

* https://interpride-gm8hzk3ga.now.sh
* https://interpride2020.org
* https://www.interpride2020.org
* https://interpride.oslopride1.now.sh
* https://interpride-git-master.oslopride1.now.sh


@dewyatt Agree, thanks. That's what happens when hurrying.


Successfully deployed to following URLs:

* https://interpride-2knl9p4lx.now.sh
* https://interpride2020.org
* https://www.interpride2020.org
* https://interpride.oslopride1.now.sh
* https://interpride-git-master.oslopride1.now.sh


Sorry, I did not understand the problem.


You are pushing commits at a very fast pace (across the whole organization).
Due to that, we cannot deploy the commit f0a3f5419b55040518f9f7c06c4bf5ae2ae9c0d5.

You can try again later or [upgrade](https://zeit.co/account/plan) your plan.


You are pushing commits at a very fast pace (across the whole organization).
Due to that, we cannot deploy the commit 6f01bbe135315b3684e66e42c8044a8b2e28f08b.

You can try again later or [upgrade](https://zeit.co/account/plan) your plan.


You are pushing commits at a very fast pace (across the whole organization).
Due to that, we cannot deploy the commit 94fa05040d60a30f8a7829207b62f4a187281b23.

You can try again later or [upgrade](https://zeit.co/account/plan) your plan.


Created multidev environment [dpworkshop#pr-30](https://dashboard.pantheon.io/sites/154fb06c-ec2e-4aca-bdaa-64d2d054b4f8#pr-30).

[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://pr-30-dpworkshop.pantheonsite.io/)


#84 #86 #87 #82 #85


Ok, thanks. I haven't seen the graphics weirdness since so I guess it was "just one of those things".


Successfully deployed to following URLs:

* https://goal-tracker-2bcfpeyk1.now.sh
* https://goal-tracker.now.sh
* https://goal-chart.now.sh
* https://goal-tracker.joshcollinsworth.now.sh
* https://goal-tracker-git-master.joshcollinsworth.now.sh


Deployment failed with the following error:

~~~
You defined 1 build that did not match any source files (please ensure they are NOT defined in .nowignore):
~~~


TeamCity MAS / MAS [Build 1.1.0.524](https://teamcity.nice.org.uk/viewLog.html?buildId=64243&buildTypeId=Mas_Mas) outcome was **FAILURE**
Summary: Artifacts size 166 KB is 95% different from 3.1 MB in build #1.1.0.510-MAS-150-WeeklyEmailN; exit code 1 (Step: Set build number (Command Line)) (new) Build time: 00:00:15


Successfully deployed to following URLs:

* https://github-e2e-tests-dev-alias-v2-without-alias-k2ik63coi.now.sh
* https://github-e2e-tests-dev-alias-v2-without-alias.zeit-github-test-dev1.now.sh
* https://github-e2e-tests-dev-alias-v2-without-alias-git-master.zeit-github-test-dev1.now.sh


Successfully deployed to following URLs:

* https://ccc-fhg67vumr.now.sh
* https://ccc.zeit-github-test-dev1.now.sh
* https://ccc-git-master.zeit-github-test-dev1.now.sh


Successfully deployed to following URLs:

* https://github-e2e-tests-dev-alias-v2-with-alias-h194nxpge.now.sh
* https://z-github-e2e-tests-dev-alias-v2-with-alias.now.sh
* https://github-e2e-tests-dev-alias-v2-with-alias.zeit-github-test-dev1.now.sh
* https://github-e2e-tests-dev-alias-v2-with-alias-git-master.zeit-github-test-dev1.now.sh


Successfully deployed to following URLs:

* https://github-e2e-tests-dev-alias-v1-with-alias-htfmhjeanj.now.sh
* https://z-github-e2e-tests-dev-only.now.sh


Failed to assign a domain to your deployment due to the following error:

~~~
The domain fg0hacdkwz.com is not verfied and cannot be used as an alias.
~~~

([Learn more](http://localhost:3000/zeit-github-test-dev/github-e2e-test-dev-domain-issues/i3tw4ljzw) or [visit](https://github-e2e-test-dev-domain-issues-i3tw4ljzw.now.sh) the non-aliased deployment)


we probably want to fuzz the "name of package pin" ⇔ "macrocell / fb" mapping


Now that you mention it, the function always calls those addresses, therefore I think I can remove the addr0 and addr1, thanks for the observation ;)


Why are we removing the d936x_skip_ext_refclk variable?
Please see here:
https://wiki.analog.com/university/tools/pluto/devs/booting#device_tree_patching

During factory calibration the onboard TCXO reference frequency is measured and the actual reference clock frequency is stored in an additional protected SPI environment which is imported during boot. Later on this value is used to patch the device tree property clock-frequency in the /clocks/clock@0 path. This step can be skipped by the user when setting the ad936x_skip_ext_refclk variable. This allows for custom reference clock frequency set in the regular device tree.


TeamCity MAS / MAS [Build 1.1.0.525-MAS-150-WeeklyEmailN](https://teamcity.nice.org.uk/viewLog.html?buildId=64244&buildTypeId=Mas_Mas) outcome was **FAILURE**
Summary: Tests passed: 12; artifacts size 179.6 KB is 94% different from 3.1 MB in build #1.1.0.510-MAS-150-WeeklyEmailN; exit code 255 (Step: Prepare Lambda Package (Command Line)) (new) Build time: 00:00:54


You are pushing commits at a very fast pace (across the whole organization).
Due to that, we cannot deploy the commit b748b24065d6910c7acf09fa0bef3dc2f28193c4.

You can try again later or [upgrade](https://zeit.co/account/plan) your plan.


this is a new field in V2, we'll need to think on this one.


IBM Cloud [toolchain](https://cloud.ibm.com/devops/toolchains/68c745ec-b599-43cd-beb6-32dd006563c4?env_id=ibm%3Ayp%3Aus-south "kube-toolchain-20200115213407770"): [Delivery Pipeline](https://cloud.ibm.com/devops/pipelines/5a0930d3-d003-4b37-80da-bd975813f08b "hello-containers-20200115213407770") deployed [guestbook](https://github.com/dokun1/guestbook/releases/tag/deploy-visa-workshop-cluster29-20200115-223118 "deploy-visa-workshop-cluster29-20200115-223118") to [visa-workshop-cluster29](https://console.bluemix.net/kubernetes/clusters/boea05rw0l2c7kfmm0eg/overview "There was a problem retrieving the space name"), including this commit


Successfully deployed to following URLs:

* https://header-in-nextjs-lkbk2202a.now.sh
* https://header-in-nextjs.jbentley10.now.sh
* https://header-in-nextjs-git-master.jbentley10.now.sh


Successfully deployed to following URLs:

* https://davidbaileycodes-kv2l40bcf.now.sh
* https://davidbailey.codes
* https://www.davidbailey.codes
* https://baileyis.cool
* https://www.baileyis.cool
* https://davidbaileycodes.davidbailey.now.sh
* https://davidbaileycodes-git-master.davidbailey.now.sh


IBM Cloud [toolchain](https://cloud.ibm.com/devops/toolchains/2c490177-ac73-405e-bdaf-569a23827633?env_id=ibm%3Ayp%3Aus-south "kube-toolchain-20200115213330974"): [Delivery Pipeline](https://cloud.ibm.com/devops/pipelines/c27baa14-a151-4a51-88cd-bd39f6811e41 "hello-containers-20200115213330974") deployed [guestbook](https://github.com/emiliocampa-hoyos/guestbook/releases/tag/deploy-visa-workshop-cluster13-20200115-223137 "deploy-visa-workshop-cluster13-20200115-223137") to [visa-workshop-cluster13](https://console.bluemix.net/kubernetes/clusters/boe9uupw0m5258nmm0a0/overview "There was a problem retrieving the space name"), including this commit


Build optimizer uses an independent and fully encapsulated version of typescript.  The project’s TypeScript version does not need to match the build optimizer’s version.


❌ [Build was (probably) aborted](https://jenkins.internalx.com/job/macios/job/test-device-error/8/display/redirect)

🔥 [Jenkins job](https://jenkins.internalx.com/job/macios/job/test-device-error/8/display/redirect) (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.15', Running XM tests on '10.15'' 🔥

✅ [Build succeeded](https://jenkins.internalx.com/job/macios/job/test-device-error/8//console)
✅ Packages:
* [xamarin.ios-13.15.1.66.pkg (Not notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/package/xamarin.ios-13.15.1.66.pkg)
* [xamarin.mac-6.15.1.66.pkg (Not notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/package/xamarin.mac-6.15.1.66.pkg)
* [xamarin.ios-13.15.1.66.pkg (Notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/package/notarized/xamarin.ios-13.15.1.66.pkg)
* [xamarin.mac-6.15.1.66.pkg (Notarized)](https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/package/notarized/xamarin.mac-6.15.1.66.pkg)

✅ [API Diff (from stable)](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/jenkins-results/api-diff/index.html)
✅ [API Diff (from PR only)](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/jenkins-results/apicomparison/api-diff.html) (no change)
✅ [Generator Diff](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/jenkins-results/generator-diff/index.html) (no change)
🔥 [Xamarin.Mac tests on 10.15 failed: Xamarin.Mac tests on macOS 10.15 failed (apitest)](https://jenkins.internalx.com/job/macios/job/test-device-error/8/display/redirect) 🔥
🔥 [Test run failed](http://xamarin-storage/jenkins/xamarin-macios/test-device-error/3ad851ede1deafe6f93409794827f9d49de83fcb/8/jenkins-results/tests/index.html) 🔥

# Test results

<details>
<summary>1 tests failed, 177 tests passed.</summary>

## Failed tests

 * monotouch-test/watchOS 32-bits - simulator/Debug: Crashed
</details>


Copy of this build can be found at
https://www.mewbuilds.com/build/12e917f9c694fa015805d162b29b093905b70b21/index.html
                       https://www.cloudflare-ipfs.com/ipfs/QmPcLKcDLHnKnmgr4bsN7bKyhLYAuTqiMg4fdeAT2bKMac
                       Virus Total analysis
                       https://www.virustotal.com/file/8aae2391f88a9cf045e4b74e44fff16c2c4b80aa86e90f0da85eacb92c1bc10d/analysis/1579127545/


Bravo !


Jako, że to lista nazwałabym to w liczbie mnogiej : getLocalization**s**AboveHeating


Congratulations!


How do I use this


Are `list_of` lists exposed to users? For what purpose? It would probably be better not to.


Ah! I see plugin/index.js is listed in sync/base.js after db.js so this is why the commands are defined. Maybe I'll just add a comment to both imports to remind about the order?


Successfully deployed to following URLs:

* https://iiwt-anz1gyxjo.now.sh
* https://iiwt.now.sh
* https://iiwt.bsba.now.sh
* https://iiwt-git-master.bsba.now.sh


In the function of transformSequences, it iterates over the target and query sequences and makes a hash map with distinct symbols as keys and indexes as values. So the size of the IdxType should be as large as the number of distinct symbols in the union of target and query sequences. IdxType has two upper bounds. One is the AlphabetType and the second one is the total length of query and target seqs. (integer seems enough if the length of our sequences is less than 1 M)


When using pkgconfig this should not be necessary anymore - see comment below


Localization -> Rooms


Successfully deployed to following URLs:

* https://quicktips-vue-p96h8h6i8.now.sh
* https://quicktips-vue.now.sh
* https://quicktips-vue.obukhow.now.sh
* https://quicktips-vue-git-master.obukhow.now.sh


Let's get rid of manually set QWT_INCDIR / QWT_LIBDIR and use pkg-config to find qwt locations (qwt does not install cmake-files as far as I know). PkgConfig name should be 'Qt5Qwt6.pc'


@JuliRegistrator register


może nazwiemy to rooms ?


> I thought I could enable instant prompt just by making choice in the wizard.

That works. Wizard adds these extra lines to `${ZDOTDIR:-$HOME}/.zshrc`. I suppose you've removed them manually?

> You're right, instant prompt is VERY AMAZING! It's so fluent, I don't need turbo-mode anymore!

Thanks!

With instant prompt you can load plugins any way you like, be it through zplugin or anything else. Zsh will still give you *instant* prompt when you start it.


Failed to assign a domain to your deployment due to the following error:

~~~
The domain heetch.com couldn't be found.
~~~

([Learn more](https://zeit.co/heetch-eng/flamingo/n9c4utze3) or [visit](https://flamingo-n9c4utze3.now.sh) the non-aliased deployment)


Pourquoi Scapy ?


[gpl-2.0.txt](https://github.com/balena-io/etcher/files/4058358/gpl-2.0.txt)

- [ ] @ #3024
[openssl.txt](https://github.com/balena-io/etcher/files/4058365/openssl.txt)


Sorry man, do you wanna meet today or nah?

Mit freundlichen Grüßen
Kacper Nowochodzki

DEUTSCHE TELEKOM SERVICES EUROPE
Dualer Student Wirtschaftsinformatik
Finance control system
CPC
Kacper Nowochodzki
Überseering 2, 22297 Hamburg

+49 016097969889 (Mobil)
E-Mail: Kacper.Nowochodzki@telekom.de
www.telekom.com
dtse.telekom.de

ERLEBEN, WAS VERBINDET.

DEUTSCHE TELEKOM SERVICES EUROPE SE
Aufsichtsrat: Christian P. Illek (Vorsitzender)
Geschäftsführung: Dr. Guillaume Maisondieu (Vorstandsvorsitzender), Thomas Laux, Petra Mailänder
Handelsregister: Amtsgericht Bonn HRB 24675
Sitz der Gesellschaft: Bonn
USt-IdNr. DE 244811847

Die gesetzlichen Pflichtangaben finden Sie unter:
www.telekom.com/pflichtangaben

GROSSE VERÄNDERUNGEN FANGEN KLEIN AN –
RESSOURCEN SCHONEN UND NICHT JEDE E-MAIL DRUCKEN.

-----Ursprüngliche Nachricht-----
Von: Red-Pi <notifications@github.com>
Gesendet: Dienstag, 14. Januar 2020 08:37
An: Red-Pi/KDC-Base <KDC-Base@noreply.github.com>
Cc: Nowochodzki, Kacper <Kacper.Nowochodzki@telekom.de>; Mention <mention@noreply.github.com>
Betreff: [Red-Pi/KDC-Base] Fixed small mistake in room.cpp (79b8b9a)

Fixed small mistake in room.cpp

@Kapejko maybe test your code before commiting :D

--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/Red-Pi/KDC-Base/commit/79b8b9acd54a8e9ac9e23d8960c3a09872b38f34


Successfully deployed to following URLs:

* https://james-grantham-91qs9h9xn.now.sh
* https://james-grantham.now.sh
* https://jamesgrantham.me
* https://james-grantham.jamesrgrantham.now.sh
* https://james-grantham-git-master.jamesrgrantham.now.sh


这个是py...？


./scripts/feeds clean
./scripts/feeds update -a
./scripts/feeds install -a


Successfully deployed to following URLs:

* https://snakejs-as68su4y6.now.sh
* https://snakejs.now.sh
* https://snake.wouterr.com
* https://snakejs.wouterr.now.sh
* https://snakejs-git-master.wouterr.now.sh


Successfully deployed to following URLs:

* https://beam-invoice-1sq10ijmh.now.sh
* https://beam-invoice.now.sh
* https://beam-invoice.clementdlc.now.sh
* https://beam-invoice-git-master.clementdlc.now.sh


Remove this @Setter annotation or method below.


# Specs execution successful
:scroll: [View logs](http://bamboo.comnull)
### Plans updated

Bamboo specs have been successfully imported and the following plans have been updated.

Project | Plan | Build
---|---|---
[Test](http://bamboo.com/browse/TEST) | [Comment test](http://bamboo.com/browse/TEST-CTEST)  | :white_check_mark: [\#1](http://bamboo.com/browse/TEST-CTEST-1)
[New project](http://bamboo.com/browse/NEW) | [Disabled plan](http://bamboo.com/browse/NEW-DISABLED) **disabled** | :white_check_mark: [\#1](http://bamboo.com/browse/NEW-DISABLED-1)

### Deployments updated

Bamboo specs have been successfully imported and the following deployment projects have been updated.

|Deployment project |
----|
[Deployment test](http://bamboo.com/deploy/viewDeploymentProjectVersions.action?id=2162689)|


Have link to Publications


Successfully deployed to following URLs:

* https://excalidraw-157c1lopr.now.sh
* https://excalidraw.now.sh
* https://excalidraw.vjeux.now.sh
* https://excalidraw-git-master.vjeux.now.sh


Oops, guess I'll drop it again here then.


Related to: backdrop/backdrop-issues#4145


Deployment failed with the following error:

~~~
Schema verification failed
~~~


Successfully deployed to following URLs:

* https://javascript-slides-fix7xdsox.now.sh
* https://javascript.jackleslie.dev
* https://javascript-slides.jackleslie.now.sh
* https://javascript-slides-git-master.jackleslie.now.sh


super, could we get a new release with this fix? having a hard time installing from bleeding edge through github-urls in package.json with this monorepo.


This checks that the certificate "has a private key", but is missing "accessible" part.


[R/ABC_SMC.R:11:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L11) *style:* **Lines should not be more than 80 characters.**
```r
# @param    current                 vector       Current parameter combination for which we are determining the weight
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:12:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L12) *style:* **Lines should not be more than 80 characters.**
```r
# @param    sigma                   scalar       standard deviation of the perturbation
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:13:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L13) *style:* **Lines should not be more than 80 characters.**
```r
# @param    prior_density_function  function     Function to calculate the prior probability of a set of parameters
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:36:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L36) *style:* **Lines should not be more than 80 characters.**
```r
# @brief apply the ABC routine used in our Methods in Ecology and Evolution Paper
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:43:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L43) *style:* **Lines should not be more than 80 characters.**
```r
# @param    statistics                    vector      A vector containing functions that take a tree as an argument and return a single scalar value (the statistic).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:44:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L44) *style:* **Lines should not be more than 80 characters.**
```r
# @param    simulation_function           vector      A function that implements the diversification model and returns an object of class phylo
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:45:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L45) *style:* **Lines should not be more than 80 characters.**
```r
# @param    init_epsilon_values           vector      A vector containing the initial threshold values for the summary statistics from the vector statistics.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:46:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L46) *style:* **Lines should not be more than 80 characters.**
```r
# @param    prior_generating_function     function    Function to generate parameters from the prior distribution of these parameters (e.g. a function returning lambda and mu in case of the birth-death model)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:47:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L47) *style:* **Lines should not be more than 80 characters.**
```r
# @param    prior_density_function        function    Function to calculate the prior probability of a set of parameters (should match prior_generating_function in shape)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:48:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L48) *style:* **Lines should not be more than 80 characters.**
```r
# @param    number_of_particles           scalar      Number of particles to be used per iteration of the ABC-SMC algorithm.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:49:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L49) *style:* **Lines should not be more than 80 characters.**
```r
# @param    sigma                         scalar      Standard deviation of the perturbance distribution (perturbance distribution is a gaussian with mean 0).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:50:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L50) *style:* **Lines should not be more than 80 characters.**
```r
# @param    stop_rate                     scalar      If the acceptance rate drops below \code{stopRate}, stop the ABC-SMC algorithm  and assume convergence.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:51:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L51) *style:* **Lines should not be more than 80 characters.**
```r
# @return                                 matrix      A matrix with n columns, where n is the number of parameters you are trying to estimate.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:75:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L75) *style:* **Lines should not be more than 80 characters.**
```r
#'   from the prior distribution of these parameters (e.g. a function returning lambda and mu in case of the birth-death model)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:126:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L126) *style:* **functions should have cyclomatic complexity of less than 15, this has 42.**
```r
abc_smc_nltt <- function(tree,
^
```
[R/ABC_SMC.R:276:13:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L276) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
        if ( (number_accepted / tried) < stop_rate) {
            ^
```
[R/ABC_SMC.R:301:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L301) *style:* **Lines should not be more than 80 characters.**
```r
# @brief Estimate the likelihood of a given tree, provided a likelihood function, using a Monte Carlo Markov Chain
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:308:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L308) *style:* **Lines should not be more than 80 characters.**
```r
# @param    likelihood_function   function    Function that calculates the likelihood of our diversification model, given the tree.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:309:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L309) *style:* **Lines should not be more than 80 characters.**
```r
#                                             function should be of the format function(parameters, phy).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:310:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L310) *style:* **Lines should not be more than 80 characters.**
```r
# @param    parameters            vector      Initial parameters to start the chain.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:311:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L311) *style:* **Lines should not be more than 80 characters.**
```r
# @param    logtransforms         scalar      Whether to perform jumps on logtransformed parameters (TRUE) or not (FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:313:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L313) *style:* **Lines should not be more than 80 characters.**
```r
# @param    burnin                scalar      Length of the burnin, default is 30% of iterations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:315:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L315) *style:* **Lines should not be more than 80 characters.**
```r
# @param    sigma                 scalar      Standard deviation of the jumping distribution, which is N(0, sigma).
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:316:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L316) *style:* **Lines should not be more than 80 characters.**
```r
# @return                         mcmc        An MCMC object, as used by the package "coda".
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/ABC_SMC.R:320:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/ABC_SMC.R#L320) *style:* **functions should have cyclomatic complexity of less than 15, this has 34.**
```r
mcmc_nltt <- function(phy, likelihood_function,
^
```
[R/get_average_nltt_matrix.R:14:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/get_average_nltt_matrix.R#L14) *style:* **functions should have cyclomatic complexity of less than 15, this has 16.**
```r
get_average_nltt_matrix <- function(
^
```
[R/get_n_lineages.R:17:12:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/get_n_lineages.R#L17) *warning:* **Avoid 1:length(...) expressions, use seq_len.**
```r
    return(1:length(phylogeny$tip.label))
           ^
```
[R/get_norm_brts.R:22:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/get_norm_brts.R#L22) *style:* **Trailing blank lines are superfluous.**
```r

^
```
[R/nltt_diff_exact_extinct.R:27:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L27) *style:* **functions should have cyclomatic complexity of less than 15, this has 23.**
```r
nltt_diff_exact_extinct <- function(
^
```
[R/nltt_diff_exact_extinct.R:50:27:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L50) *style:* **There should be a space between right parenthesis and an opening curly brace.**
```r
  if (time_unit == "since"){
                          ^~
```
[R/nltt_diff_exact_extinct.R:57:25:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L57) *style:* **There should be a space between right parenthesis and an opening curly brace.**
```r
  if (time_unit == "ago"){
                        ^~
```
[R/nltt_diff_exact_extinct.R:82:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L82) *style:* **Lines should not be more than 80 characters.**
```r
    species_number_n <- species_number / max(species_number)  #normalize lineages
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:87:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L87) *style:* **Lines should not be more than 80 characters.**
```r
    event_times2_n <- 1 - event_times2 / min(event_times2) #normalize branching times
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:88:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L88) *style:* **Lines should not be more than 80 characters.**
```r
    species_number2_n <- species_number2 / max(species_number2)  #normalize lineages
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:136:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L136) *style:* **Commented code should be removed.**
```r
  # testit::assert(event_times[1] >= 0.0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:137:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L137) *style:* **Commented code should be removed.**
```r
  # testit::assert(species_number[1] >= 0.0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:138:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L138) *style:* **Commented code should be removed.**
```r
  # testit::assert(event_times2[1] >= 0.0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:139:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L139) *style:* **Commented code should be removed.**
```r
  # testit::assert(species_number[1] >= 0.0)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:141:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L141) *style:* **Commented code should be removed.**
```r
  # testit::assert(all(event_times >= 0.0 & event_times <= 1.0))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:142:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L142) *style:* **Commented code should be removed.**
```r
  # testit::assert(all(species_number >= 0.0 & species_number <= 1.0))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:143:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L143) *style:* **Commented code should be removed.**
```r
  # testit::assert(all(event_times2 >= 0.0 & event_times2 <= 1.0))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:144:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L144) *style:* **Commented code should be removed.**
```r
  # testit::assert(all(species_number >= 0.0 & species_number <= 1.0))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltt_diff_exact_extinct.R:183:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L183) *style:* **Trailing blank lines are superfluous.**
```r

^
```
[R/nltt_diff_exact_extinct.R:184:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L184) *style:* **Trailing blank lines are superfluous.**
```r

^
```
[R/nltt_diff_exact_extinct.R:185:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltt_diff_exact_extinct.R#L185) *style:* **Trailing blank lines are superfluous.**
```r

^
```
[R/nLTTDiff.R:59:27:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L59) *style:* **There should be a space between right parenthesis and an opening curly brace.**
```r
  if (time_unit == "since"){
                          ^~
```
[R/nLTTDiff.R:66:25:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L66) *style:* **There should be a space between right parenthesis and an opening curly brace.**
```r
  if (time_unit == "ago"){
                        ^~
```
[R/nLTTDiff.R:186:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L186) *style:* **Lines should not be more than 80 characters.**
```r
#' Calculates the exact difference between the lineage through time curves of tree1 & tree2 (normalized in time and for the number of lineages)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:274:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L274) *style:* **Lines should not be more than 80 characters.**
```r
# @param    distance_method        string     Method to calculate the difference, either absolute, or squared
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:275:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L275) *style:* **Lines should not be more than 80 characters.**
```r
# @return                          scalar     normalized Lineage-Through-Time difference between tree1 & tree2
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:283:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L283) *style:* **Lines should not be more than 80 characters.**
```r
#' @usage nLTTstat(tree1, tree2, distance_method = "abs", ignore_stem = TRUE, log_transform = FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:344:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L344) *style:* **Lines should not be more than 80 characters.**
```r
# @param    distance_method        string     Method to calculate the difference, either absolute, or squared
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:345:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L345) *style:* **Lines should not be more than 80 characters.**
```r
# @param    ignore_stem            logical    Should the phylogeny its stem be ignored?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nLTTDiff.R:346:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nLTTDiff.R#L346) *style:* **Lines should not be more than 80 characters.**
```r
# @return                          scalar     normalized Lineage-Through-Time difference between tree1 & tree2
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[R/nltts_plot.R:19:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/nltts_plot.R#L19) *style:* **functions should have cyclomatic complexity of less than 15, this has 17.**
```r
nltts_plot <- function(
^
```
[R/plot_nLTT.R:36:23:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/plot_nLTT.R#L36) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
nltt_plot <- function( phy, xlab = "Normalized Time",
                      ^
```
[R/plot_nLTT.R:51:28:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/plot_nLTT.R#L51) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  xy[, 1] <- xy[, 1] + abs( min( xy[, 1])) #make sure time runs from 0..T
                           ^
```
[R/plot_nLTT.R:51:33:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/plot_nLTT.R#L51) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  xy[, 1] <- xy[, 1] + abs( min( xy[, 1])) #make sure time runs from 0..T
                                ^
```
[R/plot_nLTT.R:52:28:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/plot_nLTT.R#L52) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  xy[, 1] <- xy[, 1] / max( xy[, 1])      #normalize time
                           ^
```
[R/plot_nLTT.R:94:32:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/plot_nLTT.R#L94) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  xy[, 1] <- xy[, 1] + abs(min( xy[, 1])) #make sure time runs from 0..T
                               ^
```
[R/stretch_nltt_matrix.R:22:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/R/stretch_nltt_matrix.R#L22) *style:* **functions should have cyclomatic complexity of less than 15, this has 16.**
```r
stretch_nltt_matrix <- function(
^
```
[tests/testthat/test-abc_smc_nltt.R:30:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-abc_smc_nltt.R#L30) *style:* **Commented code should be removed.**
```r
  # suppressWarnings(RNGversion("3.5.0"))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test-abc_smc_nltt.R:35:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-abc_smc_nltt.R#L35) *style:* **Variable and function name style should be snake_case.**
```r
  LL_BD <- function(params, phy) {
  ^~~~~
```
[tests/testthat/test-abc_smc_nltt.R:49:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-abc_smc_nltt.R#L49) *style:* **Variable and function name style should be snake_case.**
```r
  ML <- stats::optimize(f = tofit, interval = c(0, 1))
  ^~
```
[tests/testthat/test-abc_smc_nltt.R:55:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-abc_smc_nltt.R#L55) *style:* **Variable and function name style should be snake_case.**
```r
  A <- abc_smc_nltt(
  ^
```
[tests/testthat/test-get_average_nltt.R:10:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-get_average_nltt.R#L10) *style:* **Commented code should be removed.**
```r
  # suppressWarnings(RNGversion("3.5.0"))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test-get_average_nltt.R:41:5:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-get_average_nltt.R#L41) *style:* **Commented code should be removed.**
```r
  # suppressWarnings(RNGversion("3.5.0"))
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test-mcmc_nltt.R:14:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-mcmc_nltt.R#L14) *style:* **Variable and function name style should be snake_case.**
```r
  LL_BD <- function(params, phy) {
  ^~~~~
```
[tests/testthat/test-mcmc_nltt.R:31:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-mcmc_nltt.R#L31) *style:* **Variable and function name style should be snake_case.**
```r
  ML <- optim(par = c(1, 0.001), fn = tofit)
  ^~
```
[tests/testthat/test-mcmc_nltt.R:58:3:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-mcmc_nltt.R#L58) *style:* **Variable and function name style should be snake_case.**
```r
  LL_BD <- function(params, phy) {
  ^~~~~
```
[tests/testthat/test-nltt_diff_exact_brts.R:40:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_brts.R#L40) *style:* **Lines should not be more than 80 characters.**
```r
    regexp = "branching times must be negative, for example -3 time units since the present"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[tests/testthat/test-nltt_diff_exact_brts.R:66:1:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_brts.R#L66) *style:* **Trailing blank lines are superfluous.**
```r

^
```
[tests/testthat/test-nltt_diff_exact_extinct.R:29:16:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_extinct.R#L29) *warning:* **Avoid 1:length(...) expressions, use seq_len.**
```r
  lineages1 <- 1:length(event_times)
               ^
```
[tests/testthat/test-nltt_diff_exact_extinct.R:30:16:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_extinct.R#L30) *warning:* **Avoid 1:length(...) expressions, use seq_len.**
```r
  lineages2 <- 1:length(event_times2)
               ^
```
[tests/testthat/test-nltt_diff_exact_extinct.R:95:16:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_extinct.R#L95) *warning:* **Avoid 1:length(...) expressions, use seq_len.**
```r
  lineages1 <- 1:length(event_times)
               ^
```
[tests/testthat/test-nltt_diff_exact_extinct.R:96:16:](https://github.com/Neves-P/nLTT/blob/35c74f3205b1b49d0750e572dc45dc370ae9f5cb/tests/testthat/test-nltt_diff_exact_extinct.R#L96) *warning:* **Avoid 1:length(...) expressions, use seq_len.**
```r
  lineages2 <- 1:length(event_times2)
               ^
```


Replace with `csr::CONFIG_CLOCK_FREQUENCY`?


@JuliaRegistrator register


Registration pull request created: [JuliaRegistries/General/7848](https://github.com/JuliaRegistries/General/pull/7848)

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if [Julia TagBot](https://github.com/apps/julia-tagbot) is installed, or can be done manually through the github interface, or via:
```
git tag -a v0.5.2 -m "<description of version>" 49668bb79ac60946c9717d29f0b889636f61e2ba
git push origin v0.5.2
```


Due to remain_bytes assignment before len's update, It doesn't seem to fix the issue,


settling delay between ADPLL write and DDMTD tags?


That fix does not compile in C++11.  I just removed "register" and "auto"


- Error code: 0 - Error Fetching http headers

- NamelessCoder\GizzleGitPlugins\GizzlePlugins\ClonePlugin:000000007367e0be000000006ebdbcdc:
  - 0: Executing Git clone command: /usr/bin/git clone --depth 1 --single-branch --branch 'v9.11.0' 'https://github.com/pixelant/pxa_product_manager.git' /tmp/a1b371926a3c4713bf32a9dede216ec34b4ddab3/pxa_product_manager


Comment on commit : test coverage change since last commit is


Successfully deployed to following URLs:

* https://crawl-g2t7vr174.now.sh
* https://crawl.now.sh
* https://crawl.benarthurstuart.now.sh
* https://crawl-git-master.benarthurstuart.now.sh


Comment on commit 884ddb821b8058787780843bedd7523dd745dafc: test coverage change since last commit is 96.77


@JuliaRegistrator register()


Registration pull request created: [JuliaRegistries/General/7849](https://github.com/JuliaRegistries/General/pull/7849)

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if [Julia TagBot](https://github.com/apps/julia-tagbot) is installed, or can be done manually through the github interface, or via:
```
git tag -a v0.1.1 -m "<description of version>" 4a9f4a33131feac6695042cf35c125f988a5099b
git push origin v0.1.1
```


if we need to update styles coming with libraries, we must import after importing library styles


Successfully deployed to following URLs:

* https://next-site-r68rzr40i.now.sh
* https://next-site-test.now.sh
* https://nextjs.org
* https://www.nextjs.org
* https://next-site.zeit.now.sh
* https://next-site-git-master.zeit.now.sh


Deployment failed with the following error:

~~~
You defined 1 build that did not match any source files (please ensure they are NOT defined in .nowignore):
~~~