Created
November 20, 2025 23:58
-
-
Save rwcitek/cfde9a50b90e9254edd883cd420f4598 to your computer and use it in GitHub Desktop.
free.linux.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nbformat": 4, | |
| "nbformat_minor": 0, | |
| "metadata": { | |
| "colab": { | |
| "provenance": [], | |
| "authorship_tag": "ABX9TyM4S8mVjhYmQnk1fqdnRgvz", | |
| "include_colab_link": true | |
| }, | |
| "kernelspec": { | |
| "name": "python3", | |
| "display_name": "Python 3" | |
| }, | |
| "language_info": { | |
| "name": "python" | |
| } | |
| }, | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "view-in-github", | |
| "colab_type": "text" | |
| }, | |
| "source": [ | |
| "<a href=\"https://colab.research.google.com/gist/rwcitek/cfde9a50b90e9254edd883cd420f4598/free-linux.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "# Free Linux Environments\n", | |
| "\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "84eFc6PsUdQV" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Motivation\n", | |
| "\n", | |
| "- History\n", | |
| "- Desktop\n", | |
| "- Learning/experimenting\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "3lvI4Gec3Ci1" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## 1. Kaggle Notebooks\n" | |
| ], | |
| "metadata": { | |
| "id": "pLHMeNzZXC4u" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "Site: https://www.kaggle.com/learn\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "hVkKSgEWalRy" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "```\n", | |
| "print(\"hello world\")\n", | |
| "\n", | |
| "cat /etc/os-release\n", | |
| "df -hTPl\n", | |
| "\n", | |
| "%%bash\n", | |
| "ps faux\n", | |
| "\n", | |
| "perl -e \"print('hello world')\"\n", | |
| "\n", | |
| "%alias ps ps\n", | |
| "%alias perl perl\n", | |
| "%alias echo echo\n", | |
| "%alias id id\n", | |
| "%alias curl curl\n", | |
| "\n", | |
| "echo hello world\n", | |
| "\n", | |
| "id\n", | |
| "\n", | |
| "curl -I 'https://www.example.com'\n", | |
| "\n", | |
| "%%writefile hw.c\n", | |
| "#include <stdio.h>\n", | |
| "\n", | |
| "int main() {\n", | |
| " printf(\"Hello, World!\\n\");\n", | |
| " return 0;\n", | |
| "}\n", | |
| "\n", | |
| "ls -la\n", | |
| "\n", | |
| "!gcc hw.c -o hw\n", | |
| "\n", | |
| "!./hw\n", | |
| "\n", | |
| "\n", | |
| "```\n", | |
| "\n", | |
| "View > Show Console\n", | |
| "\n", | |
| "\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "mXN52UP6tJYN" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🟢 Pros (Ease / Use Case)\n", | |
| "* **Very Easy:** Zero setup; click \"New Notebook\" and start coding.\n", | |
| "* **Community & Data:** Built-in access to a vast library of datasets and competitions.\n", | |
| "* **Free Hardware:** Free access to **GPU/TPU** (though limited usage quota).\n", | |
| "* **Simple Tasks:** Great for Python/R scripts and data analysis *within* the notebook format.\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "KSDhP-djXKrS" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🔴 Cons (Linux Shell Limitations)\n", | |
| "* **Limited Shell Access:** No direct SSH. Terminal access is strictly for package management and diagnostics within the notebook session.\n", | |
| "* **Ephemeral:** The underlying Linux environment is cleaned up on session end.\n", | |
| "* **Pre-configured OS:** You cannot choose or deeply customize the Linux distribution.\n", | |
| "* **Not for General Use:** Cannot run background services, host a website, or perform persistent system-level tasks.\n" | |
| ], | |
| "metadata": { | |
| "id": "vGVoCHfGaCCJ" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## 2. Google Colaboratory (Colab)\n", | |
| "\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "qbS-OWmgXSpY" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "Site: https://colab.research.google.com/\n" | |
| ], | |
| "metadata": { | |
| "id": "iwWIntSbxz0e" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "\n", | |
| "```\n", | |
| "print(\"hello world\")\n", | |
| "\n", | |
| "echo hello world\n", | |
| "\n", | |
| "cat /etc/os-release\n", | |
| "\n", | |
| "id\n", | |
| "\n", | |
| "git clone https://github.com/rwcitek/bash_customization.git\n", | |
| "source bash_customization/aliases/bash.bash_aliases\n", | |
| "\n", | |
| "df -hTPl\n", | |
| "\n", | |
| "mount | grep kaggle\n", | |
| "\n", | |
| "mount -o remount,rw /kaggle/input/\n", | |
| "\n", | |
| "date > /kaggle/input/zfoo\n", | |
| "\n", | |
| "ps faux\n", | |
| "\n", | |
| "perl -e 'print(\"hello world\\n\")'\n", | |
| "\n", | |
| "curl -I 'https://www.example.com'\n", | |
| "\n", | |
| "\n", | |
| "# Compiling a C program\n", | |
| "\n", | |
| "cat <<'eof' > hw.c\n", | |
| "#include <stdio.h>\n", | |
| "\n", | |
| "int main() {\n", | |
| " printf(\"Hello, World!\\n\");\n", | |
| " return 0;\n", | |
| "}\n", | |
| "eof\n", | |
| "\n", | |
| "ls -la\n", | |
| "\n", | |
| "gcc hw.c -o hw\n", | |
| "\n", | |
| "./hw\n", | |
| "\n", | |
| "# fork bomb\n", | |
| "fork() {\n", | |
| " fork & fork\n", | |
| "}\n", | |
| "\n", | |
| "fork\n", | |
| "\n", | |
| "\n", | |
| "```\n", | |
| "\n", | |
| "Mounting Google Drive\n", | |
| "\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "BtkDql3-v2U0" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🟢 Pros (Ease / Use Case)\n", | |
| "* **Very Easy:** Notebooks run instantly from a Google account; great integration with **Google Drive**.\n", | |
| "* **Learning/Exploring:** A perfect, throwaway environment to practice Linux commands and install packages using `apt`.\n", | |
| "* **Free Hardware:** Excellent free access to **GPUs** for short periods.\n", | |
| "* **Task Automation:** Easy to connect to external APIs and run Python-based automation scripts.\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "nsga3999XT1N" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🔴 Cons (Shell/Access Limitations)\n", | |
| "* **No SSH (in Free Tier):** Shell commands are run by prefixing cells with `!` (e.g., `!ls`). No true persistent terminal/shell session.\n", | |
| "* **Ephemeral:** The VM is terminated after inactivity/time limit.\n", | |
| "* **Paid for Terminal:** True Linux terminal access via the UI is a feature of the **Colab Pro** paid tiers.\n", | |
| "* **Isolated:** Not designed for hosting continuous services or complex network configuration.\n", | |
| "\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "dLd51EMpaFMv" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## 3. GitHub Codespaces\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "lgl9t0ddXVUw" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "Sites:\n", | |
| "- https://github.com/codespaces\n", | |
| "- https://github.com/rwcitek/bash.scripting.codespaces/tree/jupyter\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "sKHTqTv83V4n" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "Choose blank\n", | |
| "VS Code\n", | |
| "Expand terminal\n", | |
| "\n", | |
| "```\n", | |
| "ls -la\n", | |
| "\n", | |
| "id\n", | |
| "\n", | |
| "echo hello world\n", | |
| "\n", | |
| "cat /etc/os-release\n", | |
| "\n", | |
| "git clone https://github.com/rwcitek/bash_customization.git\n", | |
| "source bash_customization/aliases/bash.bash_aliases\n", | |
| "\n", | |
| "df -hTPl\n", | |
| "\n", | |
| "ps faux\n", | |
| "\n", | |
| "perl -e 'print(\"hello world\\n\")'\n", | |
| "\n", | |
| "curl -I 'https://www.example.com'\n", | |
| "\n", | |
| "\n", | |
| "# Compiling C programs\n", | |
| "\n", | |
| "cat <<'eof' > hw.c\n", | |
| "#include <stdio.h>\n", | |
| "\n", | |
| "int main() {\n", | |
| " printf(\"Hello, World!\\n\");\n", | |
| " return 0;\n", | |
| "}\n", | |
| "eof\n", | |
| "\n", | |
| "ls -la\n", | |
| "\n", | |
| "gcc hw.c -o hw\n", | |
| "\n", | |
| "./hw\n", | |
| "\n", | |
| "# Docker\n", | |
| "\n", | |
| "docker container list -a\n", | |
| "\n", | |
| "docker container run --rm -it fedora /bin/bash\n", | |
| "\n", | |
| "# fork bomb\n", | |
| "fork() {\n", | |
| " fork & fork\n", | |
| "}\n", | |
| "\n", | |
| "fork\n", | |
| "\n", | |
| "\n", | |
| "```\n" | |
| ], | |
| "metadata": { | |
| "id": "EHqLA8hu5wKl" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🟢 Pros (Ease / Use Case)\n", | |
| "* **Easy Setup:** Spin up a full environment from any GitHub repository with a single click.\n", | |
| "* **Development Environment:** Full **Visual Studio Code (VS Code) IDE** in the browser with integrated terminal access.\n", | |
| "* **Full Customization:** Uses `devcontainer.json` to define the Linux base image and software.\n", | |
| "* **Web Hosting/Testing:** Easy **port forwarding** allows you to run a simple web server and view it in your browser.\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "BJpN42tXXWMy" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### 🔴 Cons (Limitations)\n", | |
| "* **Hourly Free Quota:** While there is a generous free tier, you are charged for usage beyond that.\n", | |
| "* **Git-Focused:** Best suited for projects tied to a GitHub repository.\n", | |
| "* **Ephemeral:** While data persists across sessions, the underlying VM may be stopped/deleted after an inactivity timeout.\n", | |
| "* **Not for Production:** Not intended to run 24/7 production-level services.\n", | |
| "\n" | |
| ], | |
| "metadata": { | |
| "id": "4v-1b86GaJiq" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## 4. Others\n", | |
| "\n", | |
| "- AWS ( free tier )\n", | |
| " - Cloud9\n", | |
| " - Sagemaker\n", | |
| "- Digital Ocean ( new user free credits )\n", | |
| "- GCP ( new user free credits )\n", | |
| "- Azuer ( new user free credits )" | |
| ], | |
| "metadata": { | |
| "id": "D-xvQ7uKXYWv" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [], | |
| "metadata": { | |
| "id": "B1LR_SH3tyxi" | |
| }, | |
| "execution_count": null, | |
| "outputs": [] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment