Compare commits

...

2 commits

Author SHA1 Message Date
cc8a6f8ec9 housekeeping 2025-12-28 16:38:55 +00:00
d468e5cd4c chore: fix broken links 2025-12-28 16:31:48 +00:00
56 changed files with 87 additions and 276 deletions

View file

@ -4,8 +4,6 @@ tags: [CPU]
created: Tuesday, March 12, 2024 created: Tuesday, March 12, 2024
--- ---
# Assembly
- Assembly is one level up from machine code and provides a more human-friendly - Assembly is one level up from machine code and provides a more human-friendly
abstraction layer abstraction layer
@ -38,8 +36,3 @@ A disassembler does the opposite: translate machine code into assembly.
directly executed by the CPU directly executed by the CPU
- humans use an assembly language version of the machine code which is then - humans use an assembly language version of the machine code which is then
translated back to machine code for the computer to execute. translated back to machine code for the computer to execute.
## Related notes
[[Hexadecimal_number_system]], [[Instruction_set_architectures]],
[[CPU_architecture]]

View file

@ -3,8 +3,6 @@ tags: [ecopolsoc, internet]
created: Friday, November 22, 2024 created: Friday, November 22, 2024
--- ---
# a771a6d9_defining_internet_enclosure
## Defining _enclosure_ ## Defining _enclosure_
The attempt by capital interests to encircle, control and contain networked The attempt by capital interests to encircle, control and contain networked

View file

@ -3,8 +3,6 @@ tags:
- logic - logic
--- ---
# Biconditional introduction
The biconditional means if $P$ is the case, $Q$ must be the case and if $Q$ is The biconditional means if $P$ is the case, $Q$ must be the case and if $Q$ is
the case, $P$ must be the case. Thus to introduce this operator we must the case, $P$ must be the case. Thus to introduce this operator we must
demonstrate both that $Q$ follows from $P$ and that $P$ follows from $Q$. We do demonstrate both that $Q$ follows from $P$ and that $P$ follows from $Q$. We do

View file

@ -4,8 +4,6 @@ tags: [binary]
created: Saturday, April 20, 2024 created: Saturday, April 20, 2024
--- ---
# Bitwise operators
In addition to mathematical, logical and comparison operators, there are In addition to mathematical, logical and comparison operators, there are
_bitwise operators_. These operators execute conditions based on the actual bits _bitwise operators_. These operators execute conditions based on the actual bits
of a value rather than the values that the bits are encoded to represent. of a value rather than the values that the bits are encoded to represent.
@ -68,5 +66,3 @@ operations are the fastest and lowest level of computation, being able to
directly access and operate on bits within a programming language can be directly access and operate on bits within a programming language can be
beneficial when efficiency and speed of execution is a factor or when memory is beneficial when efficiency and speed of execution is a factor or when memory is
constrained. constrained.
## Related notes

View file

