Compare commits

..

2 Commits

Author SHA1 Message Date
waldek 98125772f3 Merge branch 'master' of ssh://86thumbs.net:3022/waldek/linux_introduction 2022-07-14 11:46:43 +02:00
waldek ba528bd3e1 adds todo over the break 2022-07-14 11:46:16 +02:00
4 changed files with 1298 additions and 12 deletions

33
generate_md.py Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/python3
import re
INPUT = "readme.md"
OUTPUT = "todo_over_the_break.md"
URL = "https://gitea.86thumbs.net/waldek/linux_introduction/src/branch/master/"
if __name__ == "__main__":
with open(INPUT, "r") as fp:
data = []
for line in fp.readlines():
stripped = line.strip()
stripped = stripped.replace("*", "")
stripped = stripped.strip()
if "(./" in stripped:
topic = stripped[stripped.find("[")+1:stripped.find("]")]
url = stripped.replace("(./", "({}".format(URL))
url = re.sub("\[.*\]", "[Link]", url)
url = " * {} to course documentation".format(url)
header = "# {}".format(topic)
notes = "## Student notes:"
data.append(header)
data.append(url)
data.append(notes)
data.append("TODO")
with open(OUTPUT, "w") as fp:
for line in data:
fp.write("{}\n\n".format(line))

11
generate_toc.py Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/usr/bin/python3
import subprocess
@ -8,7 +10,8 @@ INPUT = [
"essential/introduction_to_linux.md",
"essential/introduction_to_the_commandline.md",
"essential/introduction_to_administration.md",
"advanced/learning_bash_scripting.md"
"advanced/learning_bash_scripting.md",
"advanced/learning_shells.md",
]
CMD = "gh-md-toc"
FILTER = "(#"
@ -17,14 +20,16 @@ TITLE = "Table of Contents"
if __name__ == "__main__":
try:
p = subprocess.Popen([CMD], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(CMD.split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate()
except Exception as e:
print("please install {}".format(LINK))
exit()
CONTENT = []
for f in INPUT:
p = subprocess.Popen([CMD, f], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cmd = CMD.split()
cmd.append(f)
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate()
output = output.decode().split("\n")
for line in output:

View File

@ -2,6 +2,7 @@
Welcome!
Essential: introduction to linux
=================
@ -23,7 +24,7 @@ Essential: introduction to linux
* [Exercise](./essential/introduction_to_linux.md#exercise-1)
* [Guest additions](./essential/introduction_to_linux.md#guest-additions)
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
Essential: introduction to the commandline
@ -59,18 +60,27 @@ Essential: introduction to the commandline
* [The hard way](./essential/introduction_to_the_commandline.md#the-hard-way)
* [Exercise](./essential/introduction_to_the_commandline.md#exercise-5)
* [Searching inside files](./essential/introduction_to_the_commandline.md#searching-inside-files)
* [Wildcards and regular expressions](./essential/introduction_to_the_commandline.md#wildcards-and-regular-expressions)
* [Wildcards](./essential/introduction_to_the_commandline.md#wildcards)
* [Wild cards and regular expressions](./essential/introduction_to_the_commandline.md#wild-cards-and-regular-expressions)
* [Wild cards](./essential/introduction_to_the_commandline.md#wild-cards)
* [Exercise](./essential/introduction_to_the_commandline.md#exercise-6)
* [Exercise](./essential/introduction_to_the_commandline.md#exercise-7)
* [Regular expressions](./essential/introduction_to_the_commandline.md#regular-expressions)
* [Pipes and redirects](./essential/introduction_to_the_commandline.md#pipes-and-redirects)
* [Redirecting](./essential/introduction_to_the_commandline.md#redirecting)
* [Input redirection](./essential/introduction_to_the_commandline.md#input-redirection)
* [Piping](./essential/introduction_to_the_commandline.md#piping)
* [Text manipulation](./essential/introduction_to_the_commandline.md#text-manipulation)
* [Ideas](./essential/introduction_to_the_commandline.md#ideas)
* [Exercises](./essential/introduction_to_the_commandline.md#exercises)
* [Mini exercise 1](./essential/introduction_to_the_commandline.md#mini-exercise-1)
* [Mini exercise 2](./essential/introduction_to_the_commandline.md#mini-exercise-2)
* [Mini exercise 3](./essential/introduction_to_the_commandline.md#mini-exercise-3)
* [Mini exercise 4](./essential/introduction_to_the_commandline.md#mini-exercise-4)
* [Mini exercise 5](./essential/introduction_to_the_commandline.md#mini-exercise-5)
* [Mini exercise 6](./essential/introduction_to_the_commandline.md#mini-exercise-6)
* [Ideas](./essential/introduction_to_the_commandline.md#ideas-1)
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
Essential: introduction to administration
@ -92,7 +102,7 @@ Essential: introduction to administration
* [SSH and SFTP](./essential/introduction_to_administration.md#ssh-and-sftp)
* [Bandit](./essential/introduction_to_administration.md#bandit)
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
Advanced: learning bash scripting
@ -105,9 +115,8 @@ Advanced: learning bash scripting
* [With read](./advanced/learning_bash_scripting.md#with-read)
* [Coding challenge - Secret input](./advanced/learning_bash_scripting.md#coding-challenge---secret-input)
* [read multiple variables](./advanced/learning_bash_scripting.md#read-multiple-variables)
* [Exercise - unpack values](./advanced/learning_bash_scripting.md#exercise---unpack-values)
* [With command line arguments](./advanced/learning_bash_scripting.md#with-command-line-arguments)
* [From a file](./advanced/learning_bash_scripting.md#from-a-file)
* [From a pipe](./advanced/learning_bash_scripting.md#from-a-pipe)
* [Coding Challenge - output the exact output below](./advanced/learning_bash_scripting.md#coding-challenge---output-the-exact-output-below)
* [More math!](./advanced/learning_bash_scripting.md#more-math)
* [The let keyword](./advanced/learning_bash_scripting.md#the-let-keyword)
@ -116,17 +125,64 @@ Advanced: learning bash scripting
* [Variable length](./advanced/learning_bash_scripting.md#variable-length)
* [If Statements - How to make decisions within your Bash script.](./advanced/learning_bash_scripting.md#if-statements---how-to-make-decisions-within-your-bash-script)
* [How does it work behind the scenes?](./advanced/learning_bash_scripting.md#how-does-it-work-behind-the-scenes)
* [exit status](./advanced/learning_bash_scripting.md#exit-status)
* [test](./advanced/learning_bash_scripting.md#test)
* [Nested if statements](./advanced/learning_bash_scripting.md#nested-if-statements)
* [Coding challenge - File information](./advanced/learning_bash_scripting.md#coding-challenge---file-information)
* [A <em>modern</em> version of test](./advanced/learning_bash_scripting.md#a-modern-version-of-test)
* [[[ ]]](./advanced/learning_bash_scripting.md#--)
* [(( ))](./advanced/learning_bash_scripting.md#---1)
* [&amp;&amp; and ||](./advanced/learning_bash_scripting.md#-and--)
* [Coding challenge - File information](./advanced/learning_bash_scripting.md#coding-challenge---file-information)
* [Coding challenge - pipe or argument?](./advanced/learning_bash_scripting.md#coding-challenge---pipe-or-argument)
* [Loops - A variety of ways to perform repetitive tasks.](./advanced/learning_bash_scripting.md#loops---a-variety-of-ways-to-perform-repetitive-tasks)
* [while loop](./advanced/learning_bash_scripting.md#while-loop)
* [Read from a file with a while loop](./advanced/learning_bash_scripting.md#read-from-a-file-with-a-while-loop)
* [Read from a pipe with a while loop](./advanced/learning_bash_scripting.md#read-from-a-pipe-with-a-while-loop)
* [for loop](./advanced/learning_bash_scripting.md#for-loop)
* [Counter loops with for](./advanced/learning_bash_scripting.md#counter-loops-with-for)
* [Finicky behaviour](./advanced/learning_bash_scripting.md#finicky-behaviour)
* [break and continue](./advanced/learning_bash_scripting.md#break-and-continue)
* [Coding challenge - pipe or argument plus action!](./advanced/learning_bash_scripting.md#coding-challenge---pipe-or-argument-plus-action)
* [Coding challenge - Rename files](./advanced/learning_bash_scripting.md#coding-challenge---rename-files)
* [Coding challenge - Rename jpeg files](./advanced/learning_bash_scripting.md#coding-challenge---rename-jpeg-files)
* [Coding challenge - Remove duplicate files](./advanced/learning_bash_scripting.md#coding-challenge---remove-duplicate-files)
* [Coding challenge - File tree](./advanced/learning_bash_scripting.md#coding-challenge---file-tree)
* [Coding challenge - Compare and move](./advanced/learning_bash_scripting.md#coding-challenge---compare-and-move)
* [Coding challenge - Guess the number](./advanced/learning_bash_scripting.md#coding-challenge---guess-the-number)
* [Functions - Reuse code to make life easier.](./advanced/learning_bash_scripting.md#functions---reuse-code-to-make-life-easier)
* [defining a function](./advanced/learning_bash_scripting.md#defining-a-function)
* [function arguments](./advanced/learning_bash_scripting.md#function-arguments)
* [global vs local variable](./advanced/learning_bash_scripting.md#global-vs-local-variable)
* [return values](./advanced/learning_bash_scripting.md#return-values)
* [the command builtin](./advanced/learning_bash_scripting.md#the-command-builtin)
* [Coding challenge - Student reports](./advanced/learning_bash_scripting.md#coding-challenge---student-reports)
* [User Interface - Make your scripts user friendly.](./advanced/learning_bash_scripting.md#user-interface---make-your-scripts-user-friendly)
* [Coding challenge - Address book](./advanced/learning_bash_scripting.md#coding-challenge---address-book)
* [Arrays in bash](./advanced/learning_bash_scripting.md#arrays-in-bash)
* [Python](./advanced/learning_bash_scripting.md#python)
* [Vim as an IDE](./advanced/learning_bash_scripting.md#vim-as-an-ide)
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
Advanced: learning shells
=================
* [bash login](./advanced/learning_shells.md#bash-login)
* [which files are sources when](./advanced/learning_shells.md#which-files-are-sources-when)
* [A clean slate](./advanced/learning_shells.md#a-clean-slate)
* [Prompt customization](./advanced/learning_shells.md#prompt-customization)
* [Saving our changes](./advanced/learning_shells.md#saving-our-changes)
* [Decoding the <em>base</em> prompt](./advanced/learning_shells.md#decoding-the-base-prompt)
* [Alternative shells](./advanced/learning_shells.md#alternative-shells)
* [zsh](./advanced/learning_shells.md#zsh)
* [fish](./advanced/learning_shells.md#fish)
* [xonsh](./advanced/learning_shells.md#xonsh)
* [Shell completion](./advanced/learning_shells.md#shell-completion)
* [Frameworks](./advanced/learning_shells.md#frameworks)
* [oh my zsh](./advanced/learning_shells.md#oh-my-zsh)
* [oh my bash](./advanced/learning_shells.md#oh-my-bash)
* [xxh](./advanced/learning_shells.md#xxh)
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)

1192
todo_over_the_break.md Normal file

File diff suppressed because it is too large Load Diff