<?php

$domain_name = $_SERVER['SERVER_NAME'];

$host_ip = gethostbyname($_SERVER['SERVER_NAME']);
?>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="İzmitUnix.com - Shell Script yazma, kod yazma ve otomatik çalışma sayfası.">
    <meta name="robots" content="noindex, nofollow">
    <title>İzmitUnix Kod Yazma</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism-tomorrow.min.css" rel="stylesheet">
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
        }
        header {
            background-color: #34495e;
            color: white;
            padding: 1rem;
            text-align: center;
            width: 100%;
        }
        main {
            width: 80%;
            max-width: 1000px;
            background-color: white;
            padding: 20px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
        }
        h1, h2 {
            color: #2c3e50;
        }
        .editor-container {
            position: relative;
        }
        textarea {
            width: 100%;
            height: 300px;
            font-family: 'Courier New', monospace;
            font-size: 1rem;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: #f8f9fa;
            resize: none;
            box-sizing: border-box;
        }
        button {
            background-color: #2980b9;
            color: white;
            border: none;
            padding: 12px 24px;
            cursor: pointer;
            margin-top: 10px;
            border-radius: 4px;
            font-size: 16px;
        }
        button:hover {
            background-color: #3498db;
        }
        pre {
            background-color: #2d3436;
            color: #fff;
            padding: 15px;
            border-radius: 4px;
            overflow-x: auto;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        footer {
            text-align: center;
            padding: 10px;
            background-color: #34495e;
            color: white;
            width: 100%;
            margin-top: 20px;
        }
    </style>
</head>
<body>

    <header>
        <h1>İzmitUnix - Shell Script Yazma ve Çalıştırma</h1>
        <p>Shell Scriptlerinizi yazın ve çıktıyı anında görün!</p>
    </header>

    <main>
        <h2>Shell Script Editor</h2>
        <p>Shell kodunu aşağıdaki alana yazın:</p>
        <div class="editor-container">
            <textarea id="code" placeholder="#!/bin/bash&#10;echo 'Merhaba, Unix!'"></textarea>
        </div>
        <button onclick="runCode()">Çalıştır</button>

        <h3>Çıktı:</h3>
        <pre id="output"></pre>
    </main>

    <footer>
        <p>© 2024 İzmitUnix.com | Shell Script Editor</p>
    </footer>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js"></script>
    <script>
        function runCode() {
            const code = document.getElementById('code').value;
            const output = document.getElementById('output');

            
            output.textContent = "Kodunuz başarıyla kaydedildi:\n\n" + code;
        }

        const textarea = document.getElementById('code');
        textarea.addEventListener('input', function() {
            const code = textarea.value;
            const highlightedCode = Prism.highlight(code, Prism.languages.shell, 'shell');
            document.getElementById('output').innerHTML = highlightedCode;
        });
    </script>

</body>
</html>