/l3/users/slm/2018-12-minsk-aws/student03.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$ssh 172.20.13.183
The authenticity of host '172.20.13.183 (172.20.13.183)' can't be established. [user@instructor:~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 30:85:a9:9e:10:aa brd ff:ff:ff:ff:ff:ff inet 172.20.13.183/25 brd 172.20.13.255 scope global dynamic enp3s0 valid_lft 690907sec preferred_lft 690907sec inet6 fe80::3285:a9ff:fe9e:10aa/64 scope link valid_lft forever preferred_lft forever [user@instructor:~]$ |
$more /proc/cpuinfo | grep vmx
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm kaiser tpr_shadow vnmi flexpriority dtherm |
$free
total used free shared buff/cache available Mem: 8143996 763552 6602840 159652 777604 6984864 Swap: 8351740 0 8351740 |
$free -m
total used free shared buff/cache available Mem: 7953 744 6448 156 760 6821 Swap: 8155 0 8155 |
$uname -a
Linux m3 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux |
$lspci
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03) 00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) 00:1b.0 Audio device: Intel Corporation NM10/ICH7 Family High Definition Audio Controller (rev 01) 00:1c.0 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 1 (rev 01) 00:1c.1 PCI bridge: Intel Corporation NM10/ICH7 Family PCI Express Port 2 (rev 01) 00:1d.0 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #1 (rev 01) 00:1d.1 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #2 (rev 01) 00:1d.2 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #3 (rev 01) 00:1d.3 USB controller: Intel Corporation NM10/ICH7 Family USB UHCI Controller #4 (rev 01) 00:1d.7 USB controller: Intel Corporation NM10/ICH7 Family USB2 EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) 00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01) 00:1f.2 IDE interface: Intel Corporation NM10/ICH7 Family SATA Controller [IDE mode] (rev 01) 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03) |
$su -
Password: root@m3:~# logout |
$vi /etc/sudoers
![]() |
$~
# # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification "/etc/sudoers" [readonly] 27L, 669C ... # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d root@m3:/home/user# exit # User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d ~ |
$sudo dmidecode
We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for user: # dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.5 present. 46 structures occupying 1824 bytes. ... OEM-specific Type Header and Data: 8B 36 2C 00 07 10 22 01 00 00 00 20 04 04 32 55 F8 00 A2 02 A1 00 40 63 43 10 EB 82 03 DF 40 B2 00 20 00 73 3C 10 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 Strings: V1394GUID Handle 0x002D, DMI type 127, 4 bytes End Of Table |
$vi ~/.bashrc
|
$. /etc/bash_completion
|
$sudo dmidecode
# dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.5 present. 46 structures occupying 1824 bytes. Table at 0x000F06D0. Handle 0x0000, DMI type 0, 24 bytes BIOS Information Vendor: American Megatrends Inc. Version: 0405 Release Date: 11/22/2010 ... OEM-specific Type Header and Data: 8B 36 2C 00 07 10 22 01 00 00 00 20 04 04 32 55 F8 00 A2 02 A1 00 40 63 43 10 EB 82 03 DF 40 B2 00 20 00 73 3C 10 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 Strings: V1394GUID Handle 0x002D, DMI type 127, 4 bytes End Of Table |
$sudo hd
![]() hd hdparm |
$sudo hd
![]() hd hdparm |
$sudo dmesg | grep sda
[ 0.870747] sd 2:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB) [ 0.870798] sd 2:0:0:0: [sda] Write Protect is off [ 0.870800] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00 [ 0.870835] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 0.900172] sda: sda1 sda2 < sda5 > [ 0.900540] sd 2:0:0:0: [sda] Attached SCSI disk [ 1.571465] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [ 3.759352] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro [ 8.103411] Adding 8351740k swap on /dev/sda5. Priority:-1 extents:1 across:8351740k FS |
$more /proc/partitions
|
$df -H
Filesystem Size Used Avail Use% Mounted on udev 4.2G 0 4.2G 0% /dev tmpfs 834M 19M 816M 3% /run /dev/sda1 306G 4.5G 286G 2% / tmpfs 4.2G 11M 4.2G 1% /dev/shm tmpfs 5.3M 4.1k 5.3M 1% /run/lock tmpfs 4.2G 0 4.2G 0% /sys/fs/cgroup tmpfs 834M 17k 834M 1% /run/user/117 tmpfs 834M 46k 834M 1% /run/user/1001 |
$sudo hdparm -tT /dev/sda
/dev/sda: Timing cached reads: 3308 MB in 2.00 seconds = 1655.14 MB/sec Timing buffered disk reads: 292 MB in 3.02 seconds = 96.84 MB/sec |
$sudo hdparm -tT /dev/sda
/dev/sda: Timing cached reads: 3368 MB in 2.00 seconds = 1684.81 MB/sec Timing buffered disk reads: 296 MB in 3.02 seconds = 98.15 MB/sec |
$sudo apt-get install bonnie++
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: bonnie++ 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 61.4 kB of archives. After this operation, 187 kB of additional disk space will be used. Get:1 http://ftp.by.debian.org/debian stretch/main amd64 bonnie++ amd64 1.97.3 [61.4 kB] Fetched 61.4 kB in 0s (0 B/s) Selecting previously unselected package bonnie++. (Reading database ... 135960 files and directories currently installed.) Preparing to unpack .../bonnie++_1.97.3_amd64.deb ... Unpacking bonnie++ (1.97.3) ... Setting up bonnie++ (1.97.3) ... Processing triggers for man-db (2.7.6.1-2) ... |
$sudo bonnie++
![]() You must use the "-u" switch when running as root. usage: bonnie++ [-d scratch-dir] [-c concurrency] [-s size(MiB)[:chunk-size(b)]] [-n number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]] [-m machine-name] [-r ram-size-in-MiB] [-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use] [-q] [-f] [-b] [-p processes | -y] [-z seed | -Z random-file] [-D] Version: 1.97 |
$man bonnie++
|
$sudo bonnie++ /dev/sda
![]() usage: bonnie++ [-d scratch-dir] [-c concurrency] [-s size(MiB)[:chunk-size(b)]] [-n number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]] [-m machine-name] [-r ram-size-in-MiB] [-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use] [-q] [-f] [-b] [-p processes | -y] [-z seed | -Z random-file] [-D] Version: 1.97 |
$sudo bonnie++ -d /dev/sda
Can't change to directory "/dev/sda". usage: bonnie++ [-d scratch-dir] [-c concurrency] [-s size(MiB)[:chunk-size(b)]] [-n number-to-stat[:max-size[:min-size][:num-directories[:chunk-size]]]] [-m machine-name] [-r ram-size-in-MiB] [-x number-of-tests] [-u uid-to-use:gid-to-use] [-g gid-to-use] [-q] [-f] [-b] [-p processes | -y] [-z seed | -Z random-file] [-D] Version: 1.97 |
$curl cheat.sh/bonnie++
![]() bash: curl: command not found |
$sudo curl cheat.sh/bonnie++
![]() [sudo] password for user: sudo: curl: command not found |
$curl cheat.sh/ls
![]() bash: curl: command not found |
$sudo apt-get install curl
Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libcurl3 The following NEW packages will be installed: curl libcurl3 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 519 kB of archives. After this operation, 989 kB of additional disk space will be used. ... (Reading database ... 135979 files and directories currently installed.) Preparing to unpack .../libcurl3_7.52.1-5+deb9u8_amd64.deb ... Unpacking libcurl3:amd64 (7.52.1-5+deb9u8) ... Selecting previously unselected package curl. Preparing to unpack .../curl_7.52.1-5+deb9u8_amd64.deb ... Unpacking curl (7.52.1-5+deb9u8) ... Setting up libcurl3:amd64 (7.52.1-5+deb9u8) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... Processing triggers for man-db (2.7.6.1-2) ... Setting up curl (7.52.1-5+deb9u8) ... |
$sudo curl cheat.sh/bonnie
# Bonnie++ # disk and file system benchmarking tool for measuring I/O performance # benchmark disk mounted at /tmp/; use `user` for that # skip per char IO test (-f) # no write buffering (-b) bonnie++ -d /tmp -s 16000M -n 0 -m TEST -f -b -u user |
$curl wttr.in?3n
Weather report: Minsk, Belarus Overcast .--. -12--5 °C .-( ). ← 22 km/h (___.__)__) 7 km 0.3 mm ┌─────────────┐ ┌───────────────────────┤ Mon 17 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ ... ┌───────────────────────┤ Wed 19 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ │ _`/"".-. Light snow │ Freezing fog │ │ ,\_( ). -8--6 °C │ _ - _ - _ - -14--12 °C │ │ /(___(__) ↖ 5-7 km/h │ _ - _ - _ ← 6-12 km/h │ │ * * * 20 km │ _ - _ - _ - 20 km │ │ * * * 0.0 mm | 0% │ 0.0 mm | 0% │ └──────────────────────────────┴──────────────────────────────┘ Follow @igor_chubin for wttr.in updates |
$curl weather.com
|
$pwd
/home/user |
$ls -la
total 96 drwxr-xr-x 17 user user 4096 Dec 17 12:41 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 7 user user 4096 Dec 17 12:22 .cache drwx------ 9 user user 4096 Dec 17 12:15 .config drwxr-xr-x 2 user user 4096 Dec 17 12:15 Desktop drwxr-xr-x 2 user user 4096 Dec 17 12:15 Documents ... drwxr-xr-x 3 user user 4096 Dec 17 12:15 .local drwx------ 5 user user 4096 Dec 17 12:18 .mozilla drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 17 12:23 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 1013 Dec 17 12:41 .viminfo |
$touch V.json
|
$vi V.json
|
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 |
![]() > ^C |
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 |
![]() > jq '.[] | .name +" " + .surname' bash: jq: command not found (23) Failed writing body |
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 | jq '.[] | .name +" " + .surname'
bash: jq: command not found (23) Failed writing body |
|