@ -5,21 +5,16 @@ tags:
- logic - logic
--- ---
# Boolean function synthesis When we looked at [boolean functions](Boolean_functions.md) we were working in a
particular direction: from a function to a truth table. When we do Boolean
When we looked at function synthesis we work in the opposite direction: from a truth table to a
[boolean functions](Boolean_functions.md) we were function.
working in a particular direction: from a function to a truth table. When we do
Boolean function synthesis we work in the opposite direction: from a truth table
to a function.
This is an important skill that we will use when constructing This is an important skill that we will use when constructing
[logic circuits](Digital_circuits.md). [logic circuits](Digital_circuits.md). We will go from truth conditions (i.e.
We will go from truth conditions (i.e. what we want the circuit to do and when what we want the circuit to do and when we want it to do it) to a function
we want it to do it) to a function expression which is then reduced to its expression which is then reduced to its simplest form and implemented with
simplest form and implemented with [logic gates](Logic_gates.md). Specifically, NAND gates.
[logic gates](Logic_gates.md).
Specifically, NAND gates.
We will show here that a complex logical expression can be reduced to an We will show here that a complex logical expression can be reduced to an
equivalent expression that uses only the NAND operator. equivalent expression that uses only the NAND operator.
@ -120,10 +115,8 @@ $$
| 1 | 1 | 1 | 1 | | 1 | 1 | 1 | 1 |
Finally, we can simplify even further by doing away with AND and NOT and using a Finally, we can simplify even further by doing away with AND and NOT and using a
single single [NAND gate](Logic_gates.md#nand-gate) which embodies the logic of both,
[NAND gate](Logic_gates.md#nand-gate) being true in all instances where AND would be false: $\lnot (x \land y)$.
which embodies the logic of both, being true in all instances where AND would be
false: $\lnot (x \land y)$.
Let's prove the theorem that every logical expression can be formulated as a Let's prove the theorem that every logical expression can be formulated as a
NAND function. To do this we need to show that both NOT and AND can be converted NAND function. To do this we need to show that both NOT and AND can be converted

View file

@ -31,7 +31,3 @@ console.log("Bye");
function: the `console.log("bye")` function: the `console.log("bye")`
6. Executes 6. Executes
7. Returns to line that called it. Finds nothing else to do. Exits program. 7. Returns to line that called it. Finds nothing else to do. Exits program.
## Related notes
![Stack memory](Stack_memory.md)

View file

@ -4,8 +4,6 @@ tags:
- computer-architecture - computer-architecture
--- ---
# Chipset and controllers
A **controller** is simply a circuit that controls a process. The **chipset** is A **controller** is simply a circuit that controls a process. The **chipset** is
a combination of controllers placed on the same piece of silicon. a combination of controllers placed on the same piece of silicon.

View file

@ -4,8 +4,6 @@ tags: []
created: Friday, June 28, 2024 created: Friday, June 28, 2024
--- ---
# Concise mapping of object subfields in JS
## Scenario ## Scenario
You have an array of objects and you want to return the objects with only a You have an array of objects and you want to return the objects with only a
@ -33,5 +31,3 @@ More concise approach with destructuring:
```js ```js
const subset = arrayOfObjs.map(({ name }) => ({ name })); const subset = arrayOfObjs.map(({ name }) => ({ name }));
``` ```
## Related notes

View file

@ -3,8 +3,6 @@ tags:
- shell - shell
--- ---
# Conditionals in Bash
## If statements ## If statements
- Conditional blocks start with `if` and end with the inversion `fi` (this is a - Conditional blocks start with `if` and end with the inversion `fi` (this is a

View file

@ -146,7 +146,3 @@ sudo e2label /dev/sda1 my_human_name
> Whilst we have created our partitions we cannot yet mount them. This is > Whilst we have created our partitions we cannot yet mount them. This is
> because we have not yet set up a filesystem on the partitions. This is the > because we have not yet set up a filesystem on the partitions. This is the
> next step. > next step.
## Related notes
![Linux disk partitions](./Linux_disk_partitions.md)

View file

@ -2,8 +2,6 @@
tags: [physics, electricity] tags: [physics, electricity]
--- ---
# Current
> Electrical current is the movement of electrons from negatively charged atoms > Electrical current is the movement of electrons from negatively charged atoms
> to positively charged atoms when an appropriate external force is applied. > to positively charged atoms when an appropriate external force is applied.

View file

@ -3,8 +3,6 @@ tags: [computer-history, memory]
created: Wednesday, September 18, 2024 created: Wednesday, September 18, 2024
--- ---
# Delay line memory
- First described in the _First Draft_ by #vonNeumann based on work by Eckert - First described in the _First Draft_ by #vonNeumann based on work by Eckert
and Mauchley. and Mauchley.

View file

@ -4,8 +4,6 @@ tags:
- procedural - procedural
--- ---
# Delete and replace characters from stdout with `tr`
I used the following pattern to remove new lines and blank spaces: I used the following pattern to remove new lines and blank spaces:
```sh ```sh

View file

@ -3,8 +3,6 @@ tags: [docker]
created: Sunday, May 04, 2025 created: Sunday, May 04, 2025
--- ---
# Docker volumes
> This is a WIP re-write of [Docker Storage](./Docker_storage.md). > This is a WIP re-write of [Docker Storage](./Docker_storage.md).
## _Bind mounts_ versus _named volumes_ ## _Bind mounts_ versus _named volumes_

View file

@ -4,8 +4,6 @@ tags: [AWS, databases, dynamodb]
created: Saturday, June 22, 2024 created: Saturday, June 22, 2024
--- ---
# DynamoDB CLI commands
## Connecting to a local (Docker)/prod (AWS) DynamoDB instance ## Connecting to a local (Docker)/prod (AWS) DynamoDB instance
In order to distinguish between local and production accounts you should keep In order to distinguish between local and production accounts you should keep
@ -65,5 +63,3 @@ aws dynamodb scan \
--table-name TimeEntries \ --table-name TimeEntries \
--output table --output table
``` ```
## Related notes

View file

@ -4,8 +4,6 @@ tags: [AWS, databases, dynamodb]
created: Sunday, June 23, 2024 created: Sunday, June 23, 2024
--- ---
# DynamoDB SDK commands
The following commands are for using `@aws-sdk/client-dynamodb` (the JS SDK). The following commands are for using `@aws-sdk/client-dynamodb` (the JS SDK).
## Create client ## Create client
@ -76,5 +74,3 @@ const params = {
const dynamoDbDocumentClient = DynamoDBDocumentClient.from(client); const dynamoDbDocumentClient = DynamoDBDocumentClient.from(client);
const data = await dynamoDbDocumentClient.send(new ScanCommand(params)); const data = await dynamoDbDocumentClient.send(new ScanCommand(params));
``` ```
## Related notes

View file

@ -7,8 +7,6 @@ tags:
created: Sunday, June 09, 2024 created: Sunday, June 09, 2024
--- ---
# DynamoDB
## Data structure ## Data structure
### Non-relational tables ### Non-relational tables
@ -129,5 +127,3 @@ I have also defined a GSI. This is derived from the `Year` attribute. This will
group all the items by their `Year`, allowing me to query directly by year but group all the items by their `Year`, allowing me to query directly by year but
also helping to chunk the entries which will make look-ups quicker and less also helping to chunk the entries which will make look-ups quicker and less
expensive. expensive.
## Related notes

View file

@ -3,8 +3,6 @@ tags:
- shell - shell
--- ---
# Expansions and substitutions
Bash is weird in that parentheses, braces and brackets are used not just as Bash is weird in that parentheses, braces and brackets are used not just as
markers for different code blocks but as the designators of commands in their markers for different code blocks but as the designators of commands in their
own right. The type of bracket you use effects how your input is interpreted. own right. The type of bracket you use effects how your input is interpreted.
@ -79,10 +77,9 @@ the second list against them.
## Parameter expansion: `${...}` ## Parameter expansion: `${...}`
We use most frequently for returning the value of stored We use most frequently for returning the value of stored
[variables](Variables_and_data_types_in_Bash.md). [variables](Variables_and_data_types_in_Bash.md). Techically we do not have to
Techically we do not have to use the braces, we can retrieve with just `$var` use the braces, we can retrieve with just `$var` however it's better to use them
however it's better to use them to minimise interpretation fuck-ups which happen to minimise interpretation fuck-ups which happen a lot.
a lot.
When the braces are used, this allows us to transform the values before they are When the braces are used, this allows us to transform the values before they are
returned such as only returning from the 6th character: `${var:6}`. returned such as only returning from the 6th character: `${var:6}`.
@ -91,8 +88,7 @@ returned such as only returning from the 6th character: `${var:6}`.
Command substitution (circle-brackets) allows us to put the output of one Command substitution (circle-brackets) allows us to put the output of one
command inside another. Bash runs the bracketed command in a command inside another. Bash runs the bracketed command in a
[sub-shell](Shell_sessions.md) and then returns it [sub-shell](Shell_sessions.md) and then returns it to the main user shell.
to the main user shell.
For example: For example:
@ -104,6 +100,4 @@ echo "The current directory is $(pwd)."
We use arithmetic expansion when we want to calculate numerical values We use arithmetic expansion when we want to calculate numerical values
See See [Working with numbers in Bash](Working_with_numbers_in_Bash.md) for more.
[Working with numbers in Bash](Working_with_numbers_in_Bash.md)
for more.

View file

@ -3,8 +3,6 @@ tags: [networks, servers, firewalls]
created: Sunday, February 09, 2025 created: Sunday, February 09, 2025
--- ---
# Firewalls
A firewall is a server mechanism that filters incoming requests for resources A firewall is a server mechanism that filters incoming requests for resources
and services that it hosts. and services that it hosts.

View file

@ -3,8 +3,6 @@ tags: [docker, servers]
created: Saturday, August 09, 2025 created: Saturday, August 09, 2025
--- ---
# Forgejo runner failure after VPS reboot
If you get stuck on "Waiting" when running an automated deployment in Forgejo, If you get stuck on "Waiting" when running an automated deployment in Forgejo,
this can be because you've rebooted the VPS and the Docker permissions have this can be because you've rebooted the VPS and the Docker permissions have
reset. reset.

View file

@ -3,8 +3,6 @@ tags:
- git - git
--- ---
# Rebasing
Rebasing is a way to integrate changes from one branch into another. In this Rebasing is a way to integrate changes from one branch into another. In this
regarding it is like merging a branch B into another branch A. However rebasing regarding it is like merging a branch B into another branch A. However rebasing
differs from normal merging in the way in which it modifies the Git history. differs from normal merging in the way in which it modifies the Git history.
@ -127,11 +125,11 @@ request.
## Difference from cherry-picking ## Difference from cherry-picking
The main difference between the two approaches is that The main difference between the two approaches is that
[cherry-picking](Cherry_picking_a_branch.md) is a more selective [cherry-picking](/zk/Cherry_picking.md) is a more selective process, where you
process, where you can pick and choose specific commits that you want to include can pick and choose specific commits that you want to include in another branch.
in another branch. This can be useful when you only want to apply specific This can be useful when you only want to apply specific changes or fixes from
changes or fixes from one branch to another, without including all the changes one branch to another, without including all the changes made in the original
made in the original branch. branch.
On the other hand, rebasing is a more comprehensive process that can include all On the other hand, rebasing is a more comprehensive process that can include all
the changes from one branch to another, but it modifies the commit history, the changes from one branch to another, but it modifies the commit history,

View file

@ -3,8 +3,6 @@ tags:
- node-js - node-js
--- ---
# Global object
> In Node every function and variable should be scoped to a module. We should > In Node every function and variable should be scoped to a module. We should
> not define functions and variables within the global scope. > not define functions and variables within the global scope.

View file

@ -3,8 +3,6 @@ tags:
- shell - shell
--- ---
# Grep
## Purpose of `grep` ## Purpose of `grep`
`grep` stands for “global regular expression print”. It allows you to search `grep` stands for “global regular expression print”. It allows you to search

View file

@ -3,8 +3,6 @@ tags: [world-wide-web, internet, encryption, servers]
created: Friday, December 14, 2024 created: Friday, December 14, 2024
--- ---
# HTTPS
The problem with standard, unencrypted HTTP requests is that the data can be The problem with standard, unencrypted HTTP requests is that the data can be
captured in transit and be observed or modified by malicious actors. captured in transit and be observed or modified by malicious actors.
@ -17,10 +15,10 @@ It utilises two types of encryption to send messages securely:
- a single shared key between client and server to encrypt the messages sent - a single shared key between client and server to encrypt the messages sent
between them between them
- asymmetric encryption - asymmetric encryption
- two keys are used: a [public key](./bbdcb54f_public_key_cryptography.md) to - two keys are used: a [public key](/zk/Public_key_cryptography.md) to encrypt
encrypt the data and a private key to decrypt it. The public key can be the data and a private key to decrypt it. The public key can be shared
shared freely so anyone can encrypt and send data to a peer but only the freely so anyone can encrypt and send data to a peer but only the peer can
peer can receive and decrypt it receive and decrypt it
> Symmetric encryption applies once the server has been authenticated and its > Symmetric encryption applies once the server has been authenticated and its
> public key has been shared with the client. Asymmetric encryption applies at > public key has been shared with the client. Asymmetric encryption applies at

View file

@ -8,8 +8,6 @@ tags:
created: Wednesday, June 12, 2024 created: Wednesday, June 12, 2024
--- ---
# Headless network setup
If you are using a headless system and you aren't using an ethernet connection, If you are using a headless system and you aren't using an ethernet connection,
you face a chicken-egg issue of how to connect the device to WiFi via `ssh` when you face a chicken-egg issue of how to connect the device to WiFi via `ssh` when
the device isn't yet on the network. the device isn't yet on the network.
@ -31,5 +29,3 @@ network={
key_mgmt=WPA-PSK key_mgmt=WPA-PSK
} }
``` ```
## Related notes

View file

@ -4,10 +4,8 @@ tags: [memory, C]
created: Saturday, April 20, 2024 created: Saturday, April 20, 2024
--- ---
# Heap memory Along with [stack memory](/zk/Stack_memory.md), programs make use of _heap
memory_ during runtime.
Along with [[Stack_memory|Stack memory]], programs make use of _heap memory_
during runtime.
Heap memory does not use a standardised data structure and can be accessed from Heap memory does not use a standardised data structure and can be accessed from
any point within the program. any point within the program.
@ -36,5 +34,3 @@ The `malloc` method requests 512 bytes that it wants to assign to the `data`
variable. It will return the address of the first byte in the newly allocated variable. It will return the address of the first byte in the newly allocated
memory. `data` will then refer to the address on the stack that holds the memory. `data` will then refer to the address on the stack that holds the
address allocation on the heap. address allocation on the heap.
## Related notes

View file

@ -3,8 +3,6 @@ tags:
- shell - shell
--- ---
# Introduction to the Unix shell
## Unix based systems ## Unix based systems
Many operating systems are based on the UNIX software architecture. macOS/OSX Many operating systems are based on the UNIX software architecture. macOS/OSX

View file

@ -4,8 +4,6 @@ tags: [python, shell]
created: Monday, April 29, 2024 created: Monday, April 29, 2024
--- ---
# Invoking the shell in Python
```py ```py
import subprocess import subprocess

View file

@ -3,9 +3,7 @@ tags: [internet, ARPANET, ARPA]
created: Monday, October 28, 2024 created: Monday, October 28, 2024
--- ---
# 4a3dc316_key_figures_ARPANET - [Paul Baran](/zk/Baran_distributed_networks.md) for his work at RAND on
- [Paul Baran](385af4b4_Baran_distributed_networks.md) for his work at RAND on
distributed networks as an alternative to the extant distributed networks as an alternative to the extant
centralised/de-centralised phone networks. centralised/de-centralised phone networks.

View file

@ -4,8 +4,6 @@ tags:
- aws-lambda - aws-lambda
--- ---
# AWS Lambda programming model
The overall architecure consists in the following three processes: The overall architecure consists in the following three processes:
1. Triggers 1. Triggers
@ -18,8 +16,7 @@ See [AWS Lambda triggers](Lambda_triggers.md)
## Handler function ## Handler function
See See [AWS Lambda handler function](Lambda_handler_function.md)
[AWS Lambda handler function](Lambda_handler_function.md)
## Code ## Code

View file

@ -7,7 +7,7 @@ tags: [logic-gates, binary, memory]
The **combinatorial digital circuits** we have looked at so far have been The **combinatorial digital circuits** we have looked at so far have been
non-sequential. The outcome is a function of its immediate set of inputs and non-sequential. The outcome is a function of its immediate set of inputs and
everything happens at once: there is no means of storing state for future use. everything happens at once: there is no means of storing state for future use.
In other words there is no _[memory](Memory.md)_. In other words there is no memory.
In contrast, the output of a **sequential digital circuit** depends not only on In contrast, the output of a **sequential digital circuit** depends not only on
its present set of inputs but also on past inputs to the circuit. It has some its present set of inputs but also on past inputs to the circuit. It has some
@ -49,8 +49,7 @@ _The representation of an SR Latch in a digital circuit diagram_:
The circuit diagram latch symbol obviously encapsulates more complex The circuit diagram latch symbol obviously encapsulates more complex
functionality that occurs at the sub-circuit level. We will demonstrate how this functionality that occurs at the sub-circuit level. We will demonstrate how this
functionality can be achieved with two functionality can be achieved with two [NOR](Logic_gates.md#nor-gate) gates.
[NOR](Logic_gates.md#nor-gate) gates.
The two gates are in a **cross-coupled configuration**. This basically means The two gates are in a **cross-coupled configuration**. This basically means
that the wires are crossed back on themselves such that the output of one is that the wires are crossed back on themselves such that the output of one is

View file

@ -5,8 +5,6 @@ tags:
- procedural - procedural
--- ---
# Linux disk partitions
A disk is divided up into partitions which are subsections of the overall disk. A disk is divided up into partitions which are subsections of the overall disk.
The kernel presents each partition as a [block device](Devices.md#Devices) as it The kernel presents each partition as a [block device](Devices.md#Devices) as it
would with an entire disk. would with an entire disk.
@ -96,8 +94,8 @@ The two tools disclose that the main harddrive is `/dev/nvme0n1` (equivalent to
- The root partition is vital for the system's functionality. Without it, the - The root partition is vital for the system's functionality. Without it, the
system cannot boot or operate. It needs to be system cannot boot or operate. It needs to be
large enough to accommodate the operating system, installed programs, and system large enough to accommodate the operating system, installed programs, and
libraries, but it doesn't need to store user data or system libraries, but it doesn't need to store user data or
additional applications, which can be located on other partitions. additional applications, which can be located on other partitions.
- This is the domain of the [superuser](User_Space.md#root-user-superuser). The - This is the domain of the [superuser](User_Space.md#root-user-superuser). The
@ -171,7 +169,3 @@ In our example above:
</ul> </ul>
</dd> </dd>
</dl> </dl>
## Related notes
![Creating a Linux partition table](./Creating_a_Linux_partition_table.md)

View file

@ -3,8 +3,6 @@ tags:
- shell - shell
--- ---
# Listing and navigating directories in the shell
## Listing options ## Listing options
Obviously we know that in order to list the files and sub-directories in our Obviously we know that in order to list the files and sub-directories in our

View file

@ -4,19 +4,17 @@ tags:
- logic - logic
--- ---
# Logical possibility and necessity
## Logical possibility ## Logical possibility
In distinguishing the properties of In distinguishing the properties of
[logical consistency](Logical_consistency.md) and [logical consistency](Logical_consistency.md) and
[validity](Validity_and_entailment.md) we make tacit use [validity](Validity_and_entailment.md) we make tacit use of the notion of
of the notion of **possibility**. This is because when we consider the validity **possibility**. This is because when we consider the validity of an argument we
of an argument we are assessing truth-conditions and this consists in asking are assessing truth-conditions and this consists in asking ourselves what could
ourselves what could or could not be the case: were it such that _P_, then it or could not be the case: were it such that _P_, then it would be the case that
would be the case that _Q_. It is important to understand what possibility means _Q_. It is important to understand what possibility means in the context of
in the context of logic and how it differs from what we might mean ordinarily logic and how it differs from what we might mean ordinarily when we use the
when we use the term. term.
It is evident from the case of arguments that are valid but not sound that logic It is evident from the case of arguments that are valid but not sound that logic
operates with a specialised notion of possibility. For example it has to be the operates with a specialised notion of possibility. For example it has to be the
@ -60,9 +58,9 @@ From this we can derive the following property of logical possibility:
A proposition is _logically necessary_ if it is true in every logically possible A proposition is _logically necessary_ if it is true in every logically possible
circumstance which is to say: true on every possible truth functional circumstance which is to say: true on every possible truth functional
assignment. Necessity and assignment. Necessity and
[logical truth](Logical_truth_and_falsity.md#logical-truth) [logical truth](Logical_truth_and_falsity.md#logical-truth) are therefore
are therefore synonyms: anything that is logically true (a tautology) is true by synonyms: anything that is logically true (a tautology) is true by necessity
necessity (could not be otherwise.) (could not be otherwise.)
Further, every logical truth is logically possible but not everything that is Further, every logical truth is logically possible but not everything that is
logically possible is logically true. It is possible that it is raining but this logically possible is logically true. It is possible that it is raining but this

View file

@ -3,8 +3,6 @@ tags: [computer-history, memory]
created: Friday, September 27, 2024 created: Friday, September 27, 2024
--- ---
# Magnetic core memory
![](../img/magnetic-core-memory.jpg) ![](../img/magnetic-core-memory.jpg)
Like [Magnetic_drum_memory](Magnetic_drum_memory.md), magnetic core memory was Like [Magnetic_drum_memory](Magnetic_drum_memory.md), magnetic core memory was

View file

@ -11,10 +11,9 @@ tags:
### `top`/`htop` ### `top`/`htop`
We can use [ps](Processes.md) to list the We can use [ps](Processes.md) to list the currently running processes but it
currently running processes but it does not provide much information about the does not provide much information about the resource metrics or how the process
resource metrics or how the process changes over time. We can use `top` to get changes over time. We can use `top` to get more information.
more information.
`top` provides an interactive interface for the information that `ps` displays. `top` provides an interactive interface for the information that `ps` displays.
It updates in real time and shows the most active processes based on the CPU It updates in real time and shows the most active processes based on the CPU
@ -60,9 +59,8 @@ _Here I have pressed `u` to show only the processes associated with my user:_
$ renice 20 1234 $ renice 20 1234
``` ```
- `VIRT` - `VIRT`
- The total amount of - The total amount of [virtual memory](/zk/VirtualMemory.md) used by the
[virtual memory](Virtual_memory_and_the_MMU_in_Linux.md) used by process including: program code, data, shared libraries, pages that have
the process including: program code, data, shared libraries, pages that have
been swapped, pages that have been mapped but not used. been swapped, pages that have been mapped but not used.
- `RES` - `RES`
- Stands for _resident size_ - Stands for _resident size_
@ -110,9 +108,8 @@ procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
- Total amount of virtual memory in the - Total amount of virtual memory in the
[cache](Role_of_memory_in_computation.md#relation-between-cache-and-buffers) [cache](Role_of_memory_in_computation.md#relation-between-cache-and-buffers)
- `swap` - `swap`
- Distinguishes amount of memory - Distinguishes amount of memory [swapped](Swap_space.md) in (`si`) to memory
[swapped](Swap_space.md) in (`si`) to memory and and swapped out (`so`) to disk
swapped out (`so`) to disk
- `io` - `io`
- Disk actions - Disk actions
- Amount of data read from harddisk (`bi`) - Amount of data read from harddisk (`bi`)
@ -136,8 +133,8 @@ 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
memory. We can trace these system calls with `strace`. these system calls with `strace`.
## CPU performance ## CPU performance
@ -168,8 +165,8 @@ $ uptime
We know that processes primarily interact with virtual memory in the form of We know that processes primarily interact with virtual memory in the form of
pages which are then translated to physical blocks by the kernel via the pages which are then translated to physical blocks by the kernel via the
[MMU](Virtual_memory_and_the_MMU_in_Linux.md). There are several tools [MMU](Virtual_memory_and_the_MMU_in_Linux.md). There are several tools which
which provide windows onto this process. provide windows onto this process.
### System page size ### System page size

View file

@ -8,12 +8,11 @@ tags:
<img src="../img/motherboard-pi.jpg" width="400px"/> <img src="../img/motherboard-pi.jpg" width="400px"/>
![](./img/motherboard-pi)
The motherboard is the foundation of a computer. It allocates power and allows The motherboard is the foundation of a computer. It allocates power and allows
communication to and between the communication to and between the [CPU](CPU_architecture.md), memory,
[CPU](CPU_architecture.md), [harddisk](What_are_disks.md) and all other hardware components.
[RAM](Memory.md),
[harddisk](What_are_disks.md) and all other hardware
components.
It is a printed circuit board and is always the largest board within the It is a printed circuit board and is always the largest board within the
computer chassis. computer chassis.

View file

@ -4,8 +4,6 @@ tags: [operating-systems]
created: Friday, June 21, 2024 created: Friday, June 21, 2024
--- ---
# Processes
Programs are sequences of machine instructions stored in a file. However they do Programs are sequences of machine instructions stored in a file. However they do
not work by themselves. Something needs to load the file's intructions into not work by themselves. Something needs to load the file's intructions into
memory, direct the CPU to run the program and manage it during runtime. The OS memory, direct the CPU to run the program and manage it during runtime. The OS
@ -46,11 +44,3 @@ therefore also a child (grandchild) of `terminator`.
Each process has a unique identifier called a _process identifier_, a Each process has a unique identifier called a _process identifier_, a
_processID_ or just _PID_. _processID_ or just _PID_.
## Related notes
![systemd](./systemd.md)
![ps](./ps.md)
![Monitoring processes and resources](Monitoring_processes_and_resources.md)

View file

@ -4,8 +4,6 @@ tags: [electronics]
created: Tuesday, June 25, 2024 created: Tuesday, June 25, 2024
--- ---
# Push buttons
Push buttons are push-to-make switches. This means that they are **on when they Push buttons are push-to-make switches. This means that they are **on when they
pressed and off when they are not pressed**. A classic example would be the pressed and off when they are not pressed**. A classic example would be the
switches on a keyboard. switches on a keyboard.
@ -30,7 +28,3 @@ _The push button being used as simple connector which does not break the
circuit:_ circuit:_
![](../img/incorrect_push_button.jpg) ![](../img/incorrect_push_button.jpg)
## Related notes
https://projects.raspberrypi.org/en/projects/button-switch-scratch-pi/1

View file

@ -6,8 +6,6 @@ tags:
- databases - databases
--- ---
# Query a Mongo collection with Mongoose
We now have the following entries in our `courses` collection: We now have the following entries in our `courses` collection:
```js ```js
@ -35,8 +33,8 @@ We now have the following entries in our `courses` collection:
Now we will query the collection. This capability is provided via the Mongoose Now we will query the collection. This capability is provided via the Mongoose
schema class we used to create the `Course` schema class we used to create the `Course`
[model](Create_collections_and_documents_with_Mongoose.md#models). [model](Create_collections_and_documents_with_Mongoose.md#models). We have the
We have the following methods available to use from the schema: following methods available to use from the schema:
- `find` - `find`
- `findById` - `findById`

View file

@ -4,8 +4,6 @@ tags: [computer-architecture, memory]
created: Monday, June 24, 2024 created: Monday, June 24, 2024
--- ---
# ROM versus disk loading
I will explore the concept via the practical examples of cartridge-based and I will explore the concept via the practical examples of cartridge-based and
disk-based video games console. disk-based video games console.
@ -54,5 +52,3 @@ to take that disk and load it on another Xbox, it would not include any of the
expansions or updates. The game would function in its original form, as the expansions or updates. The game would function in its original form, as the
additional content and updates reside solely on the hard drive of the first additional content and updates reside solely on the hard drive of the first
console where they were downloaded. console where they were downloaded.
## Related notes

View file

@ -9,10 +9,9 @@ tags:
> key is one **field that uniquely identifies each record**. > key is one **field that uniquely identifies each record**.
This is essential for carrying out operations across database tables and for This is essential for carrying out operations across database tables and for
creating and deleting database entires in accordance with the creating and deleting database entires in accordance with the ACID principle. It
[ACID principle](ACID_principle.md). It is also a safeguard: it means is also a safeguard: it means you can always identify a record by itself and
you can always identify a record by itself and don't have to rely on generic don't have to rely on generic queries to identify it.
queries to identify it.
Sometimes you will have a dedicated field such as `UNIQUE_ID` for the unique Sometimes you will have a dedicated field such as `UNIQUE_ID` for the unique
key. Other times you can use an existing field to fulfil that function. When an key. Other times you can use an existing field to fulfil that function. When an

View file

@ -9,7 +9,7 @@ AWS to simplify the process of building, deploying and managing serverless
applications. It provides a concise syntax for defining the components of a applications. It provides a concise syntax for defining the components of a
serverless application, such as serverless application, such as
[Lambda functions](zk/Lambda_programming_model.md), [Lambda functions](zk/Lambda_programming_model.md),
[API gateway](/zk/AWS_API_Gateway.md) and database tables. [API gateway](/zk/API_Gateway.md) and database tables.
The SAM infrastructure is defined in a YAML file which is then deployed to AWS. The SAM infrastructure is defined in a YAML file which is then deployed to AWS.
SAM syntax gets transformed into CloudFormation during the deployment process. SAM syntax gets transformed into CloudFormation during the deployment process.
@ -239,8 +239,8 @@ receive one file as an input. The packaging process consists in creating that
single file. single file.
The packaging proces will first archive all of the project artefacts into a zip The packaging proces will first archive all of the project artefacts into a zip
file and then upload that to [S3](zk/AWS_S3.md). A reference to this S3 entity file and then upload that to [S3](/zk/S3.md). A reference to this S3 entity is
is then provided to CloudFormation. then provided to CloudFormation.
![](/img/s3-package-again.svg) ![](/img/s3-package-again.svg)

View file

@ -4,8 +4,6 @@ tags: [Linux, networks]
created: Wednesday, June 12, 2024 created: Wednesday, June 12, 2024
--- ---
# Set DNS settings
## Change the default DNS server ## Change the default DNS server
On Arch and most modern Linux distributions domain name resolution is handled On Arch and most modern Linux distributions domain name resolution is handled
@ -62,8 +60,3 @@ nameserver 192.168.0.4
nameserver fded:2060:8671:0:681:9bff:fe9b:37f0 nameserver fded:2060:8671:0:681:9bff:fe9b:37f0
``` ```
## Related notes
![Network scanning](./Network_scanning.md)
![Network debugging](Network_debugging.md)

View file

@ -3,17 +3,9 @@ tags:
- binary - binary
--- ---
# Signed and unsigned numbers
## Summary
- To represent negative integers in binary we use signed numbers._Signed binary_ - To represent negative integers in binary we use signed numbers._Signed binary_
includes negative integers, _unsigned binary_ does not. includes negative integers, _unsigned binary_ does not.
- There are different methods of implementing the encoding of signed numbers. - There are different methods of implementing the encoding of signed numbers.
Two prominant approaches are **two's complement** and **signed magnitude Two prominant approaches are **two's complement** and **signed magnitude
representation**. representation**.
## Related notes
[[Twos_complement]], [[Binary_encoding]], [[Signed_magnitude_representation]]

View file

@ -5,8 +5,6 @@ tags:
created: Wednesday, March 20, 2024 created: Wednesday, March 20, 2024
--- ---
# Signed magnitude representation
## Summary ## Summary
## Detail ## Detail
@ -25,13 +23,3 @@ the furthest bit (aka. the "most significant bit" (MSB)) at the $2^8$ position
is `0`, designating that the number is unsigned. The signed equivalent is is `0`, designating that the number is unsigned. The signed equivalent is
`1000 0101`, with the MSB being `1` designating the number as signed. When we `1000 0101`, with the MSB being `1` designating the number as signed. When we
are working with signed numbers, the MSB is known as the **signed bit**. are working with signed numbers, the MSB is known as the **signed bit**.
### Advantages
### Limitations
## Applications
## Related notes
[[Signed_and_unsigned_numbers|signed_and_unsigned_numbers]]

View file

@ -4,8 +4,6 @@ tags: []
created: Friday, April 26, 2024 created: Friday, April 26, 2024
--- ---
# Single file Python scripts
## Basic architecture ## Basic architecture
```py ```py
@ -38,7 +36,3 @@ if __name__ == "__main__":
main() main()
``` ```
## Related notes
![Python modules and imports](./Python_modules_and_imports.md)

View file

@ -19,10 +19,8 @@ transitions between them. It also includes error catchers and retry logic.
At the beginning you define a `StartAt` state which is the entrypoint of the At the beginning you define a `StartAt` state which is the entrypoint of the
state machine. This can be manually triggered, or more likely, triggered by state machine. This can be manually triggered, or more likely, triggered by
another AWS service such as a another AWS service such as a [Lambda](Lambda_programming_model.md), an
[Lambda](Lambda_programming_model.md), an [API Gateway](/zk/API_Gateway.md) request or a messaging/queue event.
[API Gateway](AWS_API_Gateway.md) request or a messaging/queue
event.
The state machine ultimately ends at an end state. In between are various The state machine ultimately ends at an end state. In between are various
intermediary states which can include: intermediary states which can include:

View file

@ -5,14 +5,12 @@ tags:
# Handling streams with fs # Handling streams with fs
When reading from a file, the When reading from a file, the [`fs.readFile()`](fs.md) method waits until the
[`fs.readFile()`](fs.md) method waits entire file has been read before executing the callback. It's obvious why this
until the entire file has been read before executing the callback. It's obvious might not be ideal in certain cases. If the file is very large you are utilising
why this might not be ideal in certain cases. If the file is very large you are a lot of memory for a single process. Additionally, the data you need might
utilising a lot of [memory](Memory.md) for a appear early in the file, in which case, once you find the data you want, there
single process. Additionally, the data you need might appear early in the file, is no need to read to the end of the file.
in which case, once you find the data you want, there is no need to read to the
end of the file.
> An example of this in practice is watching a Netflix film: we don't have to > An example of this in practice is watching a Netflix film: we don't have to
> wait for the whole film to download, we can start watching it immediately > wait for the whole film to download, we can start watching it immediately

View file

@ -4,16 +4,14 @@ tags:
- logic - logic
--- ---
# Syllogism
In order to make assertions about the relative In order to make assertions about the relative
[consistency](Logical_consistency.md) or inconsistency [consistency](Logical_consistency.md) or inconsistency of a set of propositions
of a set of propositions we advance arguments. Consider everyday life: if we are we advance arguments. Consider everyday life: if we are having an argument with
having an argument with someone, we believe that they are wrong. A more logical someone, we believe that they are wrong. A more logical way to say this is that
way to say this is that we believe that their beliefs are inconsistent. In order we believe that their beliefs are inconsistent. In order to change their
to change their viewpoint or point out why they are wrong we advance an argument viewpoint or point out why they are wrong we advance an argument intended to
intended to show that belief A conflicts with belief B. Or if C is true, then show that belief A conflicts with belief B. Or if C is true, then you cannot
you cannot believe that D. believe that D.
In formal terms **an argument is a set of propositions comprising one or more In formal terms **an argument is a set of propositions comprising one or more
premises and a conclusion. The conclusion is taken to be supported by the premises and a conclusion. The conclusion is taken to be supported by the

View file

@ -341,7 +341,6 @@ the ABC to make ENIAC.
next problem next problem
- ISP removed the friction: - ISP removed the friction:
- the instructions comprising the program would be prepared on tape or punched - the instructions comprising the program would be prepared on tape or punched
cards and read into electronic memory cards and read into electronic memory
- the hardware configuration of the machine would remain the same accross - the hardware configuration of the machine would remain the same accross
@ -382,7 +381,7 @@ variety of different electronic methods for memory:
- An experimental computer intended to create the - An experimental computer intended to create the
[von Neumann architecture](CPU_architecture.md) using [von Neumann architecture](CPU_architecture.md) using
[Williams_Tube_RAM](Williams_Tube_RAM.md) [Williams_Tube_RAM](/zk/Williams_Tube_memory.md)
- Developed at the Univesity of Manchester and completed in 1948. - Developed at the Univesity of Manchester and completed in 1948.
@ -407,7 +406,6 @@ variety of different electronic methods for memory:
university departments who were expected to program it themselves. To this university departments who were expected to program it themselves. To this
end, a formal programming paradigm was forged for the EDSAC which established end, a formal programming paradigm was forged for the EDSAC which established
the following: the following:
- subroutines as a library of common procedures available to programmers (e.g. - subroutines as a library of common procedures available to programmers (e.g.
printing a result, reading input tape, program checking, mathematical printing a result, reading input tape, program checking, mathematical
operations) operations)

View file

@ -4,8 +4,6 @@ tags: [operating-systems]
created: Wednesday, June 26, 2024 created: Wednesday, June 26, 2024
--- ---
# Threads
A ![process](Processes.md) is a running instance of a given program. A program A ![process](Processes.md) is a running instance of a given program. A program
runs sequentially handling one task at a time, however we may need to run runs sequentially handling one task at a time, however we may need to run
certain tasks in parallel. certain tasks in parallel.
@ -36,7 +34,3 @@ the number of cores that a device's CPU has deterimines how many threads can run
at once. In practice, then, the CPU shuffles between multiple threads in at once. In practice, then, the CPU shuffles between multiple threads in
[clock segments](Clock_signals.md). This is known as scheduling and is managed [clock segments](Clock_signals.md). This is known as scheduling and is managed
by the process that the thread belongs to. by the process that the thread belongs to.
## Related notes
![Processes](Processes.md)

View file

@ -3,12 +3,10 @@ tags: [cryptography, encryption]
created: Friday, December 20, 2024 created: Friday, December 20, 2024
--- ---
# a4601796_trapdoor_functions How does [public key cryptography](/zk/Public_key_cryptography.md) achieve the
feat of making the encyrpted data only decipherable in one direction. In other
How does [public key cryptography](./bbdcb54f_public_key_cryptography.md) words how come the same data can be encrypted with one key but only decryptable
achieve the feat of making the encyrpted data only decipherable in one by another?
direction. In other words how come the same data can be encrypted with one key
but only decryptable by another?
It is acheived by the use of **trapdoor functions**. These are functions that It is acheived by the use of **trapdoor functions**. These are functions that
are easy to compute in one direction but extremely difficult to reverse. But are easy to compute in one direction but extremely difficult to reverse. But

View file

@ -92,8 +92,3 @@ $$
bit length of the system bit length of the system
- Consequently two's complement can necessitate larger overall word lengths. - Consequently two's complement can necessitate larger overall word lengths.
## Related notes
[[Signed_and_unsigned_numbers|signed_and_unsigned_numbers]],
[[Binary_addition|binary addition]], [[Signed_magnitude_representation]]

View file

@ -17,8 +17,8 @@ and wanted a way to communicate with each other.
## Technology ## Technology
Usenet comprised a [distributed network](385af4b4_Baran_distributed_networks.md) Usenet comprised a [distributed network](/zk/Baran_distributed_networks.md) of
of dedicated servers that exchanged messages over the **Network News Transfer dedicated servers that exchanged messages over the **Network News Transfer
Protocol** (NNTP). Protocol** (NNTP).
A user would post a message to their local news server. The server would assign A user would post a message to their local news server. The server would assign

View file

@ -5,8 +5,6 @@ tags:
- procedural - procedural
--- ---
# `journald`
`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