Autosave: 2024-06-16 18:30:03
This commit is contained in:
parent
ba93ba0ea1
commit
28702c732d
70 changed files with 86 additions and 54 deletions
|
@ -52,7 +52,7 @@ const courses = [
|
|||
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
|
||||
have in this file. It should really just be for initialization and managing
|
||||
[middleware](Middleware.md).
|
||||
[middleware](Middleware_in_NodeJS.md).
|
||||
|
||||
```js
|
||||
const express = require("express");
|
||||
|
|
|
@ -9,7 +9,7 @@ tags:
|
|||
The primary or boot
|
||||
[partition](Disks.md#primary-extended-and-logical-partitions) of a harddisk
|
||||
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.
|
||||
|
||||
## Boot loaders
|
||||
|
|
|
@ -10,7 +10,7 @@ tags:
|
|||
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
|
||||
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
|
||||
the CPU for data in memory.
|
||||
|
||||
|
@ -96,7 +96,7 @@ Hz a processor possesses.
|
|||
## Processing cycles
|
||||
|
||||
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
|
||||
[fetch, decode, and execute](Fetch_decode_execute.md).
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ tags:
|
|||
|
||||
# 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
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ increased the speed of transport.
|
|||
particular implementation of containerization that simplifies the process and
|
||||
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
|
||||
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
|
||||
|
|
|
@ -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
|
||||
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
|
||||
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
|
||||
|
|
|
@ -14,7 +14,7 @@ File descriptors are shorthand for `stdin`, `stdout` and `stderr`:
|
|||
| 2 | Standard error | `stderr` |
|
||||
|
||||
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
|
||||
program. A classic case is `[some_command] > /dev/null 2>&1`
|
||||
|
||||
|
|
|
@ -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
|
||||
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
|
||||
[kernel](The_Kernel.md).
|
||||
[kernel](The_kernel.md).
|
||||
|
||||
The extended partition is basically everything other than the primary partition.
|
||||
This is typically subdivided into other partitions that are called _logical_
|
||||
|
|
|
@ -161,4 +161,4 @@ done
|
|||
```
|
||||
|
||||
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).
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
---
|
||||
id: iqh8
|
||||
title: Machine_code
|
||||
tags: [binary, CPU]
|
||||
tags:
|
||||
- binary
|
||||
- CPU
|
||||
- hardware
|
||||
- computer-architecture
|
||||
created: Monday, March 11, 2024
|
||||
---
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ It would make more sense to run this only in development.
|
|||
### Accessing current Node environment
|
||||
|
||||
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
|
||||
[Morgan](Morgan.md) to run
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: [OOP]
|
||||
tags:
|
||||
- OOP
|
||||
- design-patterns
|
||||
---
|
||||
|
||||
# Module pattern
|
||||
|
|
|
@ -16,7 +16,7 @@ immediately-invoked function expression that has the following parameters:
|
|||
This is called the **module wrapper function**
|
||||
|
||||
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
|
||||
metadata about the module itself. `__filename` and `__dirname` are particularly
|
||||
|
|
|
@ -136,7 +136,7 @@ gives me some useful info about which files VS Code is using:
|
|||
## System calls: `strace`
|
||||
|
||||
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`.
|
||||
|
||||
## CPU performance
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- design-patterns
|
||||
---
|
||||
|
||||
# Multiple pointers
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- logic
|
||||
- propositional-logic
|
||||
---
|
||||
|
||||
# Negation Elimination
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- logic
|
||||
- propositional-logic
|
||||
---
|
||||
|
||||
# Negation Introduction
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
tags: [python, APIs]
|
||||
tags:
|
||||
- python
|
||||
- APIs
|
||||
- networks
|
||||
---
|
||||
|
||||
# Making network requests in Python
|
||||
|
|
|
@ -137,7 +137,7 @@ docker-compose -up
|
|||
|
||||
In the example, the database connection information in the Node source is coming
|
||||
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
|
||||
from the Docker compose file. Therefore these values are hardcoded there.
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: [OOP]
|
||||
tags:
|
||||
- OOP
|
||||
- design-patterns
|
||||
---
|
||||
|
||||
# Observer pattern
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- Linux
|
||||
- procedural
|
||||
- arch-linux
|
||||
---
|
||||
|
||||
# Pacman
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
id: 3hcv0amc
|
||||
title: Printing values in C
|
||||
tags: []
|
||||
tags:
|
||||
- C
|
||||
created: Thursday, February 29, 2024 | 17:33
|
||||
---
|
||||
|
|
@ -16,7 +16,7 @@ the terminal and exit the current process.
|
|||
## Managing runtime environments
|
||||
|
||||
See
|
||||
[Managing Environments](Managing_environments.md).
|
||||
[Managing Environments](Managing_environments_in_NodeJS.md).
|
||||
|
||||
## Accessing arguments: `process.argv`
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
---
|
||||
tags:
|
||||
- shell
|
||||
- Linux
|
||||
---
|
||||
|
||||
# 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.
|
||||
|
||||
The command in its most minimal application returns the following
|
||||
|
|
|
@ -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.
|
||||
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
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- logic
|
||||
- propositional-logic
|
||||
---
|
||||
|
||||
# Reiteration
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
tags:
|
||||
- kernel
|
||||
- CPU
|
||||
- computer-architecture
|
||||
---
|
||||
|
||||
# Relation between the kernel and CPU
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- databases
|
||||
---
|
||||
|
||||
# Relational database architecture
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- Linux
|
||||
- procedural
|
||||
---
|
||||
|
||||
# Save read only Vim file
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
tags: [shell]
|
||||
---
|
||||
|
||||
# Linux shell commands cheat-sheet
|
||||
|
||||
## CPU
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
tags:
|
||||
- binary
|
||||
- hardware
|
||||
---
|
||||
|
||||
# Signed and unsigned numbers
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: [OOP]
|
||||
tags:
|
||||
- OOP
|
||||
- design-patterns
|
||||
---
|
||||
|
||||
# Singleton pattern
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- design-patterns
|
||||
---
|
||||
|
||||
# Sliding window
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
tags: [python, data-types]
|
||||
---
|
||||
|
||||
# Standard input and output
|
||||
|
||||
https://www.youtube.com/watch?v=kqtD5dpn9C8&ab_channel=ProgrammingwithMosh
|
|
@ -2,6 +2,8 @@
|
|||
tags:
|
||||
- memory
|
||||
- disks
|
||||
- Linux
|
||||
- operating-systems
|
||||
---
|
||||
|
||||
# Swap space
|
||||
|
@ -31,7 +33,7 @@ Swap: 3145724 0 3145724
|
|||
|
||||
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
|
||||
[kernel](The_Kernel.md).
|
||||
[kernel](The_kernel.md).
|
||||
|
||||
### Add to `fstab`
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
---
|
||||
tags:
|
||||
- shell
|
||||
- Linux
|
||||
- procedural
|
||||
---
|
||||
|
||||
> A symbolic link, also termed a soft link, is a special kind of file that
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
tags: [systems-programming, memory]
|
||||
tags:
|
||||
- systems-programming
|
||||
- memory
|
||||
- computer-architecture
|
||||
---
|
||||
|
||||
# The Kernel
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
tags: [logic-gates, binary]
|
||||
tags:
|
||||
- logic-gates
|
||||
- binary
|
||||
- electronics
|
||||
---
|
||||
|
||||
# Transistors
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- logic
|
||||
- propositional-logic
|
||||
---
|
||||
|
||||
# Truth-tables
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
tags: []
|
||||
tags:
|
||||
- logic
|
||||
- propositional-logic
|
||||
---
|
||||
|
||||
## Rationale
|
||||
|
|
|
@ -3,6 +3,7 @@ id: gktb
|
|||
title: Two's complement
|
||||
tags:
|
||||
- binary
|
||||
- hardware
|
||||
created: Tuesday, March 19, 2024
|
||||
---
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ tags:
|
|||
# Type narrowing and guarding
|
||||
|
||||
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
|
||||
always return or involve homogenous types.
|
||||
|
|
@ -23,7 +23,7 @@ app.listen(8080, () =>
|
|||
## Add GraphQL as middlewear
|
||||
|
||||
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.
|
||||
|
||||
```js
|
||||
|
|
2
zk/fs.md
2
zk/fs.md
|
@ -97,4 +97,4 @@ fs.rmSync("/dir", { recursive: true, force: true });
|
|||
|
||||
## Streams
|
||||
|
||||
See [Handling streams with fs](Streams.md)
|
||||
See [Handling streams with fs](Streams_in_NodeJS.md)
|
||||
|
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
`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
|
||||
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
|
||||
all kernal processes.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue