Daily Log

2021-03-04

2021-03-05

From Linux Basics (PDF)

  • Bausteine von Unix und Linux

    5-7, 9-16

  • Die Shell (Bash - “Bourne Again Shell”)

    36-45, 58-61, 63, 64

2021-03-18

From Linux Basics (PDF)

  • Das Filesystem

    Es ist wichtig, im Filesystem navigieren zu können. Die Basic Tools müssen sitzen (cd, ls, pwd, mkdir, rm, cp, mv, etc.). (Dazu muss man natürlich verstehen, was Files, Directories etc. sind.)

    Das Permission-Thema ist extrem wichtig, und man kann damit rechnen, dass zur Prüfung ein paar trockene Fragen zu dem Thema kommen.

    • Pfade: 67-71

    • Directories: 72-76

    • Symbolische Links: 77-79

    • Directory Listings (ls): 84-87

    • Kopieren und Verschieben (cp und mv): 88-91

    • Owner, Permissions: 92-97, 100

2021-03-26

  • Das Filesystem

    • Permissions

      • Die umask: 98-99

      • Tools für Permissions: 100

      • Set-UID Bit: 101

      • Sticky Bit: 102

    • Das find Command: 105-109

  • Tools für Textfiles: 113ff.

    Das Kapitel wurde ansatzweise durchgegangen - jedes Tool. Wichtig ist, zu verstehen,

    • dass die Tools von Standard Input lesen, auf Standard Output schreiben (und auf Standard Error Fehler und Debug-Messages schreiben).

    • dass diese und andere Tools durch die Benutzung von Standard Input und Standard Output in der Pipe

  • IO Redirection und Pipes: 133ff.

    Dieses Kapitel wurde in einem mit den Tools durchgemacht, ansatzweise.

    Wichtig ist mir, dass die Wirkungsweise der Pipe verstanden wird, und dass man Tools mit ihrer Hilfe verknüpfen kann.

2021-04-15

2021-04-21

Git Intro

Github

  • Private repository on Github: https://github.com/jfasch/FH-ECE-19

  • Create Github account, and send it to jf@faschingbauer.co.at

  • Clone the repository

    $ cd directory-where-i-have-my-ec-work
    $ git clone https://github.com/jfasch/FH-ECE-19.git
    
  • If you are getting tired of entering a password for each repo transaction, you can always deploy a SSH public key to Github, and then re-clone using the SSH access method:

    $ git clone git@github.com:jfasch/FH-ECE-19.git
    

Python

Notebook Structure

Notebook Download

Notebook: Datatypes

2021-04-29

  • Raspi Lab Setup

  • GPIO demo, using an LED

  • OneWire demo, using one of those DS18B20 sensors.

../../../../../_images/Bullshit-Bingo-G2.jpg

Topics of interest, from Group 2

2021-05-10

Org Stuff

  • Course documentation

    • Notebooks now maintained here (moved over from Github) (see here)

  • Github

    • Repo made private

    • FH VPN? Gitlab?

Python: Functions

Course Material

Notebook Structure

Notebook Download

Notebook: Functions

2021-05-12

Python: Walk-Through Passing and Failing an Exam

Writing a checker for the exercise (live hacking).

Course Material

Notebook Structure

Notebook Download

(void)

Notebook: Checker Explanations

Further Information

2021-05-{19,20}

Course Material

Notebook

Notebook Download

Notebook: 2021-05-20 (G2)

Reiterating on Exercise

Exercise: Digit to English Word

  • Hashbang: #!/usr/bin/python

    • (Student1): missing

      • Program is run as a shell script

      • Why does it take so long? Turns out that import is a screenshot command.

    • Anzhelika Chernykh: #!usr/bin/python

  • (Student2)

    d = dict()
    d = {0: 'zero', 1: 'one', 2: 'two', 3: 'three',4: 'four',5: 'five', 6: 'six', 7: 'seven', 8:'eight', 9: 'nine'}
    
  • (Student3)

    if __name__ == "__main__":
        main()
    

import argparse

In checker-digit

  • overcome those undescriptive IndexError messages when a user fails to pass the correct arguments.

  • Optional argument: --python (a contribution to Doze users)

2021-05-21

Exercise digit (Once More)

(Exercise: Digit to English Word)

  • Make it executable

    On Linux,

    $ chmod 755 digit
    $ git add digit
    

    On Doze (there is no such execute permissions),

    $ git update-index --chmod=+x digit
    

    (found on Stackoverflow)

  • Windows: hashbang and CRLF massacre

    • “Executable” definition: .py vs. 755

    • 755 ⟶ hash bang

    • Windows CRLF: #!/usr/bin/python^M

    • Interpreter path: /usr/bin/python does not exist on Windows

    • \r\n massacre, especially inside hashbang line

  • Linux: Why do I have to say, ./digit ?

Modules

  • Modules and Packages

  • What’s this?

    if __name__ == '__main__':
        ...
    
  • Live-hack it: externalize students list into module

Encoding

  • Encoding

  • Re-iterate on exercise’s use when capturing stdout.

Notebook

Course Material

Notebook

Notebook Download

Notebook: 2021-05-21

2021-06-01

sysfs GPIO: Blinking an LED

2021-06-07

Trial exam (see here)

Missing questions:

  • stdin and stdout and their relationship to the pipe. stderr.

  • SSH, password vs. key based authentication

  • Python: what to ask?