mirror of
https://github.com/TrudeEH/web.git
synced 2025-12-06 08:23:37 +00:00
Finished importing notes
This commit is contained in:
10
content/notes/drafts/_Templates/base.md
Normal file
10
content/notes/drafts/_Templates/base.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "{{Title}}"
|
||||
description:
|
||||
date: "{{date:YYYY-MM-DD}}T{{time:HH:mm:ss}}+00:00"
|
||||
draft: true
|
||||
tags:
|
||||
author: TrudeEH
|
||||
showToc: true
|
||||
---
|
||||
|
||||
46
content/notes/drafts/assembly.md
Normal file
46
content/notes/drafts/assembly.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
tags:
|
||||
- computer-science
|
||||
- notes
|
||||
author: TrudeEH
|
||||
draft: true
|
||||
showToc: true
|
||||
title: Assembly
|
||||
---
|
||||
|
||||
#todo
|
||||
## Assembler/Compiler
|
||||
|
||||
- `gcc` GNU C Compiler (The package includes `as` (assembler) and `ld` (linker))
|
||||
|
||||
```Shell
|
||||
as <file.asm> -o <output.o> # Assemble
|
||||
gcc -o <output_file> <output.o> -nostdlib -static # Link using gcc
|
||||
ld <output.o> # Link using ld
|
||||
```
|
||||
|
||||
## Hello World
|
||||
|
||||
```Assembly
|
||||
.global _start
|
||||
.intel_syntax noprefix
|
||||
_start:
|
||||
// sys_write (Print to stdout)
|
||||
mov rax, 1
|
||||
mov rdi, 1
|
||||
lea rsi, [hello_world]
|
||||
// Buffer length
|
||||
mov rdx, 14
|
||||
syscall
|
||||
// sys_exit (safely end the program with a re turn code)
|
||||
mov rax, 60
|
||||
// Exit with code 0
|
||||
mov rdi, 0
|
||||
syscall
|
||||
|
||||
hello_world:
|
||||
// ASCII, zero delimited
|
||||
.asciz "Hello, World!\n"
|
||||
```
|
||||
|
||||
To know which system calls we can execute and which values needed for the registers, refer to [this table](https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/).
|
||||
61
content/notes/drafts/linux/index.md
Normal file
61
content/notes/drafts/linux/index.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
tags:
|
||||
- notes
|
||||
- os
|
||||
author: TrudeEH
|
||||
draft: true
|
||||
showToc: true
|
||||
title: Linux
|
||||
---
|
||||
#todo
|
||||
## Troubleshooting
|
||||
|
||||
- Read error logs from the last session
|
||||
|
||||
```Shell
|
||||
sudo journalctl -b -1 -r -p err
|
||||
```
|
||||
|
||||
## Disk Encryption
|
||||
|
||||
### Full Disk Encryption
|
||||
|
||||
The exact steps to fully encrypt a disk varies depending on the distribution, and can only be done at the install time.
|
||||
On Ubuntu, for example, you can enable it in the "Advanced Features" toggle, at the disk selection stage.
|
||||
![[image93.png]]
|
||||
|
||||
### Encrypt Home Directory
|
||||
|
||||
```Bash
|
||||
sudo apt install ecryptfs-utils cryptsetup # Install dependencies
|
||||
# Create temporary admin account
|
||||
sudo adduser temp_user # Add new user
|
||||
sudo usermod -aG sudo temp_user # Give the new user sudo perms
|
||||
```
|
||||
|
||||
Now, log out of the current user and switch to `temp_user`.
|
||||
|
||||
> [!important] Do not "switch accounts", the current user cannot be active while its home directory is being encrypted.
|
||||
On the `temp_user` account, run the following command, then, log out and return to your user.
|
||||
|
||||
```Bash
|
||||
sudo ecryptfs-migrate-home -u <username>
|
||||
```
|
||||
|
||||
After logging in, you might be greeted with a pop-up with the title "Update Information". Click on "Run this action now" and provide your password.
|
||||
If you already closed the pop-up, run the command below, and provide your password.
|
||||
|
||||
```Bash
|
||||
encryptfs-unwrap-passphrase
|
||||
```
|
||||
|
||||
You will receive a string of text. This will be your recovery password, needed to mount the home folder from another machine.
|
||||
|
||||
### Encrypt Swap
|
||||
|
||||
```Bash
|
||||
swapon -s # Check if you have a swap partition
|
||||
sudo ecryptfs-setup-swap # Encrypt swap
|
||||
```
|
||||
|
||||
You may get an error: `swapon: cannot open /dev/mapper/cryptswap1: No such file or directory`. If you do, reboot and check if the swap partition is encrypted with the `swapon -s` command.
|
||||
BIN
content/notes/drafts/linux_architecture/EXT2.png
Normal file
BIN
content/notes/drafts/linux_architecture/EXT2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 MiB |
BIN
content/notes/drafts/linux_architecture/EXT3.png
Normal file
BIN
content/notes/drafts/linux_architecture/EXT3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 MiB |
BIN
content/notes/drafts/linux_architecture/image5.png
Normal file
BIN
content/notes/drafts/linux_architecture/image5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
BIN
content/notes/drafts/linux_architecture/image6.png
Normal file
BIN
content/notes/drafts/linux_architecture/image6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
BIN
content/notes/drafts/linux_architecture/image7.png
Normal file
BIN
content/notes/drafts/linux_architecture/image7.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
197
content/notes/drafts/linux_architecture/index.md
Normal file
197
content/notes/drafts/linux_architecture/index.md
Normal file
@@ -0,0 +1,197 @@
|
||||
---
|
||||
title: Linux Architecture
|
||||
description:
|
||||
date: 2025-02-17T08:32:33+00:00
|
||||
draft: true
|
||||
tags:
|
||||
- computer-science
|
||||
- os
|
||||
author: TrudeEH
|
||||
showToc: true
|
||||
---
|
||||
|
||||
## Kernel
|
||||
|
||||
Linux is a kernel: the core of an operative system. OSes that use the Linux kernel are called Linux Distros (Distributions).
|
||||
A Kernel does the following:
|
||||
- Executes first when the computer boots up and has full access to the hardware.
|
||||
- Implements drivers to control peripherals, network devices and other resources.
|
||||
- Runs other programs (userland software) and allows them to communicate with each other and with the hardware.
|
||||
|
||||
### Syscalls
|
||||
|
||||
To "ask" the kernel to perform a hardware task, or to access the file system or other resources, a program executes a syscall.
|
||||
For example (x64 assembly):
|
||||
|
||||
```Assembly
|
||||
// sys_write (Print to stdout)
|
||||
mov rax, 1
|
||||
mov rdi, 1
|
||||
lea rsi, [hello_world]
|
||||
// Buffer length
|
||||
mov rdx, 14
|
||||
syscall
|
||||
```
|
||||
|
||||
This snippet implements a syscall that prints text to `stdout`, usually a terminal window.
|
||||
|
||||
### Processes
|
||||
|
||||
A program is an executable containing machine code. When a computer executes a program, it is first loaded into memory.
|
||||
![[image5.png]]
|
||||
A program loaded in memory is a process.
|
||||
|
||||
> Note: For interpreted languages, the interpreter creates a process that executes the code directly.
|
||||
|
||||
### Modules
|
||||
|
||||
## Devices
|
||||
|
||||
### Device Drivers
|
||||
|
||||
Once a new device is plugged in, it attempts to call the Kernel, which identifies that device. The Kernel then loads the appropriate driver. Drivers are Kernel Modules used to interact with hardware. Once the required module is loaded, the Kernel calls the `udevadm` program, that creates a device file in the `/dev` directory.
|
||||
Whenever there is a read/write operation to that device, the Kernel intercepts the request and calls the driver function instead, which implements that operation, and this is why a driver must implement all possible file operations.
|
||||
Not all devices control hardware. For example, `/dev/random` generates a random number.
|
||||
In the Linux Kernel, there are **Character Type Devices** and **Block Type Devices.**
|
||||
A Character Device provides an endless stream or characters that can be read one at a time. This includes a keyboard and sensors, for example. Block Devices provide data as blocks of a defined size. These include disks and USB drives.
|
||||
The only exceptions are Network Devices. Network data cannot be manipulated with file operations, so they are handled differently in the kernel.
|
||||
|
||||
### Network Devices
|
||||
|
||||
If a network card is plugged in, like any other device, it communicates with the Kernel, and the Kernel loads the appropriate Kernel Module that contains the driver. After that, the driver adds new entries to the Kernel's `NICs`, which are data structures stored in memory. The driver then creates configuration files in the `/sys/class/net/` directory. These are not device files, just configuration files. Different network cards can have multiple network interfaces, and even multiple ports to connect to an Ethernet cable, for example. Each interface gets its own folder, as they can have different configurations. Editing these files can change device configurations, but the only way to actually use these interfaces is by calling the Kernel directly. The Kernel can, in turn, create a virtual file in memory, which is then passed as an ID to the application. The application still receives it as a regular file ID (File Descriptor), like with any other device, but it works differently from the Kernel's perspective.
|
||||
A GPU works similarly, and although the Kernel exposes these devices as files, they are not real files in the filesystem, as doing so would slow them down immensely.
|
||||
|
||||
### GPUs
|
||||
|
||||
At the startup time, a device file is generated for the GPU, like any other device.
|
||||
When an application attempts to use the GPU, it first searches for a **Graphics API** to use with it. Examples include Vulkan, OpenGL and DirectX.
|
||||
These APIs are code functions that forward the requests to a library such as `Mesa`.
|
||||
|
||||
`Mesa` then calls the Kernel's DRM (Direct Rendering Engine), which then calls the GPU driver to provide GPU capabilities.
|
||||
The GPU still has a device file, which is used by the Kernel's DRM and Mesa, but most commands are delivered to the GPU driver directly.
|
||||
|
||||
## File Systems
|
||||
|
||||
> This section is heavily simplified and only covers `EXT2-4`.
|
||||
|
||||
### Concepts
|
||||
|
||||
- An `inode` provides the following information:
|
||||
- Pointer to the file
|
||||
- Creation date / Modified times
|
||||
- Permissions
|
||||
- A `directory (table)` contains the data before the current directory, the directory itself, and every file inside that directory.
|
||||
- A `block` is the standard data unit for data in a hard drive. (Same size as memory pages. Ex `x86` CPU would use `4 KB` as the block size.)
|
||||
|
||||
|
||||
### EXT2
|
||||
|
||||
Uses linked lists to store and lookup data, to keep the implementation of the filesystem itself as simple as possible. A simple filesystem makes it easier to repair (or skip) broken sectors on the hard drive.
|
||||
|
||||
#### Partition Layout
|
||||
|
||||
![[EXT2.png]]
|
||||
|
||||
### EXT3
|
||||
|
||||
#### Journal
|
||||
|
||||
`EXT3` implements a journal to act as a buffer after a crash. If any operation in the journal fails, because it was logged, the filesystem is able to recover and finish any pending operations quickly, and not lose data. `EXT2` had another issue, where if an opened directory were deleted, its `inode` wouldn't be deleted, leaving an orphaned, empty `inode` on the filesystem. If the program holding it was to be closed, the `inode` would be deleted, but in the event of a crash, the `inode` would be left in the filesystem, with no way to be freed.
|
||||
|
||||
#### HTrees
|
||||
|
||||
`EXT3` can also use a [[ready/algorithms-and-data/index]] instead of a linked list to store directory entries, making lookup times much faster. To build the HTree, all filenames are hashed and ordered, making the implementation more complex. This feature is disabled by default.
|
||||
|
||||
#### Scalability
|
||||
|
||||
Before, only one core could write to the *superblock* at a time, but `EXT3` updates `inode` and `block` count at the *block group descrip_t_or* level. The superblock is only updated through a system call: `statfs()`, or if the filesystem is unmounted.
|
||||
`EXT3` also removed *big kernel locks* (deprecated feature that added the ability to freeze the kernel), and `sleep_on()`, which was replaced with `wait_event()`, preventing infinite loops.
|
||||
These patches improved multicore performance by over 10x.
|
||||
|
||||
#### Preallocation / Reservation
|
||||
|
||||
Writing two files simultaneously can create noncontinuous space.
|
||||
![[image6.png]]
|
||||
Because `EXT3` was designed to be used with HDDs, and separate portions of a file would slow down read speeds, `EXT3` implemented a preallocation/reservation system.
|
||||
Inside the block bitmap, a few extra blocks were preallocated, storing both files in separate locations.
|
||||
![[image7.png]]
|
||||
Instead of `EXT2`, where errors were corrected directly in the hard drive, `EXT3` reserves space for each specific `inode` in memory. In the event of a crash, all data would be stored in memory, and thus, not corrupting the HDD itself.
|
||||
|
||||
#### Online Resizer
|
||||
|
||||
`EXT3` also implements a protocol to support `LVM`, which allows for many disks to be used as a single partition. The largest possible space `EXT3` supports without patches is 16 GB.
|
||||
|
||||
#### Partition Layout
|
||||
|
||||
![[EXT3.png]]
|
||||
|
||||
### EXT4
|
||||
|
||||
#### Larger FS
|
||||
|
||||
`EXT3` can only support up to 16 TB. This is why `EXT4` was created.
|
||||
Instead of ==32 bits== capacity to count blocks, `EXT4` divides each entry in the block descriptor table in two parts: An upper, and a lower entry. This lower entry extends the upper one, and since each supports up to ==32 bits==, the total supported block count (in the block descriptor table) rises to ==64 bits== (16 TB → 1,000,000,000 TB).
|
||||
|
||||
#### Extents
|
||||
|
||||
Instead of using block mapping (the filesystem allocates blocks individually for each file), which can lead to fragmentation, `EXT4` uses **extents**, a range of contiguous blocks, allocated to each file.
|
||||
This uses a 48 bit system, which limits the FS capacity to 1 EB (1,000,000 TB).
|
||||
Each extent can point to 128 MB of data, or 1 block group.
|
||||
|
||||
#### Compatibility
|
||||
|
||||
The `EXT4` driver supports `EXT3` as well, and so, the Linux kernel only uses the `EXT2` and `EXT4` drivers. The `EXT3` driver was removed as the new one is more performant.
|
||||
|
||||
#### HTrees
|
||||
|
||||
HTrees are now enabled by default, allowing up to 10 million subdirectories. However, `EXT4` implements a Three Level HTree, which can be enabled using the `large_dir` flag, and extends this limit to 2 Billion subdirectories.
|
||||
|
||||
#### Fast FS Check
|
||||
|
||||
The `big_itable_unused` field was added to the block descriptor table, allowing for fast filesystem checks and error correction, as well as some other improvements.
|
||||
|
||||
#### Multiblock Allocation
|
||||
|
||||
Previously, each block needed one call to be allocated. `EXT4` added support for multi-block allocation, which means that only one call is needed to allocate multiple blocks.
|
||||
|
||||
#### Delayed Allocation
|
||||
|
||||
Every write command is delayed for as long as possible, making it so that changes can be made in memory before they affect (and possible fragment) the actual drive.
|
||||
|
||||
#### Persistent PreAllocaition
|
||||
|
||||
The FS can now be called to preallocate an empty extent, so, once that file is populated, it stays as a contiguous space.
|
||||
|
||||
#### Metadata Checksums
|
||||
|
||||
Metadata is checked often, which helps find any issues with the file system, as each data structure is now properly 'documented'.
|
||||
|
||||
#### Better Times
|
||||
|
||||
- A creation time was added;
|
||||
- The time precision was increased to nanoseconds instead of only seconds;
|
||||
- The maximum supported time was increased as well (the standard UNIX time can only go up to 2038).
|
||||
|
||||
#### Extended Attributes
|
||||
|
||||
The filesystem can also be customized with new entries at the end of each `inode`.
|
||||
|
||||
#### Quotas
|
||||
|
||||
`EXT4` also supports adding limits to the size of a file, or even multiple files spread across the filesystem.
|
||||
|
||||
#### Barriers
|
||||
|
||||
Some hard drives have caches, which impact the journal, sometimes causing it to be written after the cache, which would create conflicts. To fix this issue, `EXT4` creates a 'barrier', preventing the disk from writing data before the journal is written to the drive. This feature impacts performance, but is also very needed.
|
||||
|
||||
#### Flexible Block Groups
|
||||
|
||||
Groups blocks together, isolating chucks to write data on, which helps make data more contiguous.
|
||||
|
||||
#### Meta Block Groups
|
||||
|
||||
If the whole filesystem was only a single block group, it would max out at 256 TB of total data. Using meta block groups, this limit is increased to 32 bits of block group descriptor, which makes the **total capacity of the filesystem** ==**512 PB**==.
|
||||
|
||||
#### Partition Layout
|
||||
|
||||
[https://maplecircuit.dev/linux/fs/ext/ext4.html](https://maplecircuit.dev/linux/fs/ext/ext4.html)
|
||||
191
content/notes/drafts/lua.md
Normal file
191
content/notes/drafts/lua.md
Normal file
@@ -0,0 +1,191 @@
|
||||
---
|
||||
Status: Planned
|
||||
Created by: Trude EH
|
||||
tags:
|
||||
- notes
|
||||
- programming
|
||||
author: TrudeEH
|
||||
draft: true
|
||||
searchHidden: false
|
||||
showToc: true
|
||||
title: Lua
|
||||
---
|
||||
Embedded language.
|
||||
#todo
|
||||
|
||||
## Comments
|
||||
|
||||
```Lua
|
||||
-- One-Line comment
|
||||
--[[ Multi-line
|
||||
comment
|
||||
--]]
|
||||
```
|
||||
|
||||
## Simple Literals
|
||||
|
||||
```Lua
|
||||
local number = 5
|
||||
local string = "hello, world"
|
||||
local single = 'same as using \"'
|
||||
local multiline = [[ Multi
|
||||
line
|
||||
string ]]
|
||||
local yes, no = true, false
|
||||
local nothing = nil
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
Functions can be stored as values.
|
||||
|
||||
```Lua
|
||||
local function hello(name)
|
||||
print("Hello", name)
|
||||
end
|
||||
local greet = function(name)
|
||||
-- .. is string concaternation
|
||||
print("Hello " .. name .. "!")
|
||||
end
|
||||
-- Calling a function
|
||||
greet("Trude")
|
||||
greet "Trude"
|
||||
```
|
||||
|
||||
Functions can also return other functions.
|
||||
|
||||
```Lua
|
||||
local high = function(value)
|
||||
return function(value2)
|
||||
return value + value2
|
||||
end
|
||||
end
|
||||
local add_one = high(1)
|
||||
print("1 + 2 -> ", add_one(2))
|
||||
```
|
||||
|
||||
Functions can return multiple values.
|
||||
|
||||
```Lua
|
||||
local return_four_values = function()
|
||||
return 1, 2, 3, 4
|
||||
end
|
||||
first, second, third = return_four_values() -- "4" was discarded.
|
||||
```
|
||||
|
||||
Variable arguments.
|
||||
|
||||
```Lua
|
||||
local variable_arguments = function( ... )
|
||||
local arguments = { ... }
|
||||
for i, v in ipairs({ ... }) do print(i, v) end
|
||||
end
|
||||
print(variable_arguments("this", "is", "a", "test"))
|
||||
```
|
||||
|
||||
## Tables
|
||||
|
||||
Lua's only data structure. (Also used for maps and lists)
|
||||
|
||||
### As lists…
|
||||
|
||||
```Lua
|
||||
local list = { "first", 2, false, function() print("Fourth") end }
|
||||
print("Lua is 1-indexed:", list[1])
|
||||
```
|
||||
|
||||
### As maps…
|
||||
|
||||
```Lua
|
||||
local t = {
|
||||
literal_key = "a string",
|
||||
["an expression"] = "also works",
|
||||
[function() end] = true
|
||||
}
|
||||
print("literal_key : ", t.literal_key)
|
||||
print("an expression : ", t["an expression"]
|
||||
print("function() end : ", t[function() end]) -- nothing will be printed here, because each function definition points to a different memory address.
|
||||
```
|
||||
|
||||
### Colon Functions
|
||||
|
||||
```Lua
|
||||
local T = {}
|
||||
function T.something(self, ... ) end
|
||||
function T:something( ... ) end -- Same as the previous line
|
||||
```
|
||||
|
||||
### Metatables
|
||||
|
||||
```Lua
|
||||
local vector_mt = {}
|
||||
vector_mt.__add = function(left, right)
|
||||
return setmetatable({
|
||||
left[1] + right[1],
|
||||
left[2] + right[2],
|
||||
left[3] + right[3]
|
||||
}, vector_mt)
|
||||
end
|
||||
local v1 = setmetatable({ 3, 1, 5 }, vector_mt)
|
||||
local v2 = setmetatable({ -3, 2, 2}, vector_mt)
|
||||
local v3 = v1 + v2 -- normally would produce an error, but doesn't, since the __add keyword was used.
|
||||
print(v3[1], v3[2], v3[3])
|
||||
```
|
||||
|
||||
## Control Flow
|
||||
|
||||
### For
|
||||
|
||||
#### Lists
|
||||
|
||||
```Lua
|
||||
local favs = { "ThePrimeagen", "ctt", "NoBoilerplate" }
|
||||
for index = 1, \#favs do -- # is the length operator (does not work on maps!)
|
||||
print(index, favs[index])
|
||||
end
|
||||
for index, value in ipairs(favs) do -- ipairs return the index and values of that index
|
||||
print(index, value)
|
||||
end
|
||||
```
|
||||
|
||||
#### Maps
|
||||
|
||||
```Lua
|
||||
local favs = { ThePrimeagen = 9.5, NoBoilerplate = "N/A" }
|
||||
for key, value in pairs(favs) do -- pairs return the index and values of that key
|
||||
print(key, value)
|
||||
end
|
||||
```
|
||||
|
||||
### If
|
||||
|
||||
```Lua
|
||||
local function action(visit_page)
|
||||
if visit_page then
|
||||
print("Opening new tab...")
|
||||
else
|
||||
print("Skipping...")
|
||||
end
|
||||
end
|
||||
-- "falsey": nil, false
|
||||
action() -- Same as: action(nil)
|
||||
action(false)
|
||||
-- Everything else is "truthy"
|
||||
action(true)
|
||||
action(0)
|
||||
action({})
|
||||
```
|
||||
|
||||
## Modules
|
||||
|
||||
Modules are just files.
|
||||
|
||||
```Lua
|
||||
-- module.lua
|
||||
local M = {}
|
||||
M.some_function = function() end
|
||||
return M
|
||||
-- main.lua
|
||||
local something = require("module")
|
||||
something.some_function()
|
||||
```
|
||||
62
content/notes/drafts/macOS.md
Normal file
62
content/notes/drafts/macOS.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
Status: In progress
|
||||
Created by: Trude EH
|
||||
tags:
|
||||
- notes
|
||||
- os
|
||||
author: TrudeEH
|
||||
draft: true
|
||||
searchHidden: false
|
||||
showToc: true
|
||||
title: macOS
|
||||
---
|
||||
#todo
|
||||
## System Data
|
||||
|
||||
System data is anything in the following locations:
|
||||
- `/Library`
|
||||
- `/System`
|
||||
- `~Library`
|
||||
- `/usr`
|
||||
- `.hidden_files`
|
||||
|
||||
## Memory
|
||||
|
||||
- Physical Memory - Total system memory
|
||||
- Memory Used
|
||||
- App Memory - Memory used for apps
|
||||
- Wired Memory - System memory
|
||||
- Compressed - Memory used by apps, but compressed as it is not immediately needed
|
||||
- Cached Files - Files saved in memory for faster launching
|
||||
- Swap Used - Memory stored in the SSD
|
||||
|
||||
### Memory Pressure
|
||||
|
||||
A measurement of how well macOS is managing the available memory.
|
||||
- Green/Low: Normal function; No tricks needed.
|
||||
- Yellow/Medium: There is not enough memory as-is, so macOS is actively compressing and decompressing memory as needed.
|
||||
- Red/High: Aside from compression, macOS is using the swap heavily.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### System and Apps
|
||||
|
||||
|Description|Fix|
|
||||
|---|---|
|
||||
|Fix "App X is damaged and can't be opened."|`xattr -c <path/to/application.app>`|
|
||||
|Disable the Dock autohide delay|Fix: <br> <br>`defaults write com.apple.dock autohide-delay -float 0; defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock` <br> <br>Restore defaults: <br> <br>`defaults delete com.apple.Dock autohide-delay; killall Dock`|
|
||||
|||
|
||||
|||
|
||||
|
||||
### Gaming
|
||||
|
||||
|Issue / Error / Description|Fix|
|
||||
|---|---|
|
||||
|Improve Terraria performance (and some other games)|Add `/gldevice:Vulkan` as a launch argument (on Steam).|
|
||||
|||
|
||||
|
||||
### Flash IMG File to Disk
|
||||
|
||||
1. `diskutil list` → Find the path to the device (`/dev/XXX`)
|
||||
2. `diskutil unmount /dev/XXX` → Unmount the disk
|
||||
3. `sudo dd if=image.img of=/dev/XXX bs=1M oflag=direct,sync status=progress`
|
||||
Reference in New Issue
Block a user