Lecture 25 - Course Revision
Source: The Turing Way Community (2025)
FF = 11111111 = 255)#FF0000) and memory addressesLanguages bridge human instructions and machine execution:
Core commands:
pwd: Print Working Directory (shows current location)ls: List directory contents (ls -l for details, ls -a for hidden files)cd <directory>: Change Directory (cd .. up, cd ~ home)mkdir <name>: Make Directorytouch <name>: Create empty file / update timestampcp <source> <dest>: Copy file/directory (-r for directories)mv <source> <dest>: Move or Rename file/directoryrm <file>: Remove file (permanently!)rmdir <empty_dir>: Remove empty directoryrm -r <dir>: Remove directory recursively (DANGEROUS! No undo)cat <file>: display entire filehead <file> / tail <file>: first/last lines (-n #)wc <file>: count lines, words, charactersgrep <pattern> <file>: search with regular expressions
-i (ignore case), -r (recursive), -n (line numbers), -v (invert)find <path> [options]: search tool
-name <pattern>: by name (quote patterns with *)-iname <pattern>: case-insensitive-type d / -type f: directories / files-size +1M: files larger than 1 MB* (any characters), ? (single character)Source: Julia Evans (2024)
>: write output to file (overwrites)>>: append output to file<: read input from file|: chain commands; left output becomes right input (e.g., ls -l | grep "Jan").sh file for automation
#!/bin/bash (shebang)chmod +x script.sh./script.shgit add <file> → Staging Areagit commit -m "message" → Repositorygit status, git add, git checkout, git commit, git diff, git log, git pull, git pushSource: Atlassian
GitHub: a central remote repository (origin) for sharing code
Key commands:
git push: upload local commits to the remotegit commit: record changes locallygit pull: download and merge remote changes.gitignore: tells Git which files to skip
Other GitHub features:
maingit checkout -b feature-x), commit, then merge back (git checkout main, git merge feature-x)Read more: Git Branching
.qmd or .ipynb) → HTML, PDF, Word, slides, websites, booksA typical Quarto (.qmd) document includes:
--- marks; sets metadata (title, author, date) and output format$...$, $$...$$){python}) with #| options for execution, visibility, figures, etc.quarto render mydoc.qmdYou can also use Quarto for:
[@citekey], needs .bib)@fig-label)WebUI GitHub repository: https://github.com/browser-use/web-ui
.pem file)ssh with your .pem key (set chmod 400 key.pem first)
ssh -i key.pem ubuntu@<public-ip-or-dns>apt package manager
sudo apt update → refresh package listssudo apt upgrade → install updatessudo apt install <package-name> → install softwarescp): copy files to/from EC2
scp -i key.pem local_file ubuntu@ip:/remote/path (local → remote)scp -i key.pem ubuntu@ip:/remote/file ./local/path (remote → local)Core commands:
CREATE TABLE: Define table schema (columns, data types like INTEGER, TEXT, REAL)INSERT INTO: Add new rowsSELECT: Retrieve data (SELECT cols FROM table WHERE condition ORDER BY col)UPDATE: Modify existing rows (UPDATE table SET col = val WHERE condition)DELETE FROM: Remove rows (DELETE FROM table WHERE condition)ALTER TABLE: Modify table structureDROP TABLE: Delete a tableGoing beyond basic queries:
WHERE): operators (=, >, LIKE, IN, BETWEEN, IS NULL) + logic (AND, OR)GROUP BY): group rows, apply functions (COUNT, SUM, AVG); filter with HAVINGINNER JOIN, LEFT JOIN) on related columnsSELECT statementsRANK() OVER (...), AVG(...) OVER (PARTITION BY ...)), keeping individual rowsSUBSTR, LENGTH, REPLACE, || (concatenation)CASE WHEN condition THEN result ... ELSE default ENDjoblib: simple single-machine parallelism (Parallel, delayed)dask: scalable parallel/distributed computingvenv, conda): isolate project packages, prevent conflicts
requirements.txt (pip) or environment.yml (conda)FROM, RUN, COPY, etc.) to build the imageBasic workflow:
docker build -t myimage:latest .docker run -p 8888:8888 -v $(pwd):/app myimage:latest
-p: port mapping (host:container)-v: volume mount (host:container) for persistent data-it: interactive terminaldocker push / docker pull (via Docker Hub or other registry)Example Dockerfile