Seminar 0

0


Filesystem commands. Course infrastructure.

Slides

Tasks

Open Google Cloud Console and enter the shell session.

gc console
Figure 1. Enter cloud shell

It is a debian-like linux. Install fenrir (see Install guides). To install autocomplete run sudo fenrir autocomplete bash.

Part 0

Fenrir ID: sem0-0

file

Create a regular file reg.reg

Solution

touch reg.reg

dir

Create a directory dir

Solution

mkdir dir

link

Create a hard link reg.link that points to the reg.reg file

Solution

ln reg.reg reg.link

symlink

Create a symbolic link reg.slink that points to the reg.reg file

Solution

ln -s reg.reg reg.slink

pipe

Create two named pipes: pipe.in and pipe.out. Write Hello to the first one and read from the other one

Solution

mkfifo pipe.in pipe.out

  • 1st terminal: echo 'Hello' > pipe.in

  • 2nd terminal: cat pipe.out

  • 3rd terminal: fenrir run -i PATH

If waitpid is not found, run apt install util-linux-extra

Part 1

Fenrir ID: sem0-1

package

Enter dev environment (fenrir env up DIR). Install column utility by running apk add util-linux.
You will see this error: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set. Find who is the owner of the /usr/bin/sudo file and change it if needed. To set the setuid bit add 4 prefix to the file’s octal mode.
Since you cannot use sudo, you must change the user to root and do the modifications within its session.

root's password is pass
Solution
$ su -
$ chown root /usr/bin/sudo
$ chmod 4755 /usr/bin/sudo
$ exit
$ sudo apk add util-linux
file

Create a file /tmp/sub/ex.txt. Its content must be:

1
2
3
4
5
Solution

Install nano and create a file.