From bc303c0eff774d490cecd018a1f6370317a32128 Mon Sep 17 00:00:00 2001 From: Dhaverd Date: Thu, 16 Oct 2025 11:45:04 +0800 Subject: [PATCH] Added syntax highlighting --- Git/common.md | 4 +-- Git/stash.md | 2 +- Linux/certbot_nginx.md | 4 +-- Linux/processes.md | 8 +++--- MySQL/all_foreign_keys_to_table_or_column.md | 4 +-- MySQL/identify_lock.md | 6 ++--- MySQL/users.md | 28 ++++++++++---------- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Git/common.md b/Git/common.md index 41b9bd1..3b35035 100644 --- a/Git/common.md +++ b/Git/common.md @@ -2,12 +2,12 @@ ## change remote url -``` +```bash git remote set-url origin ``` ## remove permission change from git diff -``` +```bash git config core.filemode false ``` \ No newline at end of file diff --git a/Git/stash.md b/Git/stash.md index b63d36a..fe12a32 100644 --- a/Git/stash.md +++ b/Git/stash.md @@ -2,6 +2,6 @@ ## Stashing 1 file -``` +```bash git stash push [-m ] [--] [...] ``` \ No newline at end of file diff --git a/Linux/certbot_nginx.md b/Linux/certbot_nginx.md index ee09331..ca1627d 100644 --- a/Linux/certbot_nginx.md +++ b/Linux/certbot_nginx.md @@ -2,12 +2,12 @@ ## touch nginx config -``` +```bash sudo certbot --nginx ``` ## certificate only -``` +```bash sudo certbot certonly --nginx ``` \ No newline at end of file diff --git a/Linux/processes.md b/Linux/processes.md index 25b2177..2b71651 100644 --- a/Linux/processes.md +++ b/Linux/processes.md @@ -2,26 +2,26 @@ ## Find process occupying port -``` +```bash ss -lptn 'sport = :5173' ``` ### Output example: -``` +```bash State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 511 [::1]:5173 [::]:* users:(("node",pid=29634,fd=32)) ``` ## Kill process -``` +```bash sudo kill -[signal] [PID] ``` ### Example: -``` +```bash sudo kill -9 29634 ``` diff --git a/MySQL/all_foreign_keys_to_table_or_column.md b/MySQL/all_foreign_keys_to_table_or_column.md index e8ae629..afe2d8d 100644 --- a/MySQL/all_foreign_keys_to_table_or_column.md +++ b/MySQL/all_foreign_keys_to_table_or_column.md @@ -2,7 +2,7 @@ ## By table -``` +```SQL SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM @@ -14,7 +14,7 @@ WHERE ## By table column -``` +```SQL SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM diff --git a/MySQL/identify_lock.md b/MySQL/identify_lock.md index 1b8a47d..de3c6c1 100644 --- a/MySQL/identify_lock.md +++ b/MySQL/identify_lock.md @@ -2,13 +2,13 @@ ## Method 1 -``` +```SQL SHOW open tables WHERE In_use > 0; ``` ## Method 2 -``` +```SQL SELECT OBJECT_SCHEMA, OBJECT_NAME, @@ -24,6 +24,6 @@ GROUP BY ## Process list -``` +```SQL SHOW PROCESSLIST; ``` \ No newline at end of file diff --git a/MySQL/users.md b/MySQL/users.md index a11b235..c9bec27 100644 --- a/MySQL/users.md +++ b/MySQL/users.md @@ -2,26 +2,26 @@ ## Show users with hosts -``` +```SQL SELECT User, Host FROM mysql.user; ``` ## Check user privileges -``` +```SQL SHOW GRANTS FOR 'someuser'@'somehost.somedomain'; ``` ## Create user -``` +```SQL CREATE USER 'some_user'@'somehost.somedomain' IDENTIFIED BY 'some_password'; FLUSH PRIVILEGES; ``` ## Delete user -``` +```SQL DROP USER 'some_user'@'somehost.somedomain'; FLUSH PRIVILEGES; ``` @@ -30,34 +30,34 @@ FLUSH PRIVILEGES; ### Grant all privileges -``` +```SQL GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'somehost.somedomain' WITH GRANT OPTION; FLUSH PRIVILEGES; ``` ### Grant privilege on database 'some_db' -``` +```SQL GRANT SELECT ON `some_db`.* TO 'some_user'@'somehost.somedomain'; FLUSH PRIVILEGES; ``` ### Grant privilege on table 'some_db'.'some_table' -``` +```SQL GRANT SELECT ON `some_db`.'some_table' TO 'some_user'@'somehost.somedomain'; FLUSH PRIVILEGES; ``` ### Grant privilege to select and update some columns on table 'some_db'.'some_table' -``` +```SQL GRANT SELECT (id, some_column), UPDATE (some_column) ON `some_db`.`some_table` TO 'some_user'@'somehost.somedomain'; ``` ### Grant with inheritance -``` +```SQL GRANT SELECT, INSERT, UPDATE, DELETE ON `some_db`.* TO 'some_user'@'somehost' WITH GRANT OPTION; FLUSH PRIVILEGES; ``` @@ -68,34 +68,34 @@ FLUSH PRIVILEGES; ### Revoke privilege to select from database 'somedb' -``` +```SQL REVOKE SELECT ON `somedb`.* FROM 'someuser'@'somehost'; FLUSH PRIVILEGES; ``` ### Revoke all privileges from user -``` +```SQL ALL PRIVILEGES ON *.* FROM 'someuser'@'somehost'; FLUSH PRIVILEGES; ``` ### Revoke all privileges to database 'somedb' from user -``` +```SQL ALL PRIVILEGES ON `somedb`.* FROM 'someuser'@'somehost'; FLUSH PRIVILEGES; ``` ### Revoke all privileges from user -``` +```SQL REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'someuser'@'somehost'; FLUSH PRIVILEGES; ``` ## Change password -``` +```SQL ALTER USER 'test_user'@'localhost' IDENTIFIED BY 'new_password'; ``` \ No newline at end of file