Skip to content

Instantly share code, notes, and snippets.

@yuazuma
Created July 19, 2021 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuazuma/75c74ee7754e15ffdb4197733782ad8f to your computer and use it in GitHub Desktop.
Save yuazuma/75c74ee7754e15ffdb4197733782ad8f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "4bd76506-2f2f-4972-996e-77a8a9ffe1b8",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[35m\u001b[K/etc/debian_version\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[Kbullseye/sid\n",
"\u001b[35m\u001b[K/etc/lsb-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KDISTRIB_ID=Ubuntu\n",
"\u001b[35m\u001b[K/etc/lsb-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KDISTRIB_RELEASE=20.04\n",
"\u001b[35m\u001b[K/etc/lsb-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KDISTRIB_CODENAME=focal\n",
"\u001b[35m\u001b[K/etc/lsb-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KDISTRIB_DESCRIPTION=\"Ubuntu 20.04.2 LTS\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KNAME=\"Ubuntu\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KVERSION=\"20.04.2 LTS (Focal Fossa)\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KID=ubuntu\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KID_LIKE=debian\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KPRETTY_NAME=\"Ubuntu 20.04.2 LTS\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KVERSION_ID=\"20.04\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KHOME_URL=\"https://www.ubuntu.com/\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KSUPPORT_URL=\"https://help.ubuntu.com/\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KBUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KPRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KVERSION_CODENAME=focal\n",
"\u001b[35m\u001b[K/etc/os-release\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[KUBUNTU_CODENAME=focal\n"
]
}
],
"source": [
"grep -H \"\" /etc/*version ; grep -H \"\" /etc/*release"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "a0596808-da36-4e29-9fc9-686dd3b226f5",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"9f001da751e3\n"
]
}
],
"source": [
"hostname"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "ff93c3db-e5d3-4255-990f-00138fdd4aa4",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"jovyan\n"
]
}
],
"source": [
"whoami"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "4b088e9e-5dd0-4150-a168-172ad10992aa",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease\n",
"Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease\n",
"Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease\n",
"Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"11 packages can be upgraded. Run 'apt list --upgradable' to see them.\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"iproute2 is already the newest version (5.5.0-1ubuntu1).\n",
"0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.\n"
]
}
],
"source": [
"sudo apt update -y && sudo apt install -y iproute2"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "f595c410-6521-46a0-b34f-6e32b9c92908",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n",
" link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n",
" inet 127.0.0.1/8 scope host lo\n",
" valid_lft forever preferred_lft forever\n",
"2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000\n",
" link/sit 0.0.0.0 brd 0.0.0.0\n",
"8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default \n",
" link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0\n",
" inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0\n",
" valid_lft forever preferred_lft forever\n"
]
}
],
"source": [
"ip a"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]\n",
"Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]\n",
"Get:3 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [930 kB]\n",
"Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]\n",
"Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]\n",
"Get:6 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]\n",
"Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]\n",
"Get:8 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [782 kB]\n",
"Get:9 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.6 kB]\n",
"Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [368 kB]\n",
"Get:11 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]\n",
"Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1,275 kB]\n",
"Get:13 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [32.0 kB]\n",
"Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,053 kB]\n",
"Get:15 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [416 kB]\n",
"Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,367 kB]\n",
"Get:17 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [2,668 B]\n",
"Get:18 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [6,303 B]\n",
"Fetched 18.4 MB in 1min 3s (293 kB/s)\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"11 packages can be upgraded. Run 'apt list --upgradable' to see them.\n",
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"The following additional packages will be installed:\n",
" libcap2 libcap2-bin libpam-cap\n",
"The following NEW packages will be installed:\n",
" iputils-ping libcap2 libcap2-bin libpam-cap net-tools\n",
"0 upgraded, 5 newly installed, 0 to remove and 11 not upgraded.\n",
"Need to get 287 kB of archives.\n",
"After this operation, 1,197 kB of additional disk space will be used.\n",
"Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 libcap2 amd64 1:2.32-1 [15.9 kB]\n",
"Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 libcap2-bin amd64 1:2.32-1 [26.2 kB]\n",
"Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 iputils-ping amd64 3:20190709-3 [40.1 kB]\n",
"Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libpam-cap amd64 1:2.32-1 [8,352 B]\n",
"Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 net-tools amd64 1.60+git20180626.aebd88e-1ubuntu1 [196 kB]\n",
"Fetched 287 kB in 2s (130 kB/s)\n",
"debconf: delaying package configuration, since apt-utils is not installed\n",
"\n",
"\u001b7\u001b[0;23r\u001b8\u001b[1ASelecting previously unselected package libcap2:amd64.\n",
"(Reading database ... 5183 files and directories currently installed.)\n",
"Preparing to unpack .../libcap2_1%3a2.32-1_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 0%]\u001b[49m\u001b[39m [..........................................................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 5%]\u001b[49m\u001b[39m [##........................................................] \u001b8Unpacking libcap2:amd64 (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 10%]\u001b[49m\u001b[39m [#####.....................................................] \u001b8Selecting previously unselected package libcap2-bin.\n",
"Preparing to unpack .../libcap2-bin_1%3a2.32-1_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 14%]\u001b[49m\u001b[39m [########..................................................] \u001b8Unpacking libcap2-bin (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 19%]\u001b[49m\u001b[39m [###########...............................................] \u001b8Selecting previously unselected package iputils-ping.\n",
"Preparing to unpack .../iputils-ping_3%3a20190709-3_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 24%]\u001b[49m\u001b[39m [#############.............................................] \u001b8Unpacking iputils-ping (3:20190709-3) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 29%]\u001b[49m\u001b[39m [################..........................................] \u001b8Selecting previously unselected package libpam-cap:amd64.\n",
"Preparing to unpack .../libpam-cap_1%3a2.32-1_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 33%]\u001b[49m\u001b[39m [###################.......................................] \u001b8Unpacking libpam-cap:amd64 (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 38%]\u001b[49m\u001b[39m [######################....................................] \u001b8Selecting previously unselected package net-tools.\n",
"Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_amd64.deb ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 43%]\u001b[49m\u001b[39m [########################..................................] \u001b8Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 48%]\u001b[49m\u001b[39m [###########################...............................] \u001b8Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 52%]\u001b[49m\u001b[39m [##############################............................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 57%]\u001b[49m\u001b[39m [#################################.........................] \u001b8Setting up libcap2:amd64 (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 62%]\u001b[49m\u001b[39m [###################################.......................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 67%]\u001b[49m\u001b[39m [######################################....................] \u001b8Setting up libcap2-bin (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 71%]\u001b[49m\u001b[39m [#########################################.................] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 76%]\u001b[49m\u001b[39m [############################################..............] \u001b8Setting up libpam-cap:amd64 (1:2.32-1) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 81%]\u001b[49m\u001b[39m [##############################################............] \u001b8debconf: unable to initialize frontend: Dialog\n",
"debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)\n",
"debconf: falling back to frontend: Readline\n",
"debconf: unable to initialize frontend: Readline\n",
"debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)\n",
"debconf: falling back to frontend: Teletype\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 86%]\u001b[49m\u001b[39m [#################################################.........] \u001b8Setting up iputils-ping (3:20190709-3) ...\n",
"\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 90%]\u001b[49m\u001b[39m [####################################################......] \u001b8\u001b7\u001b[24;0f\u001b[42m\u001b[30mProgress: [ 95%]\u001b[49m\u001b[39m [#######################################################...] \u001b8Processing triggers for libc-bin (2.31-0ubuntu9.2) ...\n",
"\n",
"\u001b7\u001b[0;24r\u001b8\u001b[1A\u001b[J"
]
}
],
"source": [
"sudo apt update -y && sudo apt install -y iputils-ping"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"PING www.google.com (172.217.31.132) 56(84) bytes of data.\n",
"64 bytes from 172.217.31.132 (172.217.31.132): icmp_seq=1 ttl=37 time=23.5 ms\n",
"\n",
"--- www.google.com ping statistics ---\n",
"1 packets transmitted, 1 received, 0% packet loss, time 0ms\n",
"rtt min/avg/max/mdev = 23.505/23.505/23.505/0.000 ms\n"
]
}
],
"source": [
"ping -c 1 www.google.com"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Bash",
"language": "bash",
"name": "bash"
},
"language_info": {
"codemirror_mode": "shell",
"file_extension": ".sh",
"mimetype": "text/x-sh",
"name": "bash"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment