Teacher contacts
Valdis Vitolins
E-mail: valdis.vitolins@odo.lv

On line consultations in Zoom

Meeting ID: 893 8781 4665
Passcode: RTC702

Date, time:
Sep 9, 2022 18:00
Sep 23, 2022 18:00
Oct 7, 2022 18:00
Oct 21, 2022 18:00
Nov 4, 2022 18:00
Nov 18, 2022 18:00
Dec 2, 2022 18:00
Dec 16, 2022 18:00

Deadlines

  • Deadline to submit homework results: 2022-12-18
  • Automatic grade calculated from homework results: 2022-12-26

Home work

Exercises

Description of homework deliveries

Deliveries for exercises are prepared as files in form 1234abcd.E.F.ggg, where:

  1. 1234abcd is your randomly generated unique identifier
  2. E is number of exercise (1, 2, 3, etc.)
  3. F is number of the file for the task (1, 2, etc.)
  4. ggg is extension of the file

For example, name of the first file for first exercise and first task should be in the form: 1234abcd.1.1.txt

You can upload only files with correctly formatted name. You can upload the same file several times, then older file will be rewritten with newer version. Report of uploaded files is generated once a day.

To get maximum score, you should complete all tasks of all exercises. If you complete only some, you will get part of total score. If the same result is submitted by several participants, score is divided between them.

Answers to some questions

In English

In Latvian

Enroll yourself to the course (should be working now)

  1. Register yourself into system: https://artss.mii.lv/login/signup.php
  2. Log into system https://artss.mii.lv/?redirect=0
  3. Search course Introduction to Knowledge Society Technology (RTC702)
  4. Enroll yourself to the course

Optional — prepare standard environment for your homework

For this class only free to use open source tools are used, which work on different computers and operating systems. But it may cost you hours of troubleshooting if something doesn't work as expected, therefore, to perform tasks in the most efficient way, it is recommended that you install Xubuntu 20.04 as native operating system on your computer or inside virtual machine.

  1. Download setup disk image from http://cdimage.ubuntu.com/xubuntu/releases/20.04/release/.

    Be sure file is downloaded as is (archive file with *.iso extension) and is not extracted into folders and files!

  2. If you set up Xubuntu as native operating system on computer:

    Or, if you use virtual machine:

  3. Use following settings to set up system:

    1. Location: Riga
    2. User: student
    3. Password: Student007
    4. Computer name — first syllables of name and surname separated with dash, e.g., val-vit
    5. Language English or Latvian

    Complete setup wizard and log into your computer

1. Computers and binary data

  1. Open terminal and generate your unique id with command:

    head -c 4 /dev/urandom|base64|cut -b -8|tr "+\-/=" "abcd"

    Or get generated one from here

    Save generated string on your local computer and use it as your unique identifier.

    Note, that if you will use guessed string by yourselves, its randomness will be much worse and may not be unique in the class!

