Skip to content

Commit

Permalink
Add week8 solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavlik1400 committed Jan 17, 2021
1 parent 0582fb2 commit 7b1f4fb
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
*solutions
3 changes: 3 additions & 0 deletions weeks/week8/solutions/good_bye_world_1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# remember that on your device the path will be different
echo "Finished. Date: $(date)" >> /home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/hello_world.log
53 changes: 53 additions & 0 deletions weeks/week8/solutions/hello_world.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Started. Date: Tue Nov 10 10:50:22 EET 2020
Started. Date: Tue Nov 10 10:55:25 EET 2020
Finished. Date: Tue Nov 10 10:55:25 EET 2020
Started. Date: Tue Nov 10 10:55:35 EET 2020
Finished. Date: Tue Nov 10 10:55:35 EET 2020
Started. Date: Tue Nov 10 10:55:45 EET 2020
Finished. Date: Tue Nov 10 10:55:45 EET 2020
Started. Date: Tue Nov 10 10:55:55 EET 2020
Finished. Date: Tue Nov 10 10:55:55 EET 2020
Started. Date: Tue Nov 10 10:56:05 EET 2020
Finished. Date: Tue Nov 10 10:56:05 EET 2020
Started. Date: Tue Nov 10 10:56:15 EET 2020
Finished. Date: Tue Nov 10 10:56:15 EET 2020
Started. Date: Tue Nov 10 10:56:25 EET 2020
Finished. Date: Tue Nov 10 10:56:25 EET 2020
Started. Date: Tue Nov 10 10:56:35 EET 2020
Finished. Date: Tue Nov 10 10:56:35 EET 2020
Started. Date: Tue Nov 10 10:56:45 EET 2020
Finished. Date: Tue Nov 10 10:56:45 EET 2020
Started. Date: Tue Nov 10 11:00:02 EET 2020
Finished. Date: Tue Nov 10 11:00:02 EET 2020
Started. Date: Tue Nov 10 11:00:12 EET 2020
Finished. Date: Tue Nov 10 11:00:12 EET 2020
Started. Date: Tue Nov 10 11:00:22 EET 2020
Finished. Date: Tue Nov 10 11:00:22 EET 2020
Started. Date: Tue Nov 10 11:00:32 EET 2020
Finished. Date: Tue Nov 10 11:00:32 EET 2020
Started. Date: Tue Nov 10 11:00:42 EET 2020
Finished. Date: Tue Nov 10 11:00:42 EET 2020
Started. Date: Tue Nov 10 11:00:52 EET 2020
Finished. Date: Tue Nov 10 11:00:52 EET 2020
Started. Date: Tue Nov 10 11:01:02 EET 2020
Finished. Date: Tue Nov 10 11:01:02 EET 2020
Started. Date: Tue Nov 10 11:01:12 EET 2020
Finished. Date: Tue Nov 10 11:01:12 EET 2020
Started. Date: Tue Nov 10 11:01:22 EET 2020
Finished. Date: Tue Nov 10 11:01:22 EET 2020
Started. Date: Tue Nov 10 11:01:32 EET 2020
Finished. Date: Tue Nov 10 11:01:32 EET 2020
Started. Date: Tue Nov 10 11:01:42 EET 2020
Finished. Date: Tue Nov 10 11:01:42 EET 2020
Started. Date: Tue Nov 10 11:01:52 EET 2020
Finished. Date: Tue Nov 10 11:01:52 EET 2020
Started. Date: Tue Nov 10 11:02:02 EET 2020
Finished. Date: Tue Nov 10 11:02:02 EET 2020
Started. Date: Tue Nov 10 11:02:12 EET 2020
Finished. Date: Tue Nov 10 11:02:12 EET 2020
Started. Date: Tue Nov 10 11:02:22 EET 2020
Finished. Date: Tue Nov 10 11:02:22 EET 2020
Started. Date: Tue Nov 10 11:02:32 EET 2020
Finished. Date: Tue Nov 10 11:02:32 EET 2020
Started. Date: Tue Nov 10 11:02:42 EET 2020
Finished. Date: Tue Nov 10 11:02:42 EET 2020
4 changes: 4 additions & 0 deletions weeks/week8/solutions/hello_world_1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# remember that on your device the path will be different
echo "Started. Date: $(date)" >> /home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/hello_world.log
echo "Hello, world"
10 changes: 10 additions & 0 deletions weeks/week8/solutions/hello_world_with_timer.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Hello world service, that will be trigerred by timer
After=multi-user.target

[Service]
Type=simple
ExecStart=/home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/hello_world_1.sh
ExecStop=/home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/good_bye_world_1.sh
User=pasha
Group=pasha
11 changes: 11 additions & 0 deletions weeks/week8/solutions/hello_world_with_timer.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Timer for hello_world service that executes given program each 10 sec

[Timer]
OnBootSec=1min
OnUnitActiveSec=10s
Persistent=true
AccuracySec=1us

[Install]
WantedBy=timers.target
66 changes: 66 additions & 0 deletions weeks/week8/solutions/my_logs.logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
-- Journal begins at Wed 2020-09-16 13:12:17 EEST, ends at Mon 2021-01-18 01:08:55 EET. --
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.XHC.RHUB.TPLD], AE_ALREADY_EXISTS (20200925/dswload2-326)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS01], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS02], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS03], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS04], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS05], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS06], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS07], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS08], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS09], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS10], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS11], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS12], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.HS13], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.XHC.RHUB.HS14._UPC], AE_ALREADY_EXISTS (20200925/dswload2-326)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.XHC.RHUB.HS14._PLD], AE_ALREADY_EXISTS (20200925/dswload2-326)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.USR1], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.USR2], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS01], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS02], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS03], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS04], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS05], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS06], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS07], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS08], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS09], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.XHC.RHUB.SS10], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.I2C2.TPD0], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.I2C3.TPL1], AE_NOT_FOUND (20200925/dswload2-162)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.PEG0.PEGP._ON], AE_ALREADY_EXISTS (20200925/dswload2-326)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI BIOS Error (bug): Failure creating named object [\_SB.PCI0.PEG0.PEGP._OFF], AE_ALREADY_EXISTS (20200925/dswload2-326)
Jan 17 23:48:25 userhost-pavlikgiley kernel: ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20200925/psobject-220)
Jan 17 23:48:26 userhost-pavlikgiley kernel:
11 changes: 11 additions & 0 deletions weeks/week8/solutions/my_logs.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Saves all logs from last boot in /home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/my_logs.log. You can specify logs priority in ~/.config/my_logs.conf

[Service]
Type=simple
ExecStartPre=echo "Saving logs"
ExecStart=/home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/my_logs.sh
User=pasha
Group=pasha
[Install]
WantedBy=graphical.target
6 changes: 6 additions & 0 deletions weeks/week8/solutions/my_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# remember that on your device the path will be different
LOGS_PATH=/home/pasha/Documents/Linux_club/UCU_Linux_Club/weeks/week8/solutions/my_logs.logs
CONF_PATH=~/.config/my_logs.conf
journalctl -b -x -p $(sed '2q;d' $CONF_PATH) > $LOGS_PATH
dmesg -d -l $(sed '3q;d' $CONF_PATH) >> $LOGS_PATH
7 changes: 7 additions & 0 deletions weeks/week8/solutions/paccache.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Unit that will be executed each week. It will clean pacman cache
After=multi-user.target

[Service]
Type=simple
ExecStart=paccache -r -v
11 changes: 11 additions & 0 deletions weeks/week8/solutions/paccache.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Clears cache each week

[Timer]
OnCalendar=weekly
AccuracySec=1h
RandomizedDelaySec=2000
Persistent=true

[Install]
WantedBy=timers.target

0 comments on commit 7b1f4fb

Please sign in to comment.