"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullLinuxTerminal = exports.getServerSideProps = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const icon_1 = require("@cocalc/frontend/components/icon");
const antd_1 = require("antd");
const code_1 = __importDefault(require("components/landing/code"));
const content_1 = __importDefault(require("components/landing/content"));
const footer_1 = __importDefault(require("components/landing/footer"));
const head_1 = __importDefault(require("components/landing/head"));
const header_1 = __importDefault(require("components/landing/header"));
const info_1 = __importDefault(require("components/landing/info"));
const pitch_1 = __importDefault(require("components/landing/pitch"));
const sign_in_1 = __importDefault(require("components/landing/sign-in"));
const snapshots_1 = __importDefault(require("components/landing/snapshots"));
const A_1 = __importDefault(require("components/misc/A"));
const customize_1 = require("lib/customize");
const with_customize_1 = __importDefault(require("lib/with-customize"));
const cocalc_jupyter_bash_png_1 = __importDefault(require("public/features/cocalc-jupyter-bash.png"));
const cocalc_shell_script_run_png_1 = __importDefault(require("public/features/cocalc-shell-script-run.png"));
const cocalc_terminal_collab_gif_1 = __importDefault(require("public/features/cocalc-terminal-collab.gif"));
const linux_logo_svg_1 = __importDefault(require("public/features/linux-logo.svg"));
const terminal_jupyter_postgresql_png_1 = __importDefault(require("public/features/terminal-jupyter-postgresql.png"));
function Linux({ customize }) {
    return ((0, jsx_runtime_1.jsxs)(customize_1.Customize, { value: customize, children: [(0, jsx_runtime_1.jsx)(head_1.default, { title: "Online Linux Environment" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout, { children: [(0, jsx_runtime_1.jsx)(header_1.default, { page: "features", subPage: "linux" }), (0, jsx_runtime_1.jsxs)(antd_1.Layout.Content, { children: [(0, jsx_runtime_1.jsx)("div", { style: { backgroundColor: "#c7d9f5" }, children: (0, jsx_runtime_1.jsx)(content_1.default, { startup: "Linux", logo: linux_logo_svg_1.default, title: "Online Linux Environment", subtitle: "Learn Linux and Bash Scripting without messing up your own computer.", subtitleBelow: true, image: cocalc_shell_script_run_png_1.default, alt: "Running a bash script to count in Linux" }) }), (0, jsx_runtime_1.jsx)(FullLinuxTerminal, {}), (0, jsx_runtime_1.jsx)(sign_in_1.default, { startup: "Linux" }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Realtime collaboration", icon: "users", image: cocalc_terminal_collab_gif_1.default, anchor: "a-real-time", alt: "Video showing using vim collaboratively with chat", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Terminals in CoCalc are represented by files with the extension", " ", (0, jsx_runtime_1.jsx)("code", { children: ".term" }), ". The same terminal can be opened by two or more people simultaneous. Both see the same view, which adaptively resizes to a common size."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Additionally, you can open a", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/chat.html", children: "chat" }), " panel to exchange thoughts and ideas."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This is ideal for getting advice from a colleague or", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/teaching-interactions.html", children: "helping one of your students" }), ".", " "] })] }), (0, jsx_runtime_1.jsx)(info_1.default.Heading, { description: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["The following are some additional specific features of Linux Terminals in CoCalc.", (0, jsx_runtime_1.jsx)("br", {}), "There is also more", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/terminal.html", children: "comprehensive documentation" }), "."] }), children: "Feature Overview" }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Run", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://en.wikipedia.org/wiki/Bash_(Unix_shell)", children: "Bash" }), " ", "scripts"] }), icon: "terminal", image: cocalc_shell_script_run_png_1.default, caption: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Bash ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "script.sh" }), " file (left),", " ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "bash -f script.sh" }), " to run (right)"] }), anchor: "a-shell-script", alt: "Running a bash script to count in Linux", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["CoCalc's", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/frame-editor.html", children: "code editor" }), " ", "supports", " ", (0, jsx_runtime_1.jsxs)("strong", { children: ["editing a", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://www.gnu.org/software/bash/", children: "bash script" }), " ", "side-by-side with a", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/terminal.html", children: "terminal" })] }), "."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["To get started, create a script file ending with ", (0, jsx_runtime_1.jsx)(code_1.default, { children: ".sh" }), ", for example ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "script.sh" }), ". Opening that file presents you an editor with ", (0, jsx_runtime_1.jsx)("strong", { children: "syntax highlighting" }), ". Then click the ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "Shell" }), " button to open up a Terminal and type in", " ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "bash -f script.sh" }), " to run your script."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["This helps you learning Bash by exploring its commands directly in your browser and immediately experiencing the results.", " "] })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Jupyter Bash kernel", image: cocalc_jupyter_bash_png_1.default, icon: "ipynb", anchor: "a-jupyter", alt: "Using Bash via a Jupyter notebook", children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Are you looking for something beyond a terminal or editing shell scripts? CoCalc also offers", " ", (0, jsx_runtime_1.jsxs)("strong", { children: [(0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/jupyter-notebook", children: "Jupyter Notebooks" }), " ", "running the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://github.com/takluyver/bash_kernel", children: "bash kernel" })] }), "."] }), (0, jsx_runtime_1.jsx)("p", { children: "This is similar to working with a terminal, but it saves all the input you typed and the corresponding output in \"cells\". That helps you with learning Linux commands, because it makes it easier to edit the code input or compare different outcomes of similar code. Besides that, you can also take notes between code cells." })] }), (0, jsx_runtime_1.jsxs)(snapshots_1.default, { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["The CoCalc terminal is ideal for", " ", (0, jsx_runtime_1.jsx)("strong", { children: "teaching and learning Linux" }), ", because when you make a mistake, it has your back!"] }), (0, jsx_runtime_1.jsx)("p", { children: "Everything runs remotely on CoCalc's servers. This means you do not have to worry about messing up your own computer, dealing with setup and installation issues yourself, or fear losing or corrupting files on your computer." })] }), (0, jsx_runtime_1.jsxs)(info_1.default, { title: "Databases (PostgreSQL, MySQL, SQLite)", image: terminal_jupyter_postgresql_png_1.default, icon: "database", anchor: "a-database", wide: true, alt: "Using a PostgreSQL database via a terminal and a Jupyter notebook", children: [(0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "CoCalc supports running various databases inside a project." }), " ", "They run in the same protected networking environment as all other processes in a project. This is ideal for", " ", (0, jsx_runtime_1.jsx)("strong", { children: "learning SQL" }), " or", " ", (0, jsx_runtime_1.jsx)("strong", { children: "persistently storing data" }), " as a result of your computations."] }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "PostgreSQL" }), ": read", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/howto/postgresql.html", children: "our guide" }), " ", "to get started."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Besides", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://https://www.postgresql.org/", children: "PostgreSQL" }), ", CoCalc also supports ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://www.mysql.com/", children: "MySQL" }), " ", "and ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://sqlite.org", children: "SQLite" }), "."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["To interact with the databases, CoCalc", " ", (0, jsx_runtime_1.jsx)("strong", { children: "pre-installs suitable Python and R libraries" }), " for your convenience."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["In the screenshot, you can see how a PostgreSQL database was setup and started in the first terminal. In the second terminal,", " ", (0, jsx_runtime_1.jsx)(code_1.default, { children: "psql" }), " is used to connect to it and create a table and insert data. Finally, the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/jupyter-notebook", children: "Jupyter Notebook" }), " on the left connects via the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "http://initd.org/psycopg/docs/", children: "psycopg2" }), " library and issues a query to the database!"] })] }), (0, jsx_runtime_1.jsx)(sign_in_1.default, { startup: "Linux" })] }), (0, jsx_runtime_1.jsx)(footer_1.default, {})] })] }));
}
exports.default = Linux;
async function getServerSideProps(context) {
    return await (0, with_customize_1.default)({ context });
}
exports.getServerSideProps = getServerSideProps;
function FullLinuxTerminal() {
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(pitch_1.default, { col1: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { children: "Full Linux Terminal" }), (0, jsx_runtime_1.jsx)("p", { children: (0, jsx_runtime_1.jsxs)("strong", { children: ["CoCalc offers a full, collaborative, real-time synchronized", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://en.wikipedia.org/wiki/Linux", children: "Linux" }), " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://en.wikipedia.org/wiki/Command-line_interface", children: "Command Line Terminal" }), " ", "in your browser."] }) }), (0, jsx_runtime_1.jsxs)("p", { children: ["Take a look at our", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/terminal.html", children: "terminal documentation" }) }), " ", "to learn more about it!"] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Browse the", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software/executables", children: "installed software" }) }), " ", "in CoCalc."] }), (0, jsx_runtime_1.jsxs)("p", { children: ["CoCalc is made for", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "/features/teaching", children: "teaching a course" }) }), ": students just have to sign in to get started!", " "] })] }), col2: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h2", { children: "Benefits of working 100% online" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["You no longer have to ", (0, jsx_runtime_1.jsx)("strong", { children: "install and maintain" }), " any software."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["It is possible for multiple people to", " ", (0, jsx_runtime_1.jsx)("strong", { children: "collaboratively use the same terminal in realtime" }), "."] }), (0, jsx_runtime_1.jsx)("li", { children: "You can also edit and run shell script files." }), (0, jsx_runtime_1.jsxs)("li", { children: ["Use", " ", (0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/chat.html", children: "chat" }) }), " ", "next to the Terminal to discuss your commands with others."] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "Automatic backup" }), " keeps your files safe!"] }), (0, jsx_runtime_1.jsxs)("li", { children: ["You can ", (0, jsx_runtime_1.jsx)("strong", { children: "copy and paste" }), " between your local desktop and the online terminal."] })] })] }) }), (0, jsx_runtime_1.jsx)(pitch_1.default, { ext: "sh", col1: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("h2", { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "user-check" }), " What you ", (0, jsx_runtime_1.jsx)("strong", { children: "can" }), " do ..."] }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: "Learn Bash scripting" }), (0, jsx_runtime_1.jsx)("li", { children: "Learn how to use the Linux command line" }), (0, jsx_runtime_1.jsxs)("li", { children: ["Run scripts written in", " ", (0, jsx_runtime_1.jsx)("strong", { children: "Python, R, PHP, Ruby, Go, Perl, Nodejs " }), " etc."] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Compile programs written in", " ", (0, jsx_runtime_1.jsx)("strong", { children: "C/C++, Java, Rust, Assembly, Fortran, Julia, Zig, Haskell," }), " ", "etc."] }), (0, jsx_runtime_1.jsx)("li", { children: "Process and store datafiles" }), (0, jsx_runtime_1.jsx)("li", { children: "Collaborate" }), (0, jsx_runtime_1.jsx)("li", { children: "Use graphical X11 applications" })] })] }), col2: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("h2", { children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "user-slash" }), " ... what you ", (0, jsx_runtime_1.jsx)("strong", { children: "cannot" }), " ", "do."] }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("strong", { children: (0, jsx_runtime_1.jsx)("code", { children: "Root" }) }), ": due to how CoCalc works, you cannot have root rights. However, there is a wealth of software", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "/software", children: "already installed" }), ", including both system utilities and packages for specific language environments. Regarding Python, R, Nodejs, and Julia environments, you can", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/howto/index.html", children: "install additional packages in your project" }), ". If something is missing,", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "mailto:help@cocalc.com", children: "please tell us" }), "."] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "Communicate with the Internet without buying a license" }), ": if you want to run code to download data from another server or checkout a Git repository \u2013 or just want to support CoCalc \u2013 you need a", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/licenses.html", children: "license" }), " ", "applied to your project. Learn more about the", " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/trial.html", children: "Trial Projects" }), " ", "that you can use for free."] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("strong", { children: "Port forwards:" }), " you cannot forward arbitrary ports over ssh to your local computer. (You ", (0, jsx_runtime_1.jsx)("strong", { children: "CAN" }), " ", (0, jsx_runtime_1.jsx)(A_1.default, { href: "https://doc.cocalc.com/project-settings.html#ssh-keys", children: "ssh into your project" }), ".)"] })] })] }) })] }));
}
exports.FullLinuxTerminal = FullLinuxTerminal;
//# sourceMappingURL=linux.js.map