Autosave: 2024-06-16 18:30:03

This commit is contained in:
thomasabishop 2024-06-16 18:30:03 +01:00
parent ba93ba0ea1
commit 28702c732d
70 changed files with 86 additions and 54 deletions

View file

@ -52,7 +52,7 @@ const courses = [
We first create an instance of Express within `index.js`. This will be the main We first create an instance of Express within `index.js`. This will be the main
coordinating file and we will aim to minimise the amount of business logic we coordinating file and we will aim to minimise the amount of business logic we
have in this file. It should really just be for initialization and managing have in this file. It should really just be for initialization and managing
[middleware](Middleware.md). [middleware](Middleware_in_NodeJS.md).
```js ```js
const express = require("express"); const express = require("express");

View file

@ -9,7 +9,7 @@ tags:
The primary or boot The primary or boot
[partition](Disks.md#primary-extended-and-logical-partitions) of a harddisk [partition](Disks.md#primary-extended-and-logical-partitions) of a harddisk
contains a bootloader. It is the job of the bootloader to locate the contains a bootloader. It is the job of the bootloader to locate the
[kernel](The_Kernel.md) on the harddrive and inject it into [kernel](The_kernel.md) on the harddrive and inject it into
memory so that they operating system can start. This is the boot process. memory so that they operating system can start. This is the boot process.
## Boot loaders ## Boot loaders

View file

@ -10,7 +10,7 @@ tags:
At the core of a computer sits the Central Processing Unit. This is the assembly At the core of a computer sits the Central Processing Unit. This is the assembly
of chips that execute all computation. Instructions are passed to the CPU along of chips that execute all computation. Instructions are passed to the CPU along
the data bus part of the [system bus](Bus.md) from the the data bus part of the [system bus](Bus.md) from the
memory. The [kernel](The_Kernel.md), also residing in memory, memory. The [kernel](The_kernel.md), also residing in memory,
sequences and schedules the sending of data to the CPU and manages requests from sequences and schedules the sending of data to the CPU and manages requests from
the CPU for data in memory. the CPU for data in memory.
@ -96,7 +96,7 @@ Hz a processor possesses.
## Processing cycles ## Processing cycles
Each "cycle" is the execution of a process that commences once the Each "cycle" is the execution of a process that commences once the
[kernel](The_Kernel.md) hands control to the CPU. Each cycle [kernel](The_kernel.md) hands control to the CPU. Each cycle
follows a sequence of events known as follows a sequence of events known as
[fetch, decode, and execute](Fetch_decode_execute.md). [fetch, decode, and execute](Fetch_decode_execute.md).

View file

@ -5,7 +5,7 @@ tags:
# Capturing user input in Bash # Capturing user input in Bash
We use [read](Read.md) to gather user input. We use [read](Read_command%20_in_Bash.md) to gather user input.
## Capturing raw inputs ## Capturing raw inputs

View file

@ -31,7 +31,7 @@ increased the speed of transport.
particular implementation of containerization that simplifies the process and particular implementation of containerization that simplifies the process and
bases it on a standardised specification. bases it on a standardised specification.
- Containers are native to the Linux [kernal](The_Kernel.md) - Containers are native to the Linux [kernal](The_kernel.md)
and are key part of how it works. Thus when you run containers on Linux, you and are key part of how it works. Thus when you run containers on Linux, you
are using native capability. When you use containers on Windows or Mac you are using native capability. When you use containers on Windows or Mac you
have to run a virtual version of Linux in order to exploit the capabilities of have to run a virtual version of Linux in order to exploit the capabilities of

View file

@ -58,7 +58,7 @@ Node is continually monitoring the Event Loop in the background.
A running Node application is a single running process. Like everything that A running Node application is a single running process. Like everything that
happens within the OS, a process is managed by the happens within the OS, a process is managed by the
[kernel](The_Kernel.md) that dispatches operations to the CPU [kernel](The_kernel.md) that dispatches operations to the CPU
in a clock cycle. A thread is a sequence of code that resides within the process in a clock cycle. A thread is a sequence of code that resides within the process
and utilises its memory pool (the amount of memory assigned by the kernel to the and utilises its memory pool (the amount of memory assigned by the kernel to the
Node process). The Event Loop runs on CPU ticks: a tick is a single run of the Node process). The Event Loop runs on CPU ticks: a tick is a single run of the

View file

@ -14,7 +14,7 @@ File descriptors are shorthand for `stdin`, `stdout` and `stderr`:
| 2 | Standard error | `stderr` | | 2 | Standard error | `stderr` |
They are typically used when you want to They are typically used when you want to
[redirect](Redirection.md) the output of the [redirect](Redirection_in_Bash.md) the output of the
standard/input /output/error somewhere, e.g a file or as input to another standard/input /output/error somewhere, e.g a file or as input to another
program. A classic case is `[some_command] > /dev/null 2>&1` program. A classic case is `[some_command] > /dev/null 2>&1`

View file

@ -135,7 +135,7 @@ Most standard partition tables allow for primary, extended and logical
partitions. The primary partition is the part of the harddisk that contains the partitions. The primary partition is the part of the harddisk that contains the
operating system and is thus described as 'bootable' and may be called the 'boot operating system and is thus described as 'bootable' and may be called the 'boot
partition'. During the bootstrapping process this is injected into memory as the partition'. During the bootstrapping process this is injected into memory as the
[kernel](The_Kernel.md). [kernel](The_kernel.md).
The extended partition is basically everything other than the primary partition. The extended partition is basically everything other than the primary partition.
This is typically subdivided into other partitions that are called _logical_ This is typically subdivided into other partitions that are called _logical_

View file

@ -161,4 +161,4 @@ done
``` ```
We are leveraging this aspect of Bash when we We are leveraging this aspect of Bash when we
[loop through each character in a string](Strings_in_bash.md#loop-through-each-character-in-a-string). [loop through each character in a string](Strings_in_Bash.md#loop-through-each-character-in-a-string).

View file

@ -1,7 +1,11 @@
--- ---
id: iqh8 id: iqh8
title: Machine_code title: Machine_code
tags: [binary, CPU] tags:
- binary
- CPU
- hardware
- computer-architecture
created: Monday, March 11, 2024 created: Monday, March 11, 2024
--- ---

View file

@ -70,7 +70,7 @@ It would make more sense to run this only in development.
### Accessing current Node environment ### Accessing current Node environment
We can control which middleware we run via the Node envrionment variables: We can control which middleware we run via the Node envrionment variables:
`process.env` (see for instance [ports](Ports.md)). `process.env` (see for instance [ports](Ports_in_NodeJS.md)).
We could set We could set
[Morgan](Morgan.md) to run [Morgan](Morgan.md) to run

View file

@ -1,5 +1,7 @@
--- ---
tags: [OOP] tags:
- OOP
- design-patterns
--- ---
# Module pattern # Module pattern

View file

@ -16,7 +16,7 @@ immediately-invoked function expression that has the following parameters:
This is called the **module wrapper function** This is called the **module wrapper function**
Note that one of these parameters is the Note that one of these parameters is the
[module object](Modules.md#structure-of-a-module). [module object](Modules_in_NodeJS.md#structure-of-a-module).
Within any module we can access these parameters: you can think of them as Within any module we can access these parameters: you can think of them as
metadata about the module itself. `__filename` and `__dirname` are particularly metadata about the module itself. `__filename` and `__dirname` are particularly

View file

@ -136,7 +136,7 @@ gives me some useful info about which files VS Code is using:
## System calls: `strace` ## System calls: `strace`
A system call is when a process requests a service from the A system call is when a process requests a service from the
[kernel](The_Kernel.md), for instance an I/O operation to [kernel](The_kernel.md), for instance an I/O operation to
memory. We can trace these system calls with `strace`. memory. We can trace these system calls with `strace`.
## CPU performance ## CPU performance

View file

@ -1,5 +1,6 @@
--- ---
tags: [] tags:
- design-patterns
--- ---
# Multiple pointers # Multiple pointers

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- logic
- propositional-logic
--- ---
# Negation Elimination # Negation Elimination

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- logic
- propositional-logic
--- ---
# Negation Introduction # Negation Introduction

View file

@ -1,5 +1,8 @@
--- ---
tags: [python, APIs] tags:
- python
- APIs
- networks
--- ---
# Making network requests in Python # Making network requests in Python

View file

@ -137,7 +137,7 @@ docker-compose -up
In the example, the database connection information in the Node source is coming In the example, the database connection information in the Node source is coming
from the from the
[`process.env`](Managing_environments.md) [`process.env`](Managing_environments_in_NodeJS.md)
object, which itself is sourcing the values `MYSQL_HOST`, `MYSQL_PASSWORD` etc object, which itself is sourcing the values `MYSQL_HOST`, `MYSQL_PASSWORD` etc
from the Docker compose file. Therefore these values are hardcoded there. from the Docker compose file. Therefore these values are hardcoded there.

View file

@ -1,5 +1,7 @@
--- ---
tags: [OOP] tags:
- OOP
- design-patterns
--- ---
# Observer pattern # Observer pattern

View file

@ -1,5 +1,8 @@
--- ---
tags: [] tags:
- Linux
- procedural
- arch-linux
--- ---
# Pacman # Pacman

View file

@ -1,7 +1,8 @@
--- ---
id: 3hcv0amc id: 3hcv0amc
title: Printing values in C title: Printing values in C
tags: [] tags:
- C
created: Thursday, February 29, 2024 | 17:33 created: Thursday, February 29, 2024 | 17:33
--- ---

View file

@ -16,7 +16,7 @@ the terminal and exit the current process.
## Managing runtime environments ## Managing runtime environments
See See
[Managing Environments](Managing_environments.md). [Managing Environments](Managing_environments_in_NodeJS.md).
## Accessing arguments: `process.argv` ## Accessing arguments: `process.argv`

View file

@ -1,11 +1,12 @@
--- ---
tags: tags:
- shell - shell
- Linux
--- ---
# Processes (`ps`) # Processes (`ps`)
`ps` allows us to control [user processes](The_Kernel.md) `ps` allows us to control [user processes](The_kernel.md)
from the shell. from the shell.
The command in its most minimal application returns the following The command in its most minimal application returns the following

View file

@ -11,7 +11,7 @@ piped to it. In each case, what is read is stored as a variable.
`read` will parse line by line using a space (`\n`) as the default delimiter. `read` will parse line by line using a space (`\n`) as the default delimiter.
You can use IFS to parse by other characters and/or You can use IFS to parse by other characters and/or
[split the contents into an array](Split_into_array.md). [split the contents into an array](Split_into_array_in_Bash.md).
## Example of capturing user input ## Example of capturing user input

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- logic
- propositional-logic
--- ---
# Reiteration # Reiteration

View file

@ -2,6 +2,7 @@
tags: tags:
- kernel - kernel
- CPU - CPU
- computer-architecture
--- ---
# Relation between the kernel and CPU # Relation between the kernel and CPU

View file

@ -1,5 +1,6 @@
--- ---
tags: [] tags:
- databases
--- ---
# Relational database architecture # Relational database architecture

View file

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- Linux
- procedural
--- ---
# Save read only Vim file # Save read only Vim file

View file

@ -1,7 +0,0 @@
---
tags: [shell]
---
# Linux shell commands cheat-sheet
## CPU

View file

@ -1,6 +1,7 @@
--- ---
tags: tags:
- binary - binary
- hardware
--- ---
# Signed and unsigned numbers # Signed and unsigned numbers

View file

@ -1,5 +1,7 @@
--- ---
tags: [OOP] tags:
- OOP
- design-patterns
--- ---
# Singleton pattern # Singleton pattern

View file

@ -1,5 +1,6 @@
--- ---
tags: [] tags:
- design-patterns
--- ---
# Sliding window # Sliding window

View file

@ -1,7 +0,0 @@
---
tags: [python, data-types]
---
# Standard input and output
https://www.youtube.com/watch?v=kqtD5dpn9C8&ab_channel=ProgrammingwithMosh

View file

@ -2,6 +2,8 @@
tags: tags:
- memory - memory
- disks - disks
- Linux
- operating-systems
--- ---
# Swap space # Swap space
@ -31,7 +33,7 @@ Swap: 3145724 0 3145724
To use an existing disk partition as a swap you can run the command To use an existing disk partition as a swap you can run the command
`mkswap [device]` and then `swapon [device]` to register the space with the `mkswap [device]` and then `swapon [device]` to register the space with the
[kernel](The_Kernel.md). [kernel](The_kernel.md).
### Add to `fstab` ### Add to `fstab`

View file

@ -1,6 +1,8 @@
--- ---
tags: tags:
- shell - shell
- Linux
- procedural
--- ---
> A symbolic link, also termed a soft link, is a special kind of file that > A symbolic link, also termed a soft link, is a special kind of file that

View file

@ -1,5 +1,8 @@
--- ---
tags: [systems-programming, memory] tags:
- systems-programming
- memory
- computer-architecture
--- ---
# The Kernel # The Kernel

View file

@ -1,5 +1,8 @@
--- ---
tags: [logic-gates, binary] tags:
- logic-gates
- binary
- electronics
--- ---
# Transistors # Transistors

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- logic
- propositional-logic
--- ---
# Truth-tables # Truth-tables

View file

@ -1,5 +1,7 @@
--- ---
tags: [] tags:
- logic
- propositional-logic
--- ---
## Rationale ## Rationale

View file

@ -3,6 +3,7 @@ id: gktb
title: Two's complement title: Two's complement
tags: tags:
- binary - binary
- hardware
created: Tuesday, March 19, 2024 created: Tuesday, March 19, 2024
--- ---

View file

@ -6,7 +6,7 @@ tags:
# Type narrowing and guarding # Type narrowing and guarding
Type narrowing is the process of working out from a supertype like Type narrowing is the process of working out from a supertype like
[any](Any.md) or [unknown](Unknown.md) whic type the value should be in the [any](Any.md) or [unknown](Unknown_type_in_TS.md) whic type the value should be in the
x course of your code. This is necessary since a process will not necessarily x course of your code. This is necessary since a process will not necessarily
always return or involve homogenous types. always return or involve homogenous types.

View file

@ -23,7 +23,7 @@ app.listen(8080, () =>
## Add GraphQL as middlewear ## Add GraphQL as middlewear
Next we introduce GraphQL as a piece of Node.js Next we introduce GraphQL as a piece of Node.js
[middlewear](Middleware.md), with the [middlewear](Middleware_in_NodeJS.md), with the
`app.use()` method. `app.use()` method.
```js ```js

View file

@ -97,4 +97,4 @@ fs.rmSync("/dir", { recursive: true, force: true });
## Streams ## Streams
See [Handling streams with fs](Streams.md) See [Handling streams with fs](Streams_in_NodeJS.md)

View file

@ -9,7 +9,7 @@ tags:
`journald` is a program that comes as default with [systemd](systemd.md). It is `journald` is a program that comes as default with [systemd](systemd.md). It is
a service for collecting and storing system-level log data. I keeps a track of a service for collecting and storing system-level log data. I keeps a track of
all [kernel](The_Kernel.md) processes. It is invaluable when tracing the source all [kernel](The_kernel.md) processes. It is invaluable when tracing the source
of problems and errors that may arise on the system level. It keeps a track of of problems and errors that may arise on the system level. It keeps a track of
all kernal processes. all kernal processes.