Last active
May 18, 2025 06:27
-
-
Save gbraad/ca38aecbe3cfc36d3db57628fb3c6b1e to your computer and use it in GitHub Desktop.
my environment
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": "ABX9TyM3W0Cd34i+84ElcSXjO2b/", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"display_name": "Python 3", | |
"name": "python3" | |
}, | |
"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/gbraad/ca38aecbe3cfc36d3db57628fb3c6b1e/my_environment.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "QSj4zEv-isb5" | |
}, | |
"source": [ | |
"### Pre-requisites\n", | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "mULFuh52pCz0", | |
"outputId": "84e80098-e919-415e-df11-f71ff1b91c81", | |
"collapsed": true | |
}, | |
"source": [ | |
"!apt-get install vim tmux powerline zsh\n", | |
"!git clone https://github.com/gbraad/dotfiles.git\n", | |
"!rm ~/.tmux.conf\n", | |
"!./dotfiles/install.sh" | |
], | |
"execution_count": 2, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Reading package lists... Done\n", | |
"Building dependency tree... Done\n", | |
"Reading state information... Done\n", | |
"zsh is already the newest version (5.8.1-1).\n", | |
"powerline is already the newest version (2.8.2-1).\n", | |
"tmux is already the newest version (3.2a-4ubuntu0.2).\n", | |
"vim is already the newest version (2:8.2.3995-1ubuntu2.24).\n", | |
"0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.\n", | |
"fatal: destination path 'dotfiles' already exists and is not an empty directory.\n", | |
"Performing install\n", | |
"Dectected ubuntu\n", | |
"Updating package list and installing packages...\n", | |
"Hit:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease\n", | |
"Hit:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease\n", | |
"Hit:3 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", | |
"Hit:4 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", | |
"Hit:5 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", | |
"Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease\n", | |
"Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease\n", | |
"Hit:8 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n", | |
"Hit:9 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n", | |
"Hit:10 https://r2u.stat.illinois.edu/ubuntu jammy InRelease\n", | |
"Reading package lists... Done\n", | |
"W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n", | |
"Reading package lists... Done\n", | |
"Building dependency tree... Done\n", | |
"Reading state information... Done\n", | |
"jq is already the newest version (1.6-2.1ubuntu3).\n", | |
"screen is already the newest version (4.9.0-1).\n", | |
"zsh is already the newest version (5.8.1-1).\n", | |
"powerline is already the newest version (2.8.2-1).\n", | |
"stow is already the newest version (2.3.1-1).\n", | |
"git is already the newest version (1:2.34.1-1ubuntu1.12).\n", | |
"tmux is already the newest version (3.2a-4ubuntu0.2).\n", | |
"vim is already the newest version (2:8.2.3995-1ubuntu2.24).\n", | |
"fzf is already the newest version (0.29.0-1ubuntu0.1).\n", | |
"0 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.\n", | |
"fatal: destination path '/root/.dotfiles' already exists and is not an empty directory.\n", | |
"Install finished; use `chsh -s /bin/zsh` or `chsh -s /usr/bin/zsh` to change shell\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "2y5sNiGOi5c4" | |
}, | |
"source": [ | |
"### Running server" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"%%script zsh\n", | |
". ~/.zshrc.d/dotfiles.zsh\n", | |
"dotfiles resource\n", | |
"install-code" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "yFxPCsLiTZy7", | |
"outputId": "fae36da0-8380-415b-89ff-f1de3975ddbb" | |
}, | |
"execution_count": 11, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Resourcing zsh.\n", | |
"\u001b[6 q\r\u001b]2;_installcode\u0007\u001b]1;\u0007Installing code-cli for: x64\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!~/.local/bin/code tunnel user login --provider github" | |
], | |
"metadata": { | |
"id": "FH_xHzm3ovHM" | |
}, | |
"execution_count": null, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!~/.local/bin/code tunnel --accept-server-license-terms --name colab" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "dqlwMNLuTkHK", | |
"outputId": "ebe9f2af-b4d7-4d7f-bdbf-e8b4a6f7ece6" | |
}, | |
"execution_count": 18, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"*\r\n", | |
"* Visual Studio Code Server\r\n", | |
"*\r\n", | |
"* By using the software, you agree to\r\n", | |
"* the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and\r\n", | |
"* the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).\r\n", | |
"*\n", | |
"\u001b[2m[2025-05-17 05:06:34]\u001b[0m \u001b[33mwarn\u001b[0m Command-line options will not be applied until the existing tunnel exits.\n", | |
"Connected to an existing tunnel process running on this machine. You can press:\n", | |
"\n", | |
"- \"x\" + Enter to stop the tunnel and exit\n", | |
"- \"r\" + Enter to restart the tunnel\n", | |
"- Ctrl+C to detach\n", | |
"\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## Setup Tailscale" | |
], | |
"metadata": { | |
"id": "c1cvH1ajsAk_" | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!curl -fsSL https://tailscale.com/install.sh | sh" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"collapsed": true, | |
"id": "7fjGmKGIo7kU", | |
"outputId": "13d0b554-fe35-4a9a-f63f-9acfb290d5e7" | |
}, | |
"execution_count": 19, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"Installing Tailscale for ubuntu jammy, using method apt\n", | |
"+ mkdir -p --mode=0755 /usr/share/keyrings\n", | |
"+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg\n", | |
"+ tee /usr/share/keyrings/tailscale-archive-keyring.gpg\n", | |
"+ chmod 0644 /usr/share/keyrings/tailscale-archive-keyring.gpg\n", | |
"+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list\n", | |
"+ tee /etc/apt/sources.list.d/tailscale.list\n", | |
"# Tailscale packages for ubuntu jammy\n", | |
"deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/ubuntu jammy main\n", | |
"+ chmod 0644 /etc/apt/sources.list.d/tailscale.list\n", | |
"+ apt-get update\n", | |
"Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease\n", | |
"Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease\n", | |
"Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n", | |
"Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n", | |
"Get:5 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]\n", | |
"Hit:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease\n", | |
"Hit:7 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease\n", | |
"Hit:8 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease\n", | |
"Hit:9 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease\n", | |
"Get:10 https://pkgs.tailscale.com/stable/ubuntu jammy InRelease\n", | |
"Hit:11 https://r2u.stat.illinois.edu/ubuntu jammy InRelease\n", | |
"Get:12 https://pkgs.tailscale.com/stable/ubuntu jammy/main amd64 Packages [12.8 kB]\n", | |
"Get:13 https://pkgs.tailscale.com/stable/ubuntu jammy/main all Packages [354 B]\n", | |
"Fetched 23.3 kB in 1s (15.7 kB/s)\n", | |
"Reading package lists... Done\n", | |
"W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)\n", | |
"+ apt-get install -y tailscale tailscale-archive-keyring\n", | |
"Reading package lists... Done\n", | |
"Building dependency tree... Done\n", | |
"Reading state information... Done\n", | |
"The following additional packages will be installed:\n", | |
" iptables libip6tc2 libnetfilter-conntrack3 libnfnetlink0 libnftnl11 netbase\n", | |
"Suggested packages:\n", | |
" firewalld nftables\n", | |
"The following NEW packages will be installed:\n", | |
" iptables libip6tc2 libnetfilter-conntrack3 libnfnetlink0 libnftnl11 netbase\n", | |
" tailscale tailscale-archive-keyring\n", | |
"0 upgraded, 8 newly installed, 0 to remove and 89 not upgraded.\n", | |
"Need to get 32.1 MB of archives.\n", | |
"After this operation, 62.5 MB of additional disk space will be used.\n", | |
"Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 netbase all 6.3 [12.9 kB]\n", | |
"Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libip6tc2 amd64 1.8.7-1ubuntu5.2 [20.3 kB]\n", | |
"Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnfnetlink0 amd64 1.0.1-3build3 [14.6 kB]\n", | |
"Get:4 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnetfilter-conntrack3 amd64 1.0.9-1 [45.3 kB]\n", | |
"Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libnftnl11 amd64 1.2.1-1build1 [65.5 kB]\n", | |
"Get:7 https://pkgs.tailscale.com/stable/ubuntu jammy/main all tailscale-archive-keyring all 1.35.181 [3,082 B]\n", | |
"Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 iptables amd64 1.8.7-1ubuntu5.2 [455 kB]\n", | |
"Get:5 https://pkgs.tailscale.com/stable/ubuntu jammy/main amd64 tailscale amd64 1.82.5 [31.5 MB]\n", | |
"Fetched 32.1 MB in 1s (22.2 MB/s)\n", | |
"Selecting previously unselected package netbase.\n", | |
"(Reading database ... 128058 files and directories currently installed.)\n", | |
"Preparing to unpack .../0-netbase_6.3_all.deb ...\n", | |
"Unpacking netbase (6.3) ...\n", | |
"Selecting previously unselected package libip6tc2:amd64.\n", | |
"Preparing to unpack .../1-libip6tc2_1.8.7-1ubuntu5.2_amd64.deb ...\n", | |
"Unpacking libip6tc2:amd64 (1.8.7-1ubuntu5.2) ...\n", | |
"Selecting previously unselected package libnfnetlink0:amd64.\n", | |
"Preparing to unpack .../2-libnfnetlink0_1.0.1-3build3_amd64.deb ...\n", | |
"Unpacking libnfnetlink0:amd64 (1.0.1-3build3) ...\n", | |
"Selecting previously unselected package libnetfilter-conntrack3:amd64.\n", | |
"Preparing to unpack .../3-libnetfilter-conntrack3_1.0.9-1_amd64.deb ...\n", | |
"Unpacking libnetfilter-conntrack3:amd64 (1.0.9-1) ...\n", | |
"Selecting previously unselected package libnftnl11:amd64.\n", | |
"Preparing to unpack .../4-libnftnl11_1.2.1-1build1_amd64.deb ...\n", | |
"Unpacking libnftnl11:amd64 (1.2.1-1build1) ...\n", | |
"Selecting previously unselected package iptables.\n", | |
"Preparing to unpack .../5-iptables_1.8.7-1ubuntu5.2_amd64.deb ...\n", | |
"Unpacking iptables (1.8.7-1ubuntu5.2) ...\n", | |
"Selecting previously unselected package tailscale.\n", | |
"Preparing to unpack .../6-tailscale_1.82.5_amd64.deb ...\n", | |
"Unpacking tailscale (1.82.5) ...\n", | |
"Selecting previously unselected package tailscale-archive-keyring.\n", | |
"Preparing to unpack .../7-tailscale-archive-keyring_1.35.181_all.deb ...\n", | |
"Unpacking tailscale-archive-keyring (1.35.181) ...\n", | |
"Setting up tailscale-archive-keyring (1.35.181) ...\n", | |
"Setting up libip6tc2:amd64 (1.8.7-1ubuntu5.2) ...\n", | |
"Setting up libnftnl11:amd64 (1.2.1-1build1) ...\n", | |
"Setting up libnfnetlink0:amd64 (1.0.1-3build3) ...\n", | |
"Setting up netbase (6.3) ...\n", | |
"Setting up libnetfilter-conntrack3:amd64 (1.0.9-1) ...\n", | |
"Setting up iptables (1.8.7-1ubuntu5.2) ...\n", | |
"update-alternatives: using /usr/sbin/iptables-legacy to provide /usr/sbin/iptables (iptables) in auto mode\n", | |
"update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in auto mode\n", | |
"update-alternatives: using /usr/sbin/iptables-nft to provide /usr/sbin/iptables (iptables) in auto mode\n", | |
"update-alternatives: using /usr/sbin/ip6tables-nft to provide /usr/sbin/ip6tables (ip6tables) in auto mode\n", | |
"update-alternatives: using /usr/sbin/arptables-nft to provide /usr/sbin/arptables (arptables) in auto mode\n", | |
"update-alternatives: using /usr/sbin/ebtables-nft to provide /usr/sbin/ebtables (ebtables) in auto mode\n", | |
"Setting up tailscale (1.82.5) ...\n", | |
"Created symlink /etc/systemd/system/multi-user.target.wants/tailscaled.service → /lib/systemd/system/tailscaled.service.\n", | |
"Processing triggers for man-db (2.10.2-1) ...\n", | |
"Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n", | |
"\n", | |
"/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n", | |
"\n", | |
"+ [ false = true ]\n", | |
"+ set +x\n", | |
"Installation complete! Log in to start using Tailscale by running:\n", | |
"\n", | |
"tailscale up\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"%%bash\n", | |
"rm -rf /tmp/tailscaled\n", | |
"mkdir -p /tmp/tailscaled\n", | |
"chown irc.irc /tmp/tailscaled\n", | |
"\n", | |
"rm -rf /var/run/tailscale\n", | |
"mkdir -p /var/run/tailscale\n", | |
"chown irc.irc /var/run/tailscale\n", | |
"\n", | |
"cp /var/lib/tailscaled/tailscaled.state /tmp/tailscaled/tailscaled.state\n", | |
"chown irc.irc /tmp/tailscaled/tailscaled.state" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "bA-TwqCqq3HA", | |
"outputId": "ea74ca9e-2730-434b-ca25-72aa73ca326f" | |
}, | |
"execution_count": 22, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"cp: cannot stat '/var/lib/tailscaled/tailscaled.state': No such file or directory\n", | |
"chown: cannot access '/tmp/tailscaled/tailscaled.state': No such file or directory\n" | |
] | |
} | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"!nohup sudo -u irc tailscaled --hostname colab --tun=userspace-networking --outbound-http-proxy-listen=localhost:3214 --socks5-server=localhost:3215 --state=/tmp/tailscaled/tailscaled.state --socket=/var/run/tailscale/tailscaled.sock --port 41641 &\n", | |
"!until tailscale up; do sleep 1; done" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "4xZ7AWrergjw", | |
"outputId": "fe74f378-ec23-4b3c-b869-b1c863523238" | |
}, | |
"execution_count": 23, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"name": "stdout", | |
"text": [ | |
"nohup: appending output to 'nohup.out'\n", | |
"\n", | |
"To authenticate, visit:\n", | |
"\n", | |
"\thttps://login.tailscale.com/a/1fc9730f016554\n", | |
"\n", | |
"Success.\n" | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment