Журнал лабораторных работ

Содержание

Журнал

Понедельник (12/17/18)

/dev/pts/0
10:16:18
$more /proc/cpuinfo
/dev/pts/2
10:22:03
$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:~]$
/dev/pts/0
10:27:20
$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
10:28:16
$free
              total        used        free      shared  buff/cache   available
Mem:        8143996      763552     6602840      159652      777604     6984864
Swap:       8351740           0     8351740
10:29:40
$free -m
              total        used        free      shared  buff/cache   available
Mem:           7953         744        6448         156         760        6821
Swap:          8155           0        8155
10:30:05
$uname -a
Linux m3 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux
10:30:19
$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)
10:30:49
$su -
Password:
root@m3:~# logout
10:33:25
$vi /etc/sudoers
10:34:03
$~
#
# 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
~
10:37:46
$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
10:38:25
$vi ~/.bashrc
10:41:18
$. /etc/bash_completion

10:41:30
$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
10:44:36
$sudo hd
hd      hdparm
10:44:36
$sudo hd
hd      hdparm
10:44:36
$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
10:46:57
$more /proc/partitions
10:47:05
$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
10:47:21
$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
10:50:10
$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
10:52:00
$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) ...
10:54:18
$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
10:54:55
$man bonnie++
10:55:22
$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
10:55:29
$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
прошло 15 минут
11:10:45
$curl cheat.sh/bonnie++
bash: curl: command not found
прошло 62 минуты
12:13:33
$sudo curl cheat.sh/bonnie++
[sudo] password for user:
sudo: curl: command not found
12:13:46
$curl cheat.sh/ls
bash: curl: command not found
12:14:02
$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) ...
12:14:38
$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
12:14:44
$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
12:22:12
$curl weather.com

12:30:36
$pwd
/home/user
12:39:26
$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
12:39:28
$touch V.json

12:39:49
$vi V.json
12:43:22
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 |
> ^C
12:44:05
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 |
>  jq '.[] | .name +" " + .surname'
bash: jq: command not found
(23) Failed writing body
12:44:08
$curl -s https://uinames.com/api/?region=ukraine\&amount=5 | jq '.[] | .name +" " + .surname'
bash: jq: command not found
(23) Failed writing body
12:44:30