added first cheatsheets
This commit is contained in:
parent
e419487598
commit
53a924557b
44
Cheatsheets/bits&Bytes.md
Normal file
44
Cheatsheets/bits&Bytes.md
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
title: bits and Bytes
|
||||||
|
description:
|
||||||
|
published: true
|
||||||
|
date: 2023-04-28T02:38:18.678Z
|
||||||
|
tags:
|
||||||
|
editor: markdown
|
||||||
|
dateCreated: 2023-04-28T02:22:37.379Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# bits and Bytes
|
||||||
|
|
||||||
|
b = bit = Binary, 0 or 1
|
||||||
|
B = Byte = 8 Bits enough to represent 256 different characters
|
||||||
|
|
||||||
|
K = 1.000
|
||||||
|
M = 1.000.000
|
||||||
|
G = 1.000.000.000
|
||||||
|
T = 1.000.000.000.000
|
||||||
|
P = 1.000.000.000.000.000
|
||||||
|
|
||||||
|
Kb = Kilobit = 1000 b
|
||||||
|
Mb = Megabit = 1000 Kb
|
||||||
|
Gb = Gigabit = 1000 Mb
|
||||||
|
Tb = Terabit = 1000 Gb
|
||||||
|
Pb = Petabit = 1000 Tb
|
||||||
|
|
||||||
|
Kib = Kibibit = 1024 b
|
||||||
|
Mib = Mebibit = 1024 Kb
|
||||||
|
Gib = Gibibit = 1024 Mb
|
||||||
|
Tib = Tebibit = 1024 Gb
|
||||||
|
Pib = Pebibit = 1024 Tb
|
||||||
|
|
||||||
|
KB = KiloByte = 1000 B
|
||||||
|
MB = MegaByte = 1000 KB
|
||||||
|
GB = GigaByte = 1000 MB
|
||||||
|
TB = TeraByte = 1000 GB
|
||||||
|
PB = PetaByte = 1000 TB
|
||||||
|
|
||||||
|
KiB = KibiByte = 1024 B
|
||||||
|
MiB = MebiByte = 1024 KB
|
||||||
|
GiB = GibiByte = 1024 MB
|
||||||
|
TiB = TebiByte = 1024 GB
|
||||||
|
PiB = PebiByte = 1024 TB
|
66
Cheatsheets/makefile.md
Normal file
66
Cheatsheets/makefile.md
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: makefile
|
||||||
|
description:
|
||||||
|
published: true
|
||||||
|
date: 2023-04-28T02:38:18.678Z
|
||||||
|
tags:
|
||||||
|
editor: markdown
|
||||||
|
dateCreated: 2023-04-28T02:22:37.379Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# Makefile
|
||||||
|
|
||||||
|
```
|
||||||
|
VARIABLE = VALUE
|
||||||
|
|
||||||
|
RULE: Dependency $(FUNCTION)
|
||||||
|
$(FUNCTION)
|
||||||
|
Task
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
VAR = value #normale value assignment
|
||||||
|
VAR := $(VAR).o #value assignment with expansion
|
||||||
|
VAR != uname #add output of command
|
||||||
|
VAR := $(sh uname) #alternative way to add output
|
||||||
|
VAR += -Wall -Werror -Wextra #Append to value
|
||||||
|
VAR ?= $(VAR) #only sets if not defined
|
||||||
|
|
||||||
|
Text functions
|
||||||
|
$(SRC:.c=.o) #Changes all suffixes from .c to .o
|
||||||
|
|
||||||
|
Filename functions
|
||||||
|
$(addprefix obj/,$(OBJ)) #Adds a directory to the filenames
|
||||||
|
|
||||||
|
conditional functions
|
||||||
|
if
|
||||||
|
ifeq
|
||||||
|
ifdef
|
||||||
|
else
|
||||||
|
or
|
||||||
|
and
|
||||||
|
endif
|
||||||
|
foreach
|
||||||
|
|
||||||
|
value function
|
||||||
|
$(value (VAR)) #print value without expanding
|
||||||
|
|
||||||
|
shell function
|
||||||
|
$(shell COMMAND) #insert output here
|
||||||
|
|
||||||
|
control functions
|
||||||
|
$(error Something went wrong) #Makefile will stop here
|
||||||
|
$(warning This is a warning) #Display a warning
|
||||||
|
$(info This is some info) #Display some info
|
||||||
|
|
||||||
|
$@ #is the rule name
|
||||||
|
$< #is the first dependancy
|
||||||
|
$^ #are all dependancies
|
||||||
|
$? #only dependencies that have changed
|
||||||
|
$| #If anything changed, rebuild everything
|
||||||
|
% #acts as a wildcard in the rule
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all clean fclean re bonus #Doesn't create a file named after the target
|
||||||
|
```
|
27
Cheatsheets/mariadb.md
Normal file
27
Cheatsheets/mariadb.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
title: mariadb
|
||||||
|
description:
|
||||||
|
published: true
|
||||||
|
date: 2023-04-28T02:38:18.678Z
|
||||||
|
tags:
|
||||||
|
editor: markdown
|
||||||
|
dateCreated: 2023-04-28T02:22:37.379Z
|
||||||
|
---
|
||||||
|
|
||||||
|
# MariaDB
|
||||||
|
|
||||||
|
create database DATABASE;
|
||||||
|
|
||||||
|
create user USER@localhost identified by 'PASSWORD';
|
||||||
|
grant all privileges on DATABASE.* to USER@localhost;
|
||||||
|
|
||||||
|
drop user USER@localhost;
|
||||||
|
drop database DATABASE;
|
||||||
|
|
||||||
|
show databases;
|
||||||
|
use mysql; select user from user;
|
||||||
|
|
||||||
|
mariadb -u USER -p DATABASE < backup.sql
|
||||||
|
mariadb_dump -u USER -p DATABASE > backup.sql
|
||||||
|
|
||||||
|
flush privileges;
|
Loading…
x
Reference in New Issue
Block a user