vault backup: 2024-04-16 16:47:25
This commit is contained in:
7
.obsidian/themes/Obsidian Nord/manifest.json
vendored
Normal file
7
.obsidian/themes/Obsidian Nord/manifest.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "Obsidian Nord",
|
||||
"version": "0.2.0",
|
||||
"minAppVersion": "0.16.0",
|
||||
"author": "insanum",
|
||||
"authorUrl": "https://insanum.com"
|
||||
}
|
525
.obsidian/themes/Obsidian Nord/theme.css
vendored
Normal file
525
.obsidian/themes/Obsidian Nord/theme.css
vendored
Normal file
@@ -0,0 +1,525 @@
|
||||
|
||||
:root
|
||||
{
|
||||
--dark0_x: 46,52,64; /* #2e3440 */
|
||||
--dark0: rgb(var(--dark0_x));
|
||||
--dark1_x: 59,66,82; /* #3b4252 */
|
||||
--dark1: rgb(var(--dark1_x));
|
||||
--dark2_x: 67,76,94; /* #434c5e */
|
||||
--dark2: rgb(var(--dark2_x));
|
||||
--dark3_x: 76,86,106; /* #4c566a */
|
||||
--dark3: rgb(var(--dark3_x));
|
||||
|
||||
--light0_x: 216,222,233; /* #d8dee9 */
|
||||
--light0: rgb(var(--light0_x));
|
||||
--light1_x: 229,233,240; /* #e5e9f0 */
|
||||
--light1: rgb(var(--light1_x));
|
||||
--light2_x: 236,239,244; /* #eceff4 */
|
||||
--light2: rgb(var(--light2_x));
|
||||
--light3_x: 255,255,255; /* #ffffff */
|
||||
--light3: rgb(var(--light3_x));
|
||||
|
||||
--frost0_x: 143,188,187; /* #8fbcbb */
|
||||
--frost0: rgb(var(--frost0_x));
|
||||
--frost1_x: 136,192,208; /* #88c0d0 */
|
||||
--frost1: rgb(var(--frost1_x));
|
||||
--frost2_x: 129,161,193; /* #81a1c1 */
|
||||
--frost2: rgb(var(--frost2_x));
|
||||
--frost3_x: 94,129,172; /* #5e81ac */
|
||||
--frost3: rgb(var(--frost3_x));
|
||||
|
||||
--red_x: 191,97,106; /* #bf616a */
|
||||
--red: rgb(var(--red_x));
|
||||
--orange_x: 208,135,112; /* #d08770 */
|
||||
--orange: rgb(var(--orange_x));
|
||||
--yellow_x: 235,203,139; /* #ebcb8b */
|
||||
--yellow: rgb(var(--yellow_x));
|
||||
--green_x: 163,190,140; /* #a3be8c */
|
||||
--green: rgb(var(--green_x));
|
||||
--purple_x: 180,142,173; /* #b48ead */
|
||||
--purple: rgb(var(--purple_x));
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
--accent-h: 354; /* --red #bf616a */
|
||||
--accent-s: 42%;
|
||||
--accent-l: 56%;
|
||||
|
||||
--link-decoration: none;
|
||||
--link-decoration-hover: none;
|
||||
--link-external-decoration: none;
|
||||
--link-external-decoration-hover: none;
|
||||
|
||||
--tag-decoration: none;
|
||||
--tag-decoration-hover: underline;
|
||||
--tag-padding-x: .5em;
|
||||
--tag-padding-y: .2em;
|
||||
--tag-radius: .5em;
|
||||
|
||||
--tab-font-weight: 600;
|
||||
--bold-weight: 600;
|
||||
|
||||
--checkbox-radius: 0;
|
||||
|
||||
/* --list-indent: 2em; */
|
||||
|
||||
--embed-border-left: 6px double var(--interactive-accent);
|
||||
}
|
||||
|
||||
.theme-dark
|
||||
{
|
||||
--color-red-rgb: var(--red_x);
|
||||
--color-red: var(--red);
|
||||
--color-purple-rgb: var(--purple_x);
|
||||
--color-purple: var(--purple);
|
||||
--color-green-rgb: var(--green_x);
|
||||
--color-green: var(--green);
|
||||
--color-cyan-rgb: var(--frost1_x);
|
||||
--color-cyan: var(--frost1);
|
||||
--color-blue-rgb: var(--frost3_x);
|
||||
--color-blue: var(--frost3);
|
||||
--color-yellow-rgb: var(--yellow_x);
|
||||
--color-yellow: var(--yellow);
|
||||
--color-orange-rgb: var(--orange_x);
|
||||
--color-orange: var(--orange);
|
||||
/* --color-pink: var(--purple); */
|
||||
|
||||
--background-primary: var(--dark0);
|
||||
--background-primary-alt: var(--dark0);
|
||||
--background-secondary: var(--dark1);
|
||||
--background-secondary-alt: var(--dark2);
|
||||
--background-modifier-border: var(--dark2);
|
||||
|
||||
--cursor-line-background: rgba(var(--red_x), 0.2);
|
||||
|
||||
--text-normal: var(--light2);
|
||||
--text-faint: var(--light0);
|
||||
--text-muted: var(--light1);
|
||||
|
||||
--link-url: var(--purple);
|
||||
|
||||
--h1-color: var(--red);
|
||||
--h2-color: var(--yellow);
|
||||
--h3-color: var(--green);
|
||||
--h4-color: var(--purple);
|
||||
--h5-color: var(--frost0);
|
||||
--h6-color: var(--frost2);
|
||||
|
||||
--text-highlight-bg: var(--frost1);
|
||||
--text-highlight-fg: var(--dark0);
|
||||
|
||||
--text-accent: var(--orange);
|
||||
--text-accent-hover: var(--frost2);
|
||||
|
||||
--tag-color: var(--frost0);
|
||||
--tag-background: var(--dark2);
|
||||
--tag-background-hover: var(--dark1);
|
||||
|
||||
--titlebar-text-color-focused: var(--red);
|
||||
|
||||
--inline-title-color: var(--yellow);
|
||||
|
||||
--bold-color: var(--yellow);
|
||||
--italic-color: var(--yellow);
|
||||
|
||||
--checkbox-color: var(--frost0);
|
||||
--checkbox-color-hover: var(--frost0);
|
||||
--checkbox-border-color: var(--frost0);
|
||||
--checkbox-border-color-hover: var(--frost0);
|
||||
--checklist-done-color: rgba(var(--light2_x), 0.5);
|
||||
|
||||
--table-header-background: hsl(220, 16%, 16%);
|
||||
--table-header-background-hover: var(--dark3);
|
||||
--table-row-even-background: hsl(220, 16%, 20%);
|
||||
--table-row-odd-background: hsl(220, 16%, 24%);
|
||||
--table-row-background-hover: var(--dark3);
|
||||
|
||||
--text-selection: rgba(var(--red_x), 0.6);
|
||||
--flashing-background: rgba(var(--red_x), 0.3);
|
||||
|
||||
--code-normal: var(--frost1);
|
||||
--code-background: var(--dark1);
|
||||
|
||||
--mermaid-note: var(--frost3);
|
||||
--mermaid-loopline: var(--frost1);
|
||||
--mermaid-exclude: var(--dark3);
|
||||
--mermaid-seqnum: var(--dark0);
|
||||
|
||||
--icon-color-hover: var(--red);
|
||||
--icon-color-focused: var(--frost2);
|
||||
|
||||
--nav-item-color-hover: var(--red);
|
||||
--nav-item-color-active: var(--frost2);
|
||||
--nav-file-tag: rgba(var(--yellow_x), 0.9);
|
||||
|
||||
--graph-line: var(--dark3);
|
||||
--graph-node: var(--light3);
|
||||
--graph-node-tag: var(--red);
|
||||
--graph-node-attachment: var(--green);
|
||||
|
||||
--calendar-hover: var(--red);
|
||||
--calendar-background-hover: var(--dark3);
|
||||
--calendar-week: var(--yellow);
|
||||
--calendar-today: var(--yellow);
|
||||
|
||||
--dataview-key: var(--text-faint);
|
||||
--dataview-key-background: rgba(var(--frost2_x), 0.3);
|
||||
--dataview-value: var(--text-faint);
|
||||
--dataview-value-background: rgba(var(--red_x), 0.3);
|
||||
|
||||
--tab-text-color-focused-active: var(--frost2);
|
||||
--tab-text-color-focused-active-current: var(--red);
|
||||
}
|
||||
|
||||
.theme-light
|
||||
{
|
||||
--color-red-rgb: var(--red_x);
|
||||
--color-red: var(--red);
|
||||
--color-purple-rgb: var(--purple_x);
|
||||
--color-purple: var(--purple);
|
||||
--color-green-rgb: var(--green_x);
|
||||
--color-green: var(--green);
|
||||
--color-cyan-rgb: var(--frost1_x);
|
||||
--color-cyan: var(--frost1);
|
||||
--color-blue-rgb: var(--frost3_x);
|
||||
--color-blue: var(--frost3);
|
||||
--color-yellow-rgb: var(--yellow_x);
|
||||
--color-yellow: var(--yellow);
|
||||
--color-orange-rgb: var(--orange_x);
|
||||
--color-orange: var(--orange);
|
||||
/* --color-pink: var(--purple); */
|
||||
|
||||
--background-primary: var(--light3);
|
||||
--background-primary-alt: var(--light3);
|
||||
--background-secondary: var(--light2);
|
||||
--background-secondary-alt: var(--light1);
|
||||
--background-modifier-border: var(--light1);
|
||||
|
||||
--cursor-line-background: rgba(var(--red_x), 0.1);
|
||||
|
||||
--text-normal: var(--dark2);
|
||||
--text-faint: var(--dark0);
|
||||
--text-muted: var(--dark1);
|
||||
|
||||
--link-url: var(--purple);
|
||||
|
||||
--h1-color: var(--red);
|
||||
--h2-color: var(--yellow);
|
||||
--h3-color: var(--green);
|
||||
--h4-color: var(--purple);
|
||||
--h5-color: var(--frost0);
|
||||
--h6-color: var(--frost2);
|
||||
|
||||
--text-highlight-bg: var(--yellow);
|
||||
--text-highlight-fg: var(--dark0);
|
||||
|
||||
--text-accent: var(--orange);
|
||||
--text-accent-hover: var(--frost2);
|
||||
|
||||
--tag-color: var(--dark3);
|
||||
--tag-background: var(--light1);
|
||||
--tag-background-hover: var(--light0);
|
||||
|
||||
--titlebar-text-color-focused: var(--red);
|
||||
|
||||
--inline-title-color: var(--yellow);
|
||||
|
||||
--bold-color: var(--green);
|
||||
--italic-color: var(--green);
|
||||
|
||||
--checkbox-color: var(--frost2);
|
||||
--checkbox-color-hover: var(--frost2);
|
||||
--checkbox-border-color: var(--frost2);
|
||||
--checkbox-border-color-hover: var(--frost2);
|
||||
--checklist-done-color: rgba(var(--dark2_x), 0.4);
|
||||
|
||||
--table-header-background: rgba(var(--light2_x), 0.2);
|
||||
--table-header-background-hover: var(--frost2);
|
||||
--table-row-even-background: rgba(var(--light2_x), 0.4);
|
||||
--table-row-odd-background: rgba(var(--light2_x), 0.8);
|
||||
--table-row-background-hover: var(--frost2);
|
||||
|
||||
--text-selection: rgba(var(--red_x), 0.6);
|
||||
--flashing-background: rgba(var(--red_x), 0.3);
|
||||
|
||||
--code-normal: var(--frost1);
|
||||
--code-background: var(--light2);
|
||||
|
||||
--mermaid-note: var(--frost0);
|
||||
--mermaid-loopline: var(--frost1);
|
||||
--mermaid-exclude: var(--light0);
|
||||
--mermaid-seqnum: var(--light0);
|
||||
|
||||
--icon-color-hover: var(--red);
|
||||
--icon-color-focused: var(--frost3);
|
||||
|
||||
--nav-item-color-hover: var(--red);
|
||||
--nav-item-color-active: var(--frost2);
|
||||
--nav-file-tag: rgba(var(--orange_x), 0.9);
|
||||
|
||||
--graph-line: var(--light0);
|
||||
--graph-node: var(--dark3);
|
||||
--graph-node-tag: var(--red);
|
||||
--graph-node-attachment: var(--green);
|
||||
|
||||
--calendar-hover: var(--red);
|
||||
--calendar-background-hover: var(--light0);
|
||||
--calendar-week: var(--orange);
|
||||
--calendar-today: var(--orange);
|
||||
|
||||
--dataview-key: var(--text-faint);
|
||||
--dataview-key-background: rgba(var(--frost2_x), 0.3);
|
||||
--dataview-value: var(--text-faint);
|
||||
--dataview-value-background: rgba(var(--red_x), 0.3);
|
||||
|
||||
--tab-text-color-focused-active: var(--frost2);
|
||||
--tab-text-color-focused-active-current: var(--red);
|
||||
}
|
||||
|
||||
table
|
||||
{
|
||||
border: 1px solid var(--background-secondary) !important;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
thead
|
||||
{
|
||||
border-bottom: 2px solid var(--background-modifier-border) !important;
|
||||
}
|
||||
|
||||
th
|
||||
{
|
||||
font-weight: 600 !important;
|
||||
border: 1px solid var(--background-secondary) !important;
|
||||
}
|
||||
|
||||
td
|
||||
{
|
||||
border-left: 1px solid var(--background-secondary) !important;
|
||||
border-right: 1px solid var(--background-secondary) !important;
|
||||
border-bottom: 1px solid var(--background-secondary) !important;
|
||||
}
|
||||
|
||||
.markdown-rendered tbody tr:nth-child(even)
|
||||
{
|
||||
background-color: var(--table-row-even-background) !important;
|
||||
}
|
||||
|
||||
.markdown-rendered tbody tr:nth-child(odd)
|
||||
{
|
||||
background-color: var(--table-row-odd-background) !important;
|
||||
}
|
||||
|
||||
.markdown-rendered tbody tr:nth-child(even):hover,
|
||||
.markdown-rendered tbody tr:nth-child(odd):hover
|
||||
{
|
||||
background-color: var(--table-row-background-hover) !important;
|
||||
}
|
||||
|
||||
.markdown-rendered mark
|
||||
{
|
||||
background-color: var(--text-highlight-bg);
|
||||
color: var(--text-highlight-fg);
|
||||
}
|
||||
|
||||
.markdown-rendered mark a
|
||||
{
|
||||
color: var(--red) !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.search-result-file-matched-text
|
||||
{
|
||||
color: var(--text-highlight-fg) !important;
|
||||
}
|
||||
|
||||
.cm-hashtag-begin:hover, .cm-hashtag-end:hover
|
||||
{
|
||||
color: var(--text-accent);
|
||||
/* background-color: var(--tag-background-hover); */
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
input[type=checkbox]
|
||||
{
|
||||
border: 1px solid var(--checkbox-color);
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked
|
||||
{
|
||||
background-color: var(--checkbox-color);
|
||||
box-shadow: inset 0 0 0 2px var(--background-primary);
|
||||
}
|
||||
|
||||
input[type=checkbox]:checked:after
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"]
|
||||
{
|
||||
line-height: var(--line-height-tight) !important;
|
||||
}
|
||||
|
||||
.cm-url
|
||||
{
|
||||
color: var(--link-url) !important;
|
||||
}
|
||||
|
||||
.cm-url:hover
|
||||
{
|
||||
color: var(--text-accent-hover) !important;
|
||||
}
|
||||
|
||||
/* Keep highlight/marks the same between viewer and editor. */
|
||||
.cm-highlight
|
||||
{
|
||||
color: var(--text-highlight-fg) !important;
|
||||
}
|
||||
|
||||
/* Keep inline code the same between viewer and editor. */
|
||||
.cm-inline-code
|
||||
{
|
||||
border-radius: var(--radius-s);
|
||||
font-size: var(--code-size);
|
||||
padding: 0.1em 0.25em;
|
||||
}
|
||||
|
||||
.cm-formatting-code + .cm-inline-code
|
||||
{
|
||||
border-radius: 0;
|
||||
padding: 0.1em 0;
|
||||
}
|
||||
|
||||
.cm-formatting-code
|
||||
{
|
||||
border-radius: var(--radius-s) 0 0 var(--radius-s);
|
||||
padding: 0.1em 0 0.1em 0.25em;
|
||||
}
|
||||
|
||||
.cm-inline-code + .cm-formatting-code
|
||||
{
|
||||
border-radius: 0 var(--radius-s) var(--radius-s) 0;
|
||||
padding: 0.1em 0.25em 0.1em 0;
|
||||
}
|
||||
|
||||
.cm-line .cm-strong
|
||||
{
|
||||
color: var(--bold-color) !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* Keep list bullet padding the same between viewer and editor.
|
||||
* This is annoying with the cursor in the editor as there is a gap.
|
||||
*/
|
||||
/*
|
||||
.cm-formatting-list
|
||||
{
|
||||
padding-right: 4px !important;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Keep sub-list indenting the same between viewer and editor.
|
||||
* This assumes --list-indent is default at 2em.
|
||||
*/
|
||||
/*
|
||||
.cm-indent
|
||||
{
|
||||
text-indent: 1em !important;
|
||||
}
|
||||
*/
|
||||
|
||||
.mermaid .note
|
||||
{
|
||||
fill: var(--mermaid-note) !important;
|
||||
}
|
||||
|
||||
.mermaid .loopLine,
|
||||
{
|
||||
stroke: var(--mermaid-loopline) !important;
|
||||
}
|
||||
|
||||
.mermaid .loopText>tspan,
|
||||
.mermaid .entityLabel
|
||||
{
|
||||
fill: var(--red) !important;
|
||||
}
|
||||
|
||||
.mermaid .exclude-range
|
||||
{
|
||||
fill: var(--mermaid-exclude) !important;
|
||||
}
|
||||
|
||||
.mermaid .sequenceNumber
|
||||
{
|
||||
fill: var(--mermaid-seqnum) !important;
|
||||
}
|
||||
|
||||
.calendar .week-num
|
||||
{
|
||||
color: var(--calendar-week) !important;
|
||||
}
|
||||
|
||||
.calendar .today
|
||||
{
|
||||
color: var(--calendar-today) !important;
|
||||
}
|
||||
|
||||
.calendar .week-num:hover,
|
||||
.calendar .day:hover
|
||||
{
|
||||
color: var(--calendar-hover) !important;
|
||||
background-color: var(--calendar-background-hover) !important;
|
||||
}
|
||||
|
||||
.markdown-embed-title
|
||||
{
|
||||
color: var(--yellow);
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.cm-active
|
||||
{
|
||||
background-color: var(--cursor-line-background) !important;
|
||||
}
|
||||
|
||||
.nav-file-tag
|
||||
{
|
||||
color: var(--nav-file-tag) !important;
|
||||
}
|
||||
|
||||
.is-flashing
|
||||
{
|
||||
background-color: var(--flashing-background) !important;
|
||||
}
|
||||
|
||||
.dataview.inline-field-key
|
||||
{
|
||||
border-top-left-radius: var(--radius-s);
|
||||
border-bottom-left-radius: var(--radius-s);
|
||||
padding-left: 4px;
|
||||
font-family: var(--font-monospace);
|
||||
font-size: var(--font-smaller);
|
||||
color: var(--dataview-key) !important;
|
||||
background-color: var(--dataview-key-background) !important;
|
||||
}
|
||||
|
||||
.dataview.inline-field-value
|
||||
{
|
||||
border-top-right-radius: var(--radius-s);
|
||||
border-bottom-right-radius: var(--radius-s);
|
||||
padding-right: 4px;
|
||||
font-family: var(--font-monospace);
|
||||
font-size: var(--font-smaller);
|
||||
color: var(--dataview-value) !important;
|
||||
background-color: var(--dataview-value-background) !important;
|
||||
}
|
||||
|
||||
.suggestion-highlight
|
||||
{
|
||||
color: var(--red);
|
||||
}
|
||||
|
62
.obsidian/workspace.json
vendored
62
.obsidian/workspace.json
vendored
@@ -7,18 +7,6 @@
|
||||
"id": "18e28060fe2de0a2",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "f5285cbbb611ecba",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Semester 2/Programming 2/Week 10 Revision/Q5.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "d83bb0bbeeb86eec",
|
||||
"type": "leaf",
|
||||
@@ -30,9 +18,37 @@
|
||||
"source": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "3ed058b7ba32ddc0",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Semester 2/Database Systems/Week 11/Week 11 Database Systems.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
},
|
||||
{
|
||||
"id": "6e12dd6a998cfc12",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "ec2850de42a22f4a",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "Semester 2/Database Systems/Exercise Booklet.pdf"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
@@ -99,7 +115,7 @@
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md",
|
||||
"file": "Semester 2/Database Systems/Week 11/Week 11 Database Systems.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
@@ -116,7 +132,7 @@
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md",
|
||||
"file": "Semester 2/Database Systems/Week 11/Week 11 Database Systems.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
@@ -139,7 +155,7 @@
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Semester 2/Database Systems/Trimester 2 Assignment.md"
|
||||
"file": "Semester 2/Database Systems/Week 11/Week 11 Database Systems.md"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -168,7 +184,7 @@
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 417.5
|
||||
"width": 211.5
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
@@ -179,12 +195,16 @@
|
||||
"switcher:Open quick switcher": false
|
||||
}
|
||||
},
|
||||
"active": "d83bb0bbeeb86eec",
|
||||
"active": "3ed058b7ba32ddc0",
|
||||
"lastOpenFiles": [
|
||||
"Semester 2/Database Systems/Week 8/Week 8 Database Systems.md",
|
||||
"Semester 2/Database Systems/Trimester 2 Assignment.md",
|
||||
"Semester 2/Database Systems/Week 11/Week 11 Database Systems.md",
|
||||
"Semester 2/Database Systems/Exercise Booklet.pdf",
|
||||
"Semester 2/Database Systems/Week 11",
|
||||
"Semester 2/Untitled",
|
||||
"Semester 2/Database Systems/Week 10/Week 10 Database Systems.md",
|
||||
"Semester 2/Database Systems/Week 9/Week 9 Database Systems.md",
|
||||
"Semester 2/Database Systems/Trimester 2 Assignment.md",
|
||||
"Semester 2/Database Systems/Week 8/Week 8 Database Systems.md",
|
||||
"images/Pasted image 20240415190127.png",
|
||||
"images/Pasted image 20240415190010.png",
|
||||
"images/Pasted image 20240415175614.png",
|
||||
@@ -203,9 +223,6 @@
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/resources",
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/package-summary.html",
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/package-list",
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/package-frame.html",
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/logfile.txt",
|
||||
"Semester 2/Programming 2/Project/Part 4 Complete/doc/index.html",
|
||||
"images/Pasted image 20240319234142.png",
|
||||
"images/Pasted image 20240319225420.png",
|
||||
"Semester 2/Programming 2/Week 10 Revision/Q4.md",
|
||||
@@ -225,7 +242,6 @@
|
||||
"Semester 2/Database Systems/Week 5/Week 5 Database Systems.md",
|
||||
"Semester 2/HCI/Week 2/Week 2 Human Computer Interfaces.md",
|
||||
"Semester 1/Database Systems/Week 11/Week 11 Database Systems.md",
|
||||
"Semester 1/Database Systems/Week 5/Week 5 Database Systems.md",
|
||||
"Database Systems/Untitled.canvas",
|
||||
"Untitled 1.canvas",
|
||||
"Untitled.canvas"
|
||||
|
@@ -24,7 +24,7 @@ If the "street" attribute is unneeded, less IO operations are needed to retrieve
|
||||
#### i)
|
||||
|
||||

|
||||
|
||||
# Add Projections
|
||||
#### ii)
|
||||
|
||||
Root Node: $\pi$ ( factory.name )
|
||||
@@ -41,32 +41,30 @@ Line-by-line:
|
||||
|
||||
# Q2
|
||||
|
||||
# **a)**
|
||||
### a)
|
||||
|
||||
*Consistency: Database should be in a consistent state, prior to a transaction and after. e.g. Following constraints, relationships, etc.
|
||||
Isolation: All transactions should by fully independent from concurrently executing transactions.
|
||||
Durability: When a transaction is committed, it's effect should be permanent in the database, withstanding system failures or restarts.*
|
||||
|
||||
*Atomicity: A transaction must be completed, or aborted. If a transaction fails, a DBMS ensures the rollback of data to allow the database to remain consistent.
|
||||
Consistency: A DBMS would enforce constraints on a transaction, assuring the defined rules / relationships are followed.
|
||||
Isolation: Reduces concurrency issues by restricting access to shared data until a transaction is committed.
|
||||
Durability: Guarantees data is permanent once committed, preventing inconsistency after failures.*
|
||||
Atomicity: A transaction must be completed, or aborted. If a transaction fails, a DBMS ensures the rollback of data to allow the database to remain consistent.
|
||||
Consistency: Database should be in a consistent state, prior to a transaction and after. A DBMS would enforce constraints on a transaction, assuring the defined rules / relationships are followed.
|
||||
Isolation: All transactions should by fully independent from concurrently executing transactions. Reduces concurrency issues by restricting access to shared data until a transaction is committed.
|
||||
Durability: Guarantees data is permanent once committed, preventing inconsistency after failures. Should withstand system failures or restarts.
|
||||
|
||||
### b)
|
||||
|
||||
To guarantee consistency, a DBMS handles the enforcement of atomicity, consistency, isolation and durability, along with concurrency control to prevent conflicts.
|
||||
Transfer of crates:
|
||||
|
||||
Ideal SQL Transfer of crates:
|
||||
|
||||
```sql
|
||||
UPDATE warehouses
|
||||
UPDATE warehouse
|
||||
SET crates = crates - 3
|
||||
WHERE wname = 'warehouse1'
|
||||
|
||||
UPDATE warehouses
|
||||
UPDATE warehouse
|
||||
SET crates = crates + 3
|
||||
WHERE wname = 'warehouse2';
|
||||
```
|
||||
|
||||
If the second query is not run, it is not the fault of the DBMS. A DBMS can only enforce ACID rules and ensure consistency, not transaction logic.
|
||||
### c)
|
||||
|
||||
By allowing concurrent execution of transactions, system resources are allocated more efficiently due to multiple operations occurring simultaneously. This has an effect of being more performant, since more transactions can be processed per second.
|
||||
@@ -114,7 +112,7 @@ Deadlock does not occur, since there are no cycles in the graph
|
||||
### d)
|
||||
|
||||
#### i)
|
||||
|
||||
# TO DO
|
||||
The recovery manager would first identify in-progress transactions at the time of failure
|
||||
|
||||
# Q4
|
||||
@@ -132,5 +130,45 @@ WHERE partPrice > 100;
|
||||
#### ii)
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
SELECT carModel
|
||||
FROM car
|
||||
JOIN carPart ON car.carId = carPart.carId
|
||||
GROUP BY car.carModel
|
||||
HAVING COUNT(carPart.partID) > 4;
|
||||
```
|
||||
|
||||
|
||||
### b)
|
||||
|
||||
If the DBA revoked auth from U2 -> U1, U4, and U5 would also have auth revoked due to cascading revokes. There is no path from U1, U4 or U5 to the DBA if U2's authorisation is revoked. U3 and U6 still have a path to the DBA, as they do not depend on U2 for authorisation, authorisation is still valid.
|
||||
|
||||
### c)
|
||||
|
||||
#### i)
|
||||
|
||||
```sql
|
||||
GRANT ALL PRIVILEGES ON * TO Isavella
|
||||
|
||||
CREATE VIEW employeeView AS
|
||||
SELECT *
|
||||
FROM employee
|
||||
|
||||
GRANT SELECT, UPDATE ON employeeView TO Laura, Naser;
|
||||
```
|
||||
|
||||
#### ii)
|
||||
|
||||
```sql
|
||||
CREATE VIEW projectsView AS
|
||||
SELECT *
|
||||
FROM project
|
||||
WHERE level = 'advanced'
|
||||
|
||||
GRANT SELECT ON projectsView TO Jane;
|
||||
```
|
||||
|
||||
#### iii)
|
||||
|
||||
```SQL
|
||||
REVOKE ALL PRIVILEGES ON * FROM Naser;
|
||||
```
|
@@ -0,0 +1,95 @@
|
||||
# SQL Injection
|
||||
|
||||
- Using SQL injection, attackers can
|
||||
- Add new data
|
||||
- Modify current data
|
||||
- Delete Data
|
||||
|
||||
## Example 1
|
||||
|
||||
$username $password
|
||||
```js
|
||||
$sql = "SELECT * FROM users WHERE username = ' " . $username " ' AND password = ' " . $password . " ' ";
|
||||
```
|
||||
|
||||
```sql
|
||||
SELECT * FROM users WHERE username = 'fred' AND password = 'Fr3dRu13S';
|
||||
```
|
||||
**.** concatenates
|
||||
|
||||
An attacker could circumvent the authentication by entering ` OR 1=1 --` into the username field
|
||||
- This would select all users from the database, since `1=1` is always true.
|
||||
- The rest of the query is then commented out with `--`.
|
||||
|
||||
```SQL
|
||||
SELECT * FROM users WHERE username = '' OR 1=1 -- ' AND password = 'Fr3dRu13s'
|
||||
```
|
||||
|
||||
In this statement, it would select all data from `users`, since the where clause is always true.
|
||||
|
||||
## Example 2
|
||||
|
||||
```SQL
|
||||
SELECT prodinfo FROM prodtable WHERE prodname = 'dvd'
|
||||
```
|
||||
|
||||
By using `dvd '; DROP TABLE prodtable; --`, the query would look like
|
||||
|
||||
```SQL
|
||||
SELECT prodinfo FROM prodtable WHERE prodname = 'dvd'; DROP TABLE prodtable; -- '
|
||||
```
|
||||
|
||||
Which would remove the entire product table.
|
||||
|
||||
## Avoiding SQL Injection
|
||||
|
||||
To avoid SQL injection, user inputs must be sanitised. This is achieved by escaping all characters that could be misused in the DBMS.
|
||||
However, application developers are not usually database experts - may not know which characters to be escaped.
|
||||
|
||||
### Parameterised Queries
|
||||
|
||||
The best way to avoid SQL injection is to use prepared statements.
|
||||
|
||||
```SQL
|
||||
SELECT * FROM users WHERE username = ? AND password = ?
|
||||
```
|
||||
|
||||
This query would then be sent to the DBMS with the values for the 2 variables.
|
||||
The values of these 2 variables will then automatically be used in place of the `?`, and the DBMS will sanitise the content of the variables using its own resources. This ensures new vulnerabilities will be handled by the DBMS rather than the developers of the application.
|
||||
|
||||
However, some values cannot be sanitised.
|
||||
|
||||
```SQL
|
||||
SELECT * FROM mytable WHERE id = 23
|
||||
|
||||
SELECT * FROM mytable WHERE id = 23 OR 1=1
|
||||
```
|
||||
|
||||
### Other Defences
|
||||
|
||||
- Checking Syntax for validity
|
||||
- Fixed formats, e.g email, dates, part numbers.
|
||||
- Verify input is valid in context
|
||||
- If possible, exclude quotes and semicolons
|
||||
- Have length limits on input
|
||||
- Many attacks depend on entering long strings.
|
||||
|
||||
# Chapter 37
|
||||
|
||||
## 1
|
||||
Backup mechanism, make copies of database and log
|
||||
Log File, keep track of state of transactions
|
||||
Checkpoints
|
||||
Recovery Manager
|
||||
## 2
|
||||
T2 Safe, commit before checkpoint
|
||||
T3 ignored, still running
|
||||
T1 redone, did not commit until after checkpoint
|
||||
## 3
|
||||
DBMS recovery is responsible for Durability and Atomicity
|
||||
## 4
|
||||
T1 committed after checkpoint, redo
|
||||
T2 running at failure, undo
|
||||
T3 committed, safe
|
||||
T4 committed after checkpoint, redo
|
||||
T5 running at failure, undo
|
Reference in New Issue
Block a user