1. task

  1. Create plain text file with e.g. mousepad in Xubuntu, or notepad editor in Windows. Create file in form 1234abcd.1.1.txt where 1234abcd is your actual identifier and write your name (if necessary also middle name) and surname in it (and don't write anything else in the file). For example:

    Valdis Vītoliņš

2. task

  1. If necessary, install bindechexascii tool by entering following command in terminal:

    sudo apt install bindechexascii
  2. Convert following text: Vexed nymphs go for quick waltz job. to binary representation, where each bit is shown with 1 or 0 and bytes are delimited with spaces:
    1. Using Linux command line tool:

      bindechexascii --a2b "Vexed nymphs go for quick waltz job."

      or

    2. Using online ASCII,Hex,Binary,Decimal,Base64 converter
  3. Save produced text in file 1234abcd.1.2.txt

3. task

  1. Decode following Base64 ecoded text Rml2ZSBoZXhpbmcgd2l6YXJkIGJvdHMganVtcCBxdWlja2x5Lg== back into ASCII text:
    1. Using Linux command line tool:

      echo "Rml2ZSBoZXhpbmcgd2l6YXJkIGJvdHMganVtcCBxdWlja2x5Lg=="|base64 -d

      or

    2. Using online ASCII,Hex,Binary,Decimal,Base64 converter
  2. Save produced text in file 1234abcd.1.3.txt

Deliveries

  1. Text file 1234abcd.1.1.txt with your name and surname
  2. Text file 1234abcd.1.2.txt with binary encoded message
  3. Text file 1234abcd.1.3.txt with Base64 decoded message

2. Documents and archives

1. task

  1. Download archive file Exercise2.tgz
  2. Extract archive with your preferred archive manager (For Windows users it could be 7-zip). In terminal you can do it with command:

    tar xzf Exercise2.tgz
  3. Find all files in exctracted folders, review and copy their content in the new plain text document. In Bash you can do it in following way:

    for i in $(find -type f); do libreoffice "$i"; done

    in Windows you can find all files and folders with command:

    dir /b/s
  4. Sort lines of collected content in ascending order
  5. Save created document as plain text document in form 1234abcd.2.1.txt

2. task

  1. Use created document 1234abcd.2.1.txt from previous task and convert it to following formats:1.

    PDF document. With LibreOffice you can convert it with following command in terminal:

    libreoffice --headless --convert-to pdf 1234abcd.2.1.txt
    1. If necessary, rename created document 1234abcd.2.1.pdf to 1234abcd.2.2.pdf, e.g. with command in terminal:

      mv 1234abcd.2.1.pdf 1234abcd.2.2.pdf
    2. HTML document. With LibreOffice you can convert it with following command in terminal:

      libreoffice --headless --convert-to html 1234abcd.2.1.txt
    3. If necessary, rename created document 1234abcd.2.1.html to 1234abcd.2.2.html, e.g. with command in terminal:

      mv 1234abcd.2.1.html 1234abcd.2.2.html
  2. Create folder inside folder inside folder, inside folder, ... with following structure:
    Parent folder is named f1, its child folder is f2, its child folder is f3 and so on until folder f100.
    In command line you can do it with following command:

    for i in {1..100}; do mkdir "f$i"; cd "f$i"; done

    In Windows you can do it with command (paste all at once):

    for /l %x in (1, 1, 100) do (
    echo f%x
    mkdir f%x
    cd f%x
    )
  3. Put created PDF and HTML documents, e.g. 1234abcd.2.2.pdf and 1234abcd.2.2.html in the folder f100 (easier to do with drag an drop in graphical file manager, or with Midnight commander
  4. Create Zip archive of created folders and documents, starting with folder f1 (i.e. root folder inside archive should be folder f1). E.g. in command line:

    zip -qr 1234abcd.2.2.zip f1

Workaround for Windows users

  1. Download and install PuTTY
  2. Download and install Midnight Commander for Windows
  3. Make SSH connection to server tools.odo.lv with username and password. Create folders as described before for Linux system.
  4. Copy needed files from your workstation to server tools.odo.lv using Midnight Commander:
    1. Press F9, choose Right and then SFTP link...
    2. write artss@tools.odo.lv in machine name and click OK
    3. write password and click on OK
  5. Copy files from left window showing your local files and folders to right window showing remote files and folders.

Deliveries

  1. Text file in form 1234abcd.2.1.txt with collected and sorted content from extracted documents
  2. Zip archive in form 1234abcd.2.2.zip with 1234abcd.2.2.pdf and 1234abcd.2.2.html files in f1/.../f100 folder of the archive

3. Networking

1. task

  1. On Linux based system, if necessary, install Wireshark on Linux
  2. On Windows download Wireshark Windows package and install it
  3. Prepare terminal and enter following command:1.

    On Linux based system:

    traceroute -m 20 odo.lv
    1. On Windows:

      tracert -h 20 odo.lv
  4. Ensure there is no unrelated network activities happening
  5. Start recording network traffic of active network card
  6. Enter prepared command in terminal and wait till it finishes
  7. Stop recording of network traffic in Wireshark
  8. Save recorded traffic in file with form 1234abcd.3.1.pcapng
  9. Create simple, unformatted text file in form 1234abcd.3.2.txt and describe everything what you have recorded in Wireshark.

2. task

  1. If necessary, on Windows download and install PuTTY and Midnight Commander for Windows
  2. Create SSH connection to the remote server tools.odo.lv:
    1. On Unix-like system system open terminal and enter command:

      ssh artss@tools.odo.lv
    2. On Windows open PuTTY and create new connection to server tools.odo.lv
  3. Ensure you have established remote SSH connection to the server (command prompt should show artss@tools:~$)
  4. Execute following command:

    java -jar encrypt-session.jar "Name Surname"

    where Name Surname is your actual name and surname.

  5. Save generated output e.g. MhtAnXdjllA5OwaRSP0eVAGfpJie9zJJNE3yYpb3YARxCiOsvdheYZqVzFv+l/XG in file 1234abcd.3.3.txt

3. task

  1. On Linux:
    1. If necessary, install Remmina:

      sudo apt-get install remmina
    2. Open Remmina and create new VNC connection with address tools.odo.lv:5901
  2. On Windows
    1. Download FreeRDP package, e.g. WFreeRDP 1.1
    2. Run wfrerdp with command:

      wfreerdp.exe /v:tools.odo.lv
    3. Change port number to 5901, enter password and press OK
    4. You may also download TightVNC and use it for remote connection using VNC protocol.
  3. On remote desktop connection open terminal and execute commands:

    cd
    java -jar encrypt-session.jar "Name Surname"

    where Name Surname is your actual name and surname and 1234abcd is your identifier.

  4. Save generated output e.g. MhtAnXdjllA5OwaRSP0eVAGfpJie9zJJNE3yYpb3YARxCiOsvdheYZqVzFv+l/XG in file 1234abcd.3.4.txt

Error solutions

Server has remedy against brute force password cracking.
If you see "Too many authentication errors" message while connecting through remote desktop (VNC/RDP) connection, you should restart it by running command /home/artss/vnc_restart.sh using SSH connection.
After too many unsuccessful authentication attempts your public IP address will be added to the denied list and you will not be able to connect to the server with any protocol. E.g. if you try to run ping 3.123.45.45 and don't get any response, learn your public IP address e.g. from https://whatismyipaddress.com/ and send it in email to the teacher.

Deliveries

  1. Wireshark traffic file 1234abcd.3.1.pcapng
  2. Text file 1234abcd.3.2.txt with explanation of Wireshark data
  3. Text file 1234abcd.3.3.txt with encrypted SSH session data
  4. Text file 1234abcd.3.4.txt with encrypted RDP/VNC session data

4. Audio

1. task

  1. Set up sound editor of your preferences e.g. Rosegarden or any other sound/MIDI editor.
  2. Get your melody signature (i.e. letters from a till h) from your name and surmame using Latin letters only, e.g. by running command:

    echo "Valdis Vitolins"|egrep -io "[a-h]"
    a
    d
  3. Create project in sound editor from allowed notes (e.g. A and D):
    1. create first track with melody, e.g. using quarter notes
    2. create second track with bass, where notes are 2 octaves lower (and may change slower than for melody)
  4. Create at least 4 bars, and copy notes or add some variations if like
  5. Export project into MIDI file in form 1234abcd.4.1.midi and check, that it can be played by e.g. timidity player

2. task

  1. Use sound recorder and editor, e.g. Audio-recorder and Audacity, and create audio file with content of your preference. If no better ideas, at the beginning of file you can say something like "Helo, my name is Valdis Vītoliņš". Remaining part should not be just noise, but is up to your preferences. It should not contain copyrighted or any similarly legally obstructed material.
  2. Cut file that its playback length is exactly 1 minute.
  3. Export file into FLAC format FLAC in form 1234abcd.4.2.flac
     with following properties:

    Property      Value
    No of channels  1 (monophonic)
    Sample Rate     44100 (Hz)
    Precision       16-bit unsigned
    Duration        60 seconds
    Encoding        FLAC

    On Linux you can check that file is created properly with soxi tool. It should show something like this:

    soxi 1234abcd.4.2.flac

    Input File     : '1234abcd.4.2.flac'
    Channels       : 1
    Sample Rate    : 44100
    Precision      : 16-bit
    Duration       : 00:01:00.00 = 2646000 samples = 4500 CDDA sectors
    File Size      : 1.70M
    Bit Rate       : 227k
    Sample Encoding: 16-bit FLAC
  4. If necessary, change project sample rate to 8kHz and export file into WAV in form 1234abcd.4.3.wav with following properties:

    Property      Value
    No of channels  1 (monophonic)
    Sample Rate     8000 (Hz)
    Precision       8-bit unsigned
    Duration        60 seconds
    Encoding        WAV

    On Linux you can check that file is created properly with soxi tool. It should show something like this:

    soxi 1234abcd.4.3.wav

    Input File     : '1234abcd.4.3.wav'
    Channels       : 1
    Sample Rate    : 8000
    Precision      : 8-bit
    Duration       : 00:01:00.00 = 480000 samples ~ 4500 CDDA sectors
    File Size      : 480k
    Bit Rate       : 64.0k
    Sample Encoding: 8-bit Unsigned Integer PCM

Deliveries

  • MIDI file in form 1234abcd.4.1.midi
  • FLAC file in form 1234abcd.4.2.flac
  • WAV file in form 1234abcd.4.3.wav

5. Imaging

  1. Download file Exercise5.zip and extract it

1. task

  1. Select some of your own private photos with your image and cut out only your image from the photo.
  2. Depending on properties of your image, choose one of extracted image files Spring.jpg, Summer.jpg, Autumn.jpg or Winter.jpg as a background image.
  3. Place your own image in front of chosen background image. To get full credit for exercise, ensure, that it looks natural.
  4. Place your unique identifier in top left corner of the image, e.g. 1234abcd
  5. Export your prepared image in JPG file with dimensions of 1024×768 pixels in form 1234abcd.5.1.jpg
  6. You can check properties of generated file with command:

    identify **1234abcd.5.1.jpg

2. task

  1. Use exported Library.jpg file as bitmap input file for background.
  2. Convert bitmpap file into vectorized form. E.g. in Inkscape:
    1. Choose Path — Vectorize bitmap
    2. In setup choose Colors:16, ...groups...Color
    3. Remove original bitmap image
  3. Place your own image in front of prepared background. Convert your image to vector form and remove original bitmap image as well.
  4. Place your unique identifier in top left corner of the image, e.g. 1234abcd and convert from object to path
  5. Export image as A4 landscape page in SVG format in form 1234abcd.5.2.svg, ensure that background takes all space and there ar no empty spaces in the image.
  6. Check size and content of generated SVG file, to be sure it contains only vector objects

Deliveries

  • Bitmap file in form 1234abcd.5.1.jpg
  • Vector file in form 1234abcd.5.2.svg

6. Video

Use sound recorder and editor, e.g. Cheese and/or SimpleScreenRecorder and Cinelerra CV, Cinlelerra GG or VirtualDubMod and create video file in Ogg format with following properties:

Property      Value
Duration        60 seconds
Video stream:
  Codec         Theora
  Resolution    1024×768
  Aspect ratio  4:3
  Frames/sec    24
Audio stream:
  Channels      1 (Monophonic)
  Codec         Vorbis
  Sample rate   44100 Hz

Content of video file should not be just noise, but otherwise is up to your preferences.

On Linux you can check that file is created properly with ffprobe tool. It should show something like this:

ffprobe -hide_banner 1234abcd.6.1.ogv
...
  Duration: 00:01:00.00, start: 0.000000, bitrate: ...
    Stream #0:0: Video: theora, yuv420p, 1024x768 [SAR 1:1 DAR 4:3], 24 tbr, 24 tbn, 24 tbc
...
    Stream #0:1: Audio: vorbis, 44100 Hz, mono, fltp, 36 kb/s
...

If you are using some editor, which doesn't support output to *.ogv file directly, you may convert produced file to *.ogv format with some of conversion tools, e.g.:

Deliveries

  • Video file in form 1234abcd.6.1.ogv

7. Security

  1. Install GnuPG in Linux or in Windows or Mac
  2. According to the The GNU Privacy Handbook: Getting Started create your own keypair, e.g.:

    gpg --gen-key

    and follow setup wizard.

  3. According to the The GNU Privacy Handbook: Exchanging keys export your public key, e.g.:

    gpg --output 1234abcd.7.1.pub --export "your@email"

    where your@email is your actual email.

  4. Create plain text file in form 1234abcd.txt, write your name and surname, and save it.
  5. According to the The GNU Privacy Handbook: Making and verifying signatures, sign file 1234abcd.txt with your private key, e.g.:

    gpg --output 1234abcd.7.2.sig --sign 1234abcd.txt
  6. Open page https://keys.openpgp.org/search?q=valdis.vitolins@odo.lv, copy and save public key in local file e.g. valdis.vitolins.pub.asc
  7. Import public key from valdis.vitolins.pub.asc. E.g. (if file is saved in the current folder):

    gpg --import valdis.vitolins.pub.asc
  8. According to the The GNU Privacy Handbook: Encrypting and decrypting documents encrypt created file witg GnuPG using public key for valdis.vitolins@odo.lv. E.g.:

    gpg --output 1234abcd.7.3.gpg --encrypt --recipient valdis.vitolins@odo.lv 1234abcd.txt

Deliveries

  • Your public key in form 1234abcd.7.1.pub
  • Signed file with your signature in form 1234abcd.7.2.sig
  • Encrypted file in form 1234abcd.7.3.gpg

8. Databases

  1. Download and install MySQL Workbench
  2. Create connection to the MySQL server over SSH connection as it is described here with following parameters:
    1. Server: tools.odo.lv
    2. Username for SSH and MySQL connections: artss
    3. Password is the same for SSH and MySQL and is given in artss.mii.lv
  3. Open artss database on the server.
  4. Select first records from the hashes table by executing statement:

    SELECT * FROM artss.hashes LIMIT 1;

    Select that record, right click on it, choose Copy row in pop-up menu and paste it in some editor.

  5. Delete chosen record from hashes table by executing statement:

    DELETE FROM artss.hashes WHERE id = ID1;

    where ID1 is actual identifier for chosen record

  6. Select last record from the entries table:

    SELECT * FROM artss.entries ORDER BY id DESC LIMIT 1;
  7. Update next_id field of this entry by executing statement:

    UPDATE artss.entries SET next_id = ID1 WHERE id = ID2;

    where:

    • ID1 is chosen record identifier from hashes table
    • ID2 is record identifier of the last record in the entries table
  8. Create new record in entries table by executing statement:

    INSERT INTO artss.entries (id, hash, your_id) VALUES (ID1, 'aa...aa', '1234');

    where:

    • ID1 is actual identifier for chosen record in hashes table
    • aa...aa is actual hash for chosen record in hashes table
    • 1234 are first four characters of your eight-character identifier
  9. If necessary, search for chosen record in hashes table by executing statement:

    SELECT * FROM artss.hashes where id = ID1;

    where ID1 is chosen record identifier from the hashes table
    and check that no record is returned

  10. Search for your added/modified records in entries table by executing statement:

    SELECT * FROM artss.entries where id = ID1 or next_id = ID1;

    where ID1 is chosen record identifier from the hashes table

  11. Copy and paste selected rows or export them in text file with following format:

    0,aa...aa,0000,1
    1,bb...bb,1234,NULL

    Check that there are no unneeded rows (e.g. field names) and delimiters (e.g. ', ` or ") around values.
    Save file in format 1234abcd.8.1.txt

If you messed up updates/deletion for some of records, create new set of records at the end, that have correct links between them.

Deliveries

  • Text file in form 1234abcd.8.1.txt with list of field values of your updated and created record.

9. Python

  1. Install latest stable environment for Python 3 programming langugage:
    1. On Debian-based Linux distribution:

      sudo apt install python3

      or

    2. Download and install it from https://www.python.org/downloads/
  2. Install Python editor/IDE of your preference e.g. Eric or PyDev
  3. Create file in format 1234abcd.9.1.py, that:

    1. reads two passed parameters, which represents number of month and number of day in month
    2. prints out zodiac sign according to the Tropical date
      N.B overlapping dates belong the previous sign. E.g. March 21 belongs to Pisces as it is shown in example below:

      python3 1234abcd.9.1.py 3 21
      Pisces

Deliveries

  • Python script in form 1234abcd.9.1.py, which prints Zodiac sign for passed month and day

10. Contribution to wikipedia

In this exercise you have to register into wikipedia and contribute some content about topics covered in this course. As information in English there is quite wast, it is recommended to do this in Latvian or other language. You can write something new, or just translate content from English to other language. Don't use jargon. Look for proper terms in dictionaries).

Deliveries

Simple text file in form 1234abcd.10.1.txt with your name and surname and link to contribution of your Wikipedia username (not changed article) to wikipedia.
For example:

https://lv.wikipedia.org/wiki/Special:Contributions/valdisvi

If you already have contributed to wikipedia, only time range of this semester will be considered.

Deliveries

  • File in format 1234abcd.10.1.txt with link to your wikipedia profile

Footnotes

1. On Debian based Linux distributions like Ubuntu and Xubuntu you install ghex with command sudo apt-get install ghex in terminal.

2. On Debian based Linux distributions like Ubuntu and Xubuntu you install GnuPG with command sudo apt-get install gnupg.


Created by Valdis Vītoliņš on 2020-11-18 09:03
Last modified by Valdis Vītoliņš on 2022-09-23 18:17
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License