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

Course material

cluster_python Python Programming: From Absolute Beginner to Advanced Productivity cluster_python_basics Python: The Language Fundamentals cluster_python_exercises Exercises cluster_python_exercises_legacy Exercises (Legacy) python_basics_python_0140_variables Variables python_basics_python_0130_syntax_etc Syntax etc. python_basics_python_0140_variables->python_basics_python_0130_syntax_etc python_basics_python_0150_datatypes_overview_compound Compound Datatypes python_basics_python_0150_datatypes_overview Datatypes python_basics_python_0150_datatypes_overview_compound->python_basics_python_0150_datatypes_overview python_basics_python_0120_helloworld Hello World python_basics_python_0130_syntax_etc->python_basics_python_0120_helloworld python_basics_python_0110_blahblah Blahblah python_basics_python_0125_running Running Python Programs python_basics_python_0125_running->python_basics_python_0120_helloworld python_basics_python_0139_commandline_argv Commandline Arguments (sys.argv) python_basics_python_0139_commandline_argv->python_basics_python_0130_syntax_etc python_basics_python_0139_commandline_argv->python_basics_python_0125_running python_basics_python_0150_datatypes_overview->python_basics_python_0140_variables python_basics_python_0120_helloworld->python_basics_python_0110_blahblah python_exercises_legacy_dict_keyerror Exercise: Dictionary: Errors? python_exercises_legacy_dict_keyerror->python_basics_python_0150_datatypes_overview_compound python_exercises_legacy_cmdline_digit Exercise: Digit to English Word python_exercises_legacy_cmdline_digit->python_basics_python_0150_datatypes_overview_compound python_exercises_legacy_cmdline_digit->python_basics_python_0139_commandline_argv python_exercises_legacy_cmdline_digit->python_basics_python_0120_helloworld python_exercises_legacy_cmdline_digit->python_exercises_legacy_dict_keyerror

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)

    • Topic dependency graphs inserted in random locations (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)

Exercise

cluster_python Python Programming: From Absolute Beginner to Advanced Productivity cluster_python_basics Python: The Language Fundamentals cluster_ece19 ECE19: Exercises and Custom Topics python_basics_python_0200_sequential_types Sequential Datatypes python_basics_python_0150_datatypes_overview_compound Compound Datatypes python_basics_python_0200_sequential_types->python_basics_python_0150_datatypes_overview_compound python_basics_python_0300_strings More About Strings python_basics_python_0300_strings->python_basics_python_0200_sequential_types python_basics_python_0150_datatypes_overview Datatypes python_basics_python_0300_strings->python_basics_python_0150_datatypes_overview python_basics_python_0250_refs_flat_deep_copy References, (Im)mutability python_basics_python_0300_strings->python_basics_python_0250_refs_flat_deep_copy python_basics_python_0330_strings_encoding Strings and Encoding python_basics_python_0330_strings_encoding->python_basics_python_0300_strings python_basics_python_0120_helloworld Hello World python_basics_python_0110_blahblah Blahblah python_basics_python_0120_helloworld->python_basics_python_0110_blahblah python_basics_python_0140_variables Variables python_basics_python_0150_datatypes_overview->python_basics_python_0140_variables python_basics_python_0170_if The if Statement python_basics_python_0160_boolean Boolean python_basics_python_0170_if->python_basics_python_0160_boolean python_basics_python_0130_syntax_etc Syntax etc. python_basics_python_0140_variables->python_basics_python_0130_syntax_etc python_basics_python_0220_for for Loops python_basics_python_0220_for->python_basics_python_0200_sequential_types python_basics_python_0193_while while Loops python_basics_python_0220_for->python_basics_python_0193_while python_basics_python_0193_while->python_basics_python_0170_if python_basics_python_0193_while->python_basics_python_0160_boolean python_basics_python_0500_files File I/O python_basics_python_0500_files->python_basics_python_0330_strings_encoding python_basics_python_0500_files->python_basics_python_0220_for python_basics_python_0160_boolean->python_basics_python_0150_datatypes_overview python_basics_python_0130_syntax_etc->python_basics_python_0120_helloworld python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0150_datatypes_overview python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0140_variables python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0150_datatypes_overview_compound python_basics_python_0150_datatypes_overview_compound->python_basics_python_0150_datatypes_overview ece19_blinklicht_abc GPIO: Blinklicht Interface ece19_blinklicht_oo GPIO: Object Oriented Blinklicht ece19_blinklicht_abc->ece19_blinklicht_oo ece19_blinklicht GPIO: Blinklicht ece19_blinklicht_oo->ece19_blinklicht ece19_file_read Reading a File ece19_blinklicht->ece19_file_read ece19_file_read->python_basics_python_0500_files ece19_blinklicht_unittest GPIO: Blinklicht Unittests ece19_blinklicht_unittest->ece19_blinklicht_abc

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

cluster_python Python Programming: From Absolute Beginner to Advanced Productivity cluster_python_basics Python: The Language Fundamentals cluster_ece19 ECE19: Exercises and Custom Topics python_basics_python_0170_if The if Statement python_basics_python_0160_boolean Boolean python_basics_python_0170_if->python_basics_python_0160_boolean python_basics_python_0140_variables Variables python_basics_python_0130_syntax_etc Syntax etc. python_basics_python_0140_variables->python_basics_python_0130_syntax_etc python_basics_python_0200_sequential_types Sequential Datatypes python_basics_python_0150_datatypes_overview_compound Compound Datatypes python_basics_python_0200_sequential_types->python_basics_python_0150_datatypes_overview_compound python_basics_python_0150_datatypes_overview Datatypes python_basics_python_0160_boolean->python_basics_python_0150_datatypes_overview python_basics_python_0150_datatypes_overview_compound->python_basics_python_0150_datatypes_overview python_basics_python_0220_for for Loops python_basics_python_0220_for->python_basics_python_0200_sequential_types python_basics_python_0193_while while Loops python_basics_python_0220_for->python_basics_python_0193_while python_basics_python_0120_helloworld Hello World python_basics_python_0130_syntax_etc->python_basics_python_0120_helloworld python_basics_python_0193_while->python_basics_python_0170_if python_basics_python_0193_while->python_basics_python_0160_boolean python_basics_python_0250_refs_flat_deep_copy References, (Im)mutability python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0140_variables python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0150_datatypes_overview_compound python_basics_python_0250_refs_flat_deep_copy->python_basics_python_0150_datatypes_overview python_basics_python_0110_blahblah Blahblah python_basics_python_0300_strings More About Strings python_basics_python_0300_strings->python_basics_python_0200_sequential_types python_basics_python_0300_strings->python_basics_python_0250_refs_flat_deep_copy python_basics_python_0300_strings->python_basics_python_0150_datatypes_overview python_basics_python_0330_strings_encoding Strings and Encoding python_basics_python_0330_strings_encoding->python_basics_python_0300_strings python_basics_python_0150_datatypes_overview->python_basics_python_0140_variables python_basics_python_0120_helloworld->python_basics_python_0110_blahblah python_basics_python_0500_files File I/O python_basics_python_0500_files->python_basics_python_0220_for python_basics_python_0500_files->python_basics_python_0330_strings_encoding ece19_blinklicht GPIO: Blinklicht ece19_file_read Reading a File ece19_blinklicht->ece19_file_read ece19_file_read->python_basics_python_0500_files

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?