├── LICENSE ├── README.md ├── databases ├── cassandra.md ├── dynamodb.md ├── elasticsearch.md ├── firebirdsql.md ├── ibmdb2.md ├── influxdb.md ├── mariadb.md ├── mongodb.md ├── mysql.md ├── neo4j.md ├── oracle.md ├── orientdb.md ├── postgres.md ├── redis.md ├── snowflake.md ├── solr.md ├── sqlite.md └── sqlserver.md ├── infrastructure ├── ansible.md ├── chef.md ├── cloud-init.md ├── cloudformation.md ├── kubernetes │ ├── alb.md │ ├── helm.md │ ├── kubectl.md │ └── kustomize.md ├── monitoring │ ├── alertmanager.md │ ├── grafana.md │ ├── loki.md │ ├── prometheus.md │ └── promtail.md ├── networking │ ├── api.md │ ├── firewall.md │ └── osi │ │ ├── application.md │ │ ├── datalink.md │ │ ├── network.md │ │ ├── osi.md │ │ ├── physical.md │ │ ├── presentation.md │ │ └── transport.md ├── puppet.md └── terraform.md ├── meta ├── defense.md ├── devops_vs_sysadmin.md ├── dry.md ├── id10t.md ├── kiss.md ├── pebcak.md ├── rtfm.md ├── rubberduckdebug.md ├── sre.md └── yagni.md ├── operating_systems ├── linux │ ├── arch.md │ ├── centos.md │ ├── debian.md │ ├── fedora.md │ ├── kali.md │ ├── opensuse.md │ ├── rhel.md │ ├── tools │ │ ├── apt.md │ │ ├── cat.md │ │ ├── df.md │ │ ├── egrep.md │ │ ├── find.md │ │ ├── git.md │ │ ├── grep.md │ │ ├── htop.md │ │ ├── iptabes.md │ │ ├── ls.md │ │ ├── nano.md │ │ ├── netstat.md │ │ ├── pacman.md │ │ ├── ps.md │ │ ├── rsync.md │ │ ├── screen.md │ │ ├── sed.md │ │ ├── ssh.md │ │ ├── systemd.md │ │ ├── tar.md │ │ ├── top.md │ │ ├── traceroute.md │ │ ├── tree.md │ │ ├── vim.md │ │ ├── which.md │ │ ├── yum.md │ │ └── zstd.md │ ├── ubuntu.md │ └── versions.md ├── macos │ ├── ventura.md │ └── versions.md └── windows │ ├── versions.md │ ├── windows_10.md │ ├── windows_11.md │ ├── windows_2000.md │ ├── windows_7.md │ ├── windows_8.md │ ├── windows_95.md │ ├── windows_98.md │ ├── windows_server.md │ ├── windows_vista.md │ └── windows_xp.md ├── programming_languages ├── awk.md ├── c.md ├── cobol.md ├── coffeescript.md ├── cpp.md ├── crystal.md ├── csharp.md ├── d.md ├── fortran.md ├── go.md ├── groovy.md ├── java.md ├── javascript.md ├── julia.md ├── kotlin.md ├── lisp.md ├── perl.md ├── php.md ├── python.md ├── r.md ├── regex.md ├── ruby.md ├── rust.md ├── scala.md ├── shell │ ├── bash.md │ └── powershell.md ├── swift.md ├── typescript.md ├── v.md ├── web_technologies │ ├── css.md │ ├── html.md │ ├── json.md │ ├── markdown.md │ ├── svg.md │ └── xml.md └── yaml.md └── security ├── security_resources.md └── tools ├── aircrack-ng.md ├── beef.md ├── burpsuite.md ├── ettercap.md ├── hashcat.md ├── hydra.md ├── johntheripper.md ├── maltego.md ├── metasploit.md ├── nikto.md ├── nmap.md ├── openssl.md ├── openvas.md ├── reaver.md ├── set.md ├── sqlmap.md ├── wireshark.md └── zap.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 lyudaio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /databases/cassandra.md: -------------------------------------------------------------------------------- 1 | # Cassandra cheatsheet for version 3.11.7 2 | 3 | Apache Cassandra is a NoSQL database management system that provides high availability and scalability for handling large amounts of structured data. It is designed to handle big data workloads across multiple nodes without a single point of failure. 4 | 5 | ## Key concepts 6 | 7 | - Cluster: A cluster is a set of nodes that work together to store and manage data. 8 | - Node: A node is a single server that runs a Cassandra instance. 9 | - Keyspace: A keyspace is a container for data in Cassandra, similar to a database in a relational database management system. 10 | - Table: A table is a collection of columns and rows that represent data in Cassandra. 11 | - Column: A column is a field in a Cassandra table. 12 | - Partition Key: The partition key determines the node that stores the data in a Cassandra table. 13 | 14 | ## Basic SELECT statement 15 | 16 | The SELECT statement is used to retrieve data from a Cassandra table. 17 | 18 | ```SQL 19 | SELECT column1, column2, ... 20 | FROM keyspace_name.table_name; 21 | ``` 22 | 23 | ## SELECT with a WHERE clause 24 | 25 | The WHERE clause is used to filter the results of a SELECT statement based on specified conditions. 26 | 27 | ```SQL 28 | SELECT column1, column2, ... 29 | FROM keyspace_name.table_name 30 | WHERE condition; 31 | ``` 32 | 33 | ## SELECT with an ORDER BY clause 34 | 35 | The ORDER BY clause is used to sort the results of a SELECT statement. 36 | 37 | ```SQL 38 | SELECT column1, column2, ... 39 | FROM keyspace_name.table_name 40 | ORDER BY column1 [ASC|DESC]; 41 | ``` 42 | 43 | ## SELECT with a GROUP BY clause 44 | 45 | The GROUP BY clause is used to group the results of a SELECT statement based on the values of one or more columns. 46 | 47 | ```SQL 48 | SELECT column1, SUM(column2), ... 49 | FROM keyspace_name.table_name 50 | GROUP BY column1; 51 | ``` 52 | 53 | ## SELECT with a JOIN clause 54 | 55 | Joining is not supported in Cassandra, instead you need to use denormalization techniques to store related data in the same table. 56 | 57 | ## Basic INSERT statement 58 | 59 | The INSERT statement is used to insert data into a Cassandra table. 60 | 61 | ```SQL 62 | INSERT INTO keyspace_name.table_name (column1, column2, ...) 63 | VALUES (value1, value2, ...); 64 | ``` 65 | 66 | ## Basic UPDATE statement 67 | 68 | The UPDATE statement is used to modify data in a Cassandra table. 69 | 70 | ```SQL 71 | UPDATE keyspace_name.table_name 72 | SET column1 = value1, column2 = value2, ... 73 | WHERE condition; 74 | ``` 75 | 76 | ## Basic DELETE statement 77 | 78 | The DELETE statement is used to delete data from a Cassandra table. 79 | 80 | ```SQL 81 | DELETE FROM keyspace_name.table_name 82 | WHERE condition; 83 | ``` 84 | 85 | ## Additional Resources 86 | 87 | - [Cassandra 3.11.7 Documentation](https://cassandra.apache.org/doc/latest/index.html) 88 | -------------------------------------------------------------------------------- /databases/dynamodb.md: -------------------------------------------------------------------------------- 1 | # DynamoDB cheatsheet for version 2022-08-06 2 | 3 | Amazon DynamoDB is a fully managed NoSQL database service provided by Amazon Web Services (AWS). It is designed to provide fast and predictable performance with seamless scalability. 4 | 5 | ## Connecting to DynamoDB 6 | 7 | To connect to DynamoDB, you will need an AWS account and access to the AWS Management Console. Once you have access, you can use the AWS CLI or the AWS SDK to interact with your DynamoDB tables. 8 | 9 | ## Creating a table 10 | 11 | A table in DynamoDB is a collection of items, where each item represents a set of attributes. The `CREATE TABLE` command is used to create a new table in DynamoDB. 12 | 13 | ```DynamoDB 14 | aws dynamodb create-table \ 15 | --table-name table_name \ 16 | --attribute-definitions AttributeName=attribute_name,AttributeType=S \ 17 | --key-schema AttributeName=attribute_name,KeyType=HASH \ 18 | --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 19 | ``` 20 | 21 | ## Adding an item 22 | 23 | An item in DynamoDB is a collection of attributes, where each attribute has a name and a value. The `PUT ITEM` command is used to add an item to a DynamoDB table. 24 | 25 | ```DynamoDB 26 | aws dynamodb put-item \ 27 | --table-name table_name \ 28 | --item '{"attribute_name": {"S": "attribute_value"}}' 29 | ``` 30 | 31 | ## Updating an item 32 | 33 | The `UPDATE ITEM` command is used to modify an existing item in a DynamoDB table. 34 | 35 | ```DynamoDB 36 | aws dynamodb update-item \ 37 | --table-name table_name \ 38 | --key '{"attribute_name": {"S": "attribute_value"}}' \ 39 | --update-expression "SET attribute_name= :val" \ 40 | --expression-attribute-values '{":val": {"S": "new_attribute_value"}}' 41 | ``` 42 | 43 | ## Deleting an item 44 | 45 | The `DELETE ITEM` command is used to remove an item from a DynamoDB table. 46 | 47 | ```DynamoDB 48 | aws dynamodb delete-item \ 49 | --table-name table_name \ 50 | --key '{"attribute_name": {"S": "attribute_value"}}' 51 | ``` 52 | 53 | ## Retrieving an item 54 | 55 | The `GET ITEM` command is used to retrieve an item from a DynamoDB table. 56 | 57 | ```DynamoDB 58 | aws dynamodb get-item \ 59 | --table-name table_name \ 60 | --key '{"attribute_name": {"S": "attribute_value"}}' 61 | ``` 62 | 63 | ## Additional Resources 64 | 65 | - [Amazon DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Welcome.html) 66 | - [AWS CLI Command Reference for Amazon DynamoDB](https://docs.aws.amazon.com/cli/latest/reference/dynamodb/) 67 | -------------------------------------------------------------------------------- /databases/elasticsearch.md: -------------------------------------------------------------------------------- 1 | # Elasticsearch cheatsheet for version 7.10 2 | 3 | Elasticsearch is a distributed, open source search and analytics engine designed for handling large amounts of data. It can be used for full-text search, structured search, analytics, and more. 4 | 5 | ## Connecting to Elasticsearch 6 | 7 | To connect to Elasticsearch, you can use the REST API, which is available over HTTP, or a variety of client libraries that are available in multiple programming languages. 8 | 9 | ## Creating an index 10 | 11 | The following API request creates an index named `people` with a single type named `person`. 12 | 13 | ```Elasticsearch 14 | PUT /people 15 | { 16 | "mappings": { 17 | "person": { 18 | "properties": { 19 | "id": { "type": "integer" }, 20 | "name": { "type": "text" }, 21 | "age": { "type": "integer" }, 22 | "email": { "type": "text" } 23 | } 24 | } 25 | } 26 | } 27 | ``` 28 | 29 | ## Inserting data 30 | 31 | The following API request inserts a new document into the `people` index with a type of `person`. 32 | 33 | ```Elasticsearch 34 | POST /people/person 35 | { 36 | "id": 1, 37 | "name": "John Doe", 38 | "age": 30, 39 | "email": "johndoe@example.com" 40 | } 41 | ``` 42 | 43 | ## Updating data 44 | 45 | The following API request updates the `age` of a person with the `id` of 1. 46 | 47 | ```Elasticsearch 48 | POST /people/person/1/_update 49 | { 50 | "doc": { "age": 31 } 51 | } 52 | ``` 53 | 54 | ## Deleting data 55 | 56 | The following API request deletes a person with the `id` of 1. 57 | 58 | ```Elasticsearch 59 | DELETE /people/person/1 60 | ``` 61 | 62 | ## Querying data 63 | 64 | The following API request retrieves all documents from the `people` index with a type of `person`. 65 | 66 | ```Elasticsearch 67 | GET /people/person/_search 68 | ``` 69 | 70 | ## Additional Resources 71 | 72 | - [Elasticsearch Documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) 73 | - [Elasticsearch API Reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) 74 | - [Elasticsearch Client Library for multiple programming languages](https://www.elastic.co/guide/en/elasticsearch/client/index.html) 75 | -------------------------------------------------------------------------------- /databases/firebirdsql.md: -------------------------------------------------------------------------------- 1 | # FirebirdSQL cheatsheet for version 4.0 2 | 3 | FirebirdSQL is a relational database management system that supports SQL and is known for its high performance and stability. It can run on multiple operating systems, including Windows, Linux, and macOS. 4 | 5 | ## Connecting to FirebirdSQL 6 | 7 | To connect to a FirebirdSQL database, you can use the `isql` command-line tool or a variety of client libraries that are available in multiple programming languages. 8 | 9 | ## Creating a table 10 | 11 | The following SQL statement creates a table named `people` with columns for `id`, `name`, `age`, and `email`. 12 | 13 | ```FirebirdSQL 14 | CREATE TABLE people ( 15 | id INTEGER NOT NULL PRIMARY KEY, 16 | name VARCHAR(100), 17 | age INTEGER, 18 | email VARCHAR(100) 19 | ); 20 | ``` 21 | 22 | ## Inserting data 23 | 24 | The following SQL statement inserts a new row into the `people` table. 25 | 26 | ```FirebirdSQL 27 | INSERT INTO people (id, name, age, email) 28 | VALUES (1, 'John Doe', 30, 'johndoe@example.com'); 29 | ``` 30 | 31 | ## Updating data 32 | 33 | The following SQL statement updates the `age` of a person with the `id` of 1. 34 | 35 | ```FirebirdSQL 36 | UPDATE people 37 | SET age = 31 38 | WHERE id = 1; 39 | ``` 40 | 41 | ## Deleting data 42 | 43 | The following SQL statement deletes a person with the `id` of 1. 44 | 45 | ```FirebirdSQL 46 | DELETE FROM people 47 | WHERE id = 1; 48 | ``` 49 | 50 | ## Querying data 51 | 52 | The following SQL statement retrieves all rows from the `people` table. 53 | 54 | ```FirebirdSQL 55 | SELECT * FROM people; 56 | ``` 57 | 58 | ## Additional Resources 59 | 60 | - [FirebirdSQL Documentation](https://firebirdsql.org/en/reference-manuals/) 61 | - [FirebirdSQL Client Library for multiple programming languages](https://firebirdsql.org/en/development-libraries/) 62 | - [FirebirdSQL User Guide](https://firebirdsql.org/en/user-guide/) 63 | -------------------------------------------------------------------------------- /databases/ibmdb2.md: -------------------------------------------------------------------------------- 1 | # IBM DB2 cheatsheet for version 11.5 2 | 3 | IBM DB2 is a relational database management system (RDBMS) developed by IBM. It is commonly used for enterprise data management and supports multiple operating systems, including Windows, Linux, and Unix. 4 | 5 | ## Connecting to the database 6 | 7 | The `db2` command-line tool is used to connect to a DB2 database. 8 | 9 | ```SQL 10 | db2 connect to database_name user username using password 11 | ``` 12 | 13 | ## Creating a table 14 | 15 | The `CREATE TABLE` statement is used to create a new table in a DB2 database. 16 | 17 | ```SQL 18 | CREATE TABLE table_name ( 19 | column1_name column1_datatype, 20 | column2_name column2_datatype, 21 | ... 22 | ); 23 | ``` 24 | 25 | ## Inserting data 26 | 27 | The `INSERT INTO` statement is used to insert data into a table. 28 | 29 | ```SQL 30 | INSERT INTO table_name (column1_name, column2_name, ...) 31 | VALUES (value1, value2, ...); 32 | ``` 33 | 34 | ## Updating data 35 | 36 | The `UPDATE` statement is used to modify data in a table. 37 | 38 | ```SQL 39 | UPDATE table_name 40 | SET column1_name = value1, 41 | column2_name = value2, 42 | ... 43 | WHERE some_column = some_value; 44 | ``` 45 | 46 | ## Deleting data 47 | 48 | The `DELETE` statement is used to remove data from a table. 49 | 50 | ```SQL 51 | DELETE FROM table_name WHERE some_column = some_value; 52 | ``` 53 | 54 | ## Querying data 55 | 56 | The `SELECT` statement is used to retrieve data from a table. 57 | 58 | ```SQL 59 | SELECT column1_name, column2_name, ... 60 | FROM table_name 61 | WHERE some_column = some_value; 62 | ``` 63 | 64 | ## Joining tables 65 | 66 | The `JOIN` clause is used to combine rows from two or more tables based on a related column between them. 67 | 68 | ```SQL 69 | SELECT column1_name, column2_name, ... 70 | FROM table1_name 71 | JOIN table2_name 72 | ON table1_name.related_column = table2_name.related_column; 73 | ``` 74 | 75 | ## Additional Resources 76 | 77 | - [IBM DB2 11.5 Documentation](https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0001975.html) 78 | -------------------------------------------------------------------------------- /databases/influxdb.md: -------------------------------------------------------------------------------- 1 | # InfluxDB 2.0.4 2 | 3 | InfluxDB is an open-source time-series database designed to handle high write and query loads. 4 | 5 | ## Basic Operations 6 | 7 | 1. Connect to the InfluxDB server: `influx` 8 | 2. Show databases: `SHOW DATABASES` 9 | 3. Create a database: `CREATE DATABASE ` 10 | 4. Use a database: `USE ` 11 | 5. Insert data: `INSERT ,= = ` 12 | 6. Query data: `SELECT FROM WHERE ` 13 | 7. Drop a database: `DROP DATABASE ` 14 | 15 | ## Additional Resources 16 | 17 | - [InfluxDB Documentation](https://v2.docs.influxdata.com/influxdb/) 18 | - [InfluxDB GitHub Repository](https://github.com/influxdata/influxdb) 19 | -------------------------------------------------------------------------------- /databases/mariadb.md: -------------------------------------------------------------------------------- 1 | # MariaDB cheatsheet for version 10.5.9 2 | 3 | MariaDB is an open-source relational database management system that is a fork of the MySQL database system. It provides a wide range of features, performance, and scalability. 4 | 5 | ## Basic SELECT statement 6 | 7 | The SELECT statement is used to retrieve data from a MariaDB database. 8 | 9 | ```SQL 10 | SELECT * FROM table_name; 11 | ``` 12 | 13 | ## SELECT with a WHERE clause 14 | 15 | The WHERE clause is used to filter the results of a SELECT statement based on specified conditions. 16 | 17 | ```SQL 18 | SELECT * FROM table_name WHERE column_name = value; 19 | ``` 20 | 21 | ## SELECT with a LIMIT clause 22 | 23 | The LIMIT clause is used to limit the number of results returned by a SELECT statement. 24 | 25 | ```SQL 26 | SELECT * FROM table_name LIMIT n; 27 | ``` 28 | 29 | ## SELECT with a SORT clause 30 | 31 | The ORDER BY clause is used to sort the results of a SELECT statement based on the values of one or more columns. 32 | 33 | ```SQL 34 | SELECT * FROM table_name ORDER BY column_name ASC/DESC; 35 | ``` 36 | 37 | ## SELECT with a JOIN clause 38 | 39 | The JOIN clause is used to combine data from multiple tables based on a related column. 40 | 41 | ```SQL 42 | SELECT * FROM table1 43 | JOIN table2 44 | ON table1.column_name = table2.column_name; 45 | ``` 46 | 47 | ## Basic INSERT statement 48 | 49 | The INSERT INTO statement is used to insert data into a MariaDB database. 50 | 51 | ```SQL 52 | INSERT INTO table_name (column1, column2, ...) 53 | VALUES (value1, value2, ...); 54 | ``` 55 | 56 | ## Basic UPDATE statement 57 | 58 | The UPDATE statement is used to modify data in a MariaDB database. 59 | 60 | ```SQL 61 | UPDATE table_name 62 | SET column_name = value 63 | WHERE column_name = value; 64 | ``` 65 | 66 | ## Basic DELETE statement 67 | 68 | The DELETE statement is used to delete data from a MariaDB database. 69 | 70 | ```SQL 71 | DELETE FROM table_name 72 | WHERE column_name = value; 73 | ``` 74 | 75 | ## Additional Resources 76 | 77 | - [MariaDB 10.5.9 Documentation](https://mariadb.com/docs/10.5/) 78 | -------------------------------------------------------------------------------- /databases/mongodb.md: -------------------------------------------------------------------------------- 1 | # MongoDB cheatsheet for version 4.4.7 2 | 3 | MongoDB is a NoSQL database management system that provides high scalability and performance for handling large amounts of unstructured or semi-structured data. 4 | 5 | ## Key concepts 6 | 7 | - Collection: A collection is a group of MongoDB documents. 8 | - Document: A document is a set of key-value pairs that represent data in MongoDB. 9 | - Key: A key is the name of a field in a MongoDB document. 10 | - Value: A value is the data stored in a field of a MongoDB document. 11 | - BSON: BSON is a binary format for representing MongoDB documents. 12 | 13 | ## Basic SELECT statement 14 | 15 | The find() method is used to retrieve data from a MongoDB collection. 16 | 17 | ```JavaScript 18 | db.collection_name.find({}); 19 | ``` 20 | 21 | ## SELECT with a WHERE clause 22 | 23 | The find() method with a filter parameter is used to filter the results of a MongoDB query based on specified conditions. 24 | 25 | ```JavaScript 26 | db.collection_name.find({ key: value }); 27 | ``` 28 | 29 | ## SELECT with a LIMIT clause 30 | 31 | The limit() method is used to limit the number of results returned by a MongoDB query. 32 | 33 | ```JavaScript 34 | db.collection_name.find({}).limit(n); 35 | ``` 36 | 37 | ## SELECT with a SORT clause 38 | 39 | The sort() method is used to sort the results of a MongoDB query based on the values of one or more fields. 40 | 41 | ```JavaScript 42 | db.collection_name.find({}).sort({ key: 1 }); 43 | ``` 44 | 45 | ## SELECT with a JOIN clause 46 | 47 | Joining is not supported in MongoDB, instead you need to use embedded documents or manual referencing to store related data in the same document. 48 | 49 | ## Basic INSERT statement 50 | 51 | The insertOne() method is used to insert a single document into a MongoDB collection. 52 | 53 | ```JavaScript 54 | db.collection_name.insertOne({ key: value, ... }); 55 | ``` 56 | 57 | ## Basic UPDATE statement 58 | 59 | The updateOne() method is used to modify a single document in a MongoDB collection. 60 | 61 | ```JavaScript 62 | db.collection_name.updateOne({ key: value }, { $set: { newKey: newValue } }); 63 | ``` 64 | 65 | ## Basic DELETE statement 66 | 67 | The deleteOne() method is used to delete a single document from a MongoDB collection. 68 | 69 | ```JavaScript 70 | db.collection_name.deleteOne({ key: value }); 71 | ``` 72 | 73 | ## Additional Resources 74 | 75 | - [MongoDB 4.4.7 Documentation](https://docs.mongodb.com/manual/release-notes/4.4/#4.4.7) 76 | -------------------------------------------------------------------------------- /databases/mysql.md: -------------------------------------------------------------------------------- 1 | # SQL cheatsheet for MySQL 8.0 2 | 3 | SQL (Structured Query Language) is a standard language used to manage relational databases and perform various operations on data stored in these databases. MySQL is an open-source relational database management system that implements the SQL language. 4 | 5 | ## Basic SELECT statement 6 | 7 | The SELECT statement is used to retrieve data from a table in a database. 8 | 9 | ```SQL 10 | SELECT column1, column2, ... 11 | FROM table_name; 12 | ``` 13 | 14 | ## SELECT with a WHERE clause 15 | 16 | The WHERE clause is used to filter the results of a SELECT statement based on certain conditions. 17 | 18 | ```SQL 19 | SELECT column1, column2, ... 20 | FROM table_name 21 | WHERE condition; 22 | ``` 23 | 24 | ## SELECT with an ORDER BY clause 25 | 26 | The ORDER BY clause is used to sort the results of a SELECT statement. 27 | 28 | ```SQL 29 | SELECT column1, column2, ... 30 | FROM table_name 31 | ORDER BY column1 [ASC|DESC]; 32 | ``` 33 | 34 | ## SELECT with a GROUP BY clause 35 | 36 | The GROUP BY clause is used to group the results of a SELECT statement based on the values of one or more columns. 37 | 38 | ```SQL 39 | SELECT column1, SUM(column2), ... 40 | FROM table_name 41 | GROUP BY column1; 42 | ``` 43 | 44 | ## SELECT with a JOIN clause 45 | 46 | The JOIN clause is used to combine rows from two or more tables based on a related column between them. 47 | 48 | ```SQL 49 | SELECT column1, column2, ... 50 | FROM table1 51 | JOIN table2 52 | ON table1.column = table2.column; 53 | ``` 54 | 55 | ## Basic INSERT statement 56 | 57 | The INSERT statement is used to insert data into a table. 58 | 59 | ```SQL 60 | INSERT INTO table_name (column1, column2, ...) 61 | VALUES (value1, value2, ...); 62 | ``` 63 | 64 | ## Basic UPDATE statement 65 | 66 | The UPDATE statement is used to modify data in a table. 67 | 68 | ```SQL 69 | UPDATE table_name 70 | SET column1 = value1, column2 = value2, ... 71 | WHERE condition; 72 | ``` 73 | 74 | ## Basic DELETE statement 75 | 76 | The DELETE statement is used to delete data from a table. 77 | 78 | ```SQL 79 | DELETE FROM table_name 80 | WHERE condition; 81 | ``` 82 | 83 | ## Additional Resources 84 | 85 | - [MySQL 8.0 Documentation](https://dev.mysql.com/doc/refman/8.0/) 86 | -------------------------------------------------------------------------------- /databases/neo4j.md: -------------------------------------------------------------------------------- 1 | # Neo4j cheatsheet for version 4.2.0 2 | 3 | Neo4j is a graph database management system that provides an ACID-compliant transactional backend for your applications. It allows you to store and retrieve data as nodes and relationships, which can be queried and analyzed to reveal patterns and insights. 4 | 5 | ## Connecting to Neo4j 6 | 7 | To connect to a Neo4j database, you can use the Neo4j Browser or the Neo4j Driver API, which is available in multiple programming languages. 8 | 9 | ## Creating a node 10 | 11 | A node in Neo4j is a unit of data that represents an entity or an object. The following Cypher query creates a node with the label `Person` and properties `name` and `age`. 12 | 13 | ```Neo4j 14 | CREATE (n:Person {name: "John Doe", age: 30}) 15 | ``` 16 | 17 | ## Creating a relationship 18 | 19 | A relationship in Neo4j connects two nodes and has a type and direction. The following Cypher query creates a relationship of type `KNOWS` between two nodes with the `Person` label. 20 | 21 | ```Neo4j 22 | MATCH (a:Person), (b:Person) 23 | WHERE a.name = "John Doe" AND b.name = "Jane Doe" 24 | CREATE (a)-[r:KNOWS]->(b) 25 | ``` 26 | 27 | ## Querying data 28 | 29 | The Cypher query language is used to retrieve data from a Neo4j database. The following query retrieves all nodes with the label `Person` and returns their `name` and `age` properties. 30 | 31 | ```Neo4j 32 | MATCH (n:Person) 33 | RETURN n.name, n.age 34 | ``` 35 | 36 | ## Updating data 37 | 38 | The following Cypher query updates the `age` property of a node with the label `Person` and the name `John Doe`. 39 | 40 | ```Neo4j 41 | MATCH (n:Person) 42 | WHERE n.name = "John Doe" 43 | SET n.age = 31 44 | ``` 45 | 46 | ## Deleting data 47 | 48 | The following Cypher query deletes a node with the label `Person` and the name `John Doe`. 49 | 50 | ```Neo4j 51 | MATCH (n:Person) 52 | WHERE n.name = "John Doe" 53 | DELETE n 54 | ``` 55 | 56 | ## Additional Resources 57 | 58 | - [Neo4j Developer Documentation](https://neo4j.com/developer/) 59 | - [Cypher Query Language Reference](https://neo4j.com/docs/cypher-refcard/current/) 60 | - [Neo4j Driver API for multiple programming languages](https://neo4j.com/developer/drivers-complex/) 61 | -------------------------------------------------------------------------------- /databases/oracle.md: -------------------------------------------------------------------------------- 1 | # Oracle Database cheatsheet for version 21c 2 | 3 | Oracle Database is a widely-used relational database management system (RDBMS) that offers a high level of reliability, security, and scalability. It provides powerful features for data warehousing, OLAP, and business intelligence, as well as web-based application development. 4 | 5 | ## Connecting to the database 6 | 7 | The `sqlplus` command-line tool is used to connect to an Oracle database. 8 | 9 | ```SQL 10 | sqlplus username/password@connection_identifier 11 | ``` 12 | 13 | ## Creating a table 14 | 15 | The `CREATE TABLE` statement is used to create a new table in an Oracle database. 16 | 17 | ```SQL 18 | CREATE TABLE table_name ( 19 | column1_name column1_datatype, 20 | column2_name column2_datatype, 21 | ... 22 | ); 23 | ``` 24 | 25 | ## Inserting data 26 | 27 | The `INSERT INTO` statement is used to insert data into a table. 28 | 29 | ```SQL 30 | INSERT INTO table_name (column1_name, column2_name, ...) 31 | VALUES (value1, value2, ...); 32 | ``` 33 | 34 | ## Updating data 35 | 36 | The `UPDATE` statement is used to modify data in a table. 37 | 38 | ```SQL 39 | UPDATE table_name 40 | SET column1_name = value1, 41 | column2_name = value2, 42 | ... 43 | WHERE some_column = some_value; 44 | ``` 45 | 46 | ## Deleting data 47 | 48 | The `DELETE` statement is used to remove data from a table. 49 | 50 | ```SQL 51 | DELETE FROM table_name WHERE some_column = some_value; 52 | ``` 53 | 54 | ## Querying data 55 | 56 | The `SELECT` statement is used to retrieve data from a table. 57 | 58 | ```SQL 59 | SELECT column1_name, column2_name, ... 60 | FROM table_name 61 | WHERE some_column = some_value; 62 | ``` 63 | 64 | ## Joining tables 65 | 66 | The `JOIN` clause is used to combine rows from two or more tables based on a related column between them. 67 | 68 | ```SQL 69 | SELECT column1_name, column2_name, ... 70 | FROM table1_name 71 | JOIN table2_name 72 | ON table1_name.related_column = table2_name.related_column; 73 | ``` 74 | 75 | ## Additional Resources 76 | 77 | - [Oracle Database 21c Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/21/index.html) 78 | -------------------------------------------------------------------------------- /databases/orientdb.md: -------------------------------------------------------------------------------- 1 | # OrientDB cheatsheet for version 4.1 2 | 3 | OrientDB is a multi-model NoSQL database management system that supports graph, document, key-value, and object models. It is known for its high performance and scalability. 4 | 5 | ## Connecting to the database 6 | 7 | The `orientdb` command-line tool is used to connect to an OrientDB database. 8 | 9 | ```SQL 10 | orientdb> CONNECT remote:host/database_name root root 11 | ``` 12 | 13 | ## Creating a class 14 | 15 | A class in OrientDB represents a collection of records (documents or vertices) and can be thought of as a table in a relational database. The `CREATE CLASS` statement is used to create a new class in an OrientDB database. 16 | 17 | ```SQL 18 | orientdb> CREATE CLASS class_name 19 | ``` 20 | 21 | ## Creating a property 22 | 23 | A property in OrientDB represents a field within a class. The `CREATE PROPERTY` statement is used to create a new property within a class. 24 | 25 | ```SQL 26 | orientdb> CREATE PROPERTY class_name.property_name data_type 27 | ``` 28 | 29 | ## Inserting data 30 | 31 | The `INSERT INTO` statement is used to insert data into a class. 32 | 33 | ```SQL 34 | orientdb> INSERT INTO class_name (property1, property2, ...) VALUES (value1, value2, ...) 35 | ``` 36 | 37 | ## Updating data 38 | 39 | The `UPDATE` statement is used to modify data within a class. 40 | 41 | ```SQL 42 | orientdb> UPDATE class_name SET property1 = value1, property2 = value2 WHERE some_property = some_value 43 | ``` 44 | 45 | ## Deleting data 46 | 47 | The `DELETE` statement is used to remove data from a class. 48 | 49 | ```SQL 50 | orientdb> DELETE FROM class_name WHERE some_property = some_value 51 | ``` 52 | 53 | ## Querying data 54 | 55 | The `SELECT` statement is used to retrieve data from a class. 56 | 57 | ```SQL 58 | orientdb> SELECT property1, property2, ... FROM class_name WHERE some_property = some_value 59 | ``` 60 | 61 | ## Traversing graph data 62 | 63 | In OrientDB, graph data is stored as vertices and edges and can be queried using the `TRAVERSE` statement. 64 | 65 | ```SQL 66 | orientdb> TRAVERSE * FROM (SELECT FROM class_name WHERE some_property = some_value) 67 | ``` 68 | 69 | ## Additional Resources 70 | 71 | - [OrientDB 4.1 Documentation](https://orientdb.com/docs/4.1.x/index.html) 72 | -------------------------------------------------------------------------------- /databases/postgres.md: -------------------------------------------------------------------------------- 1 | # SQL cheatsheet for PostgreSQL 12 2 | 3 | SQL (Structured Query Language) is the standard language used for managing relational databases and performing various operations on the data stored in these databases. PostgreSQL is an open-source relational database management system that implements the SQL language. 4 | 5 | ## Basic SELECT statement 6 | 7 | The SELECT statement is used to retrieve data from a table in a database. 8 | 9 | ```SQL 10 | SELECT column1, column2, ... 11 | FROM table_name; 12 | ``` 13 | 14 | ## SELECT with a WHERE clause 15 | 16 | The WHERE clause is used to filter the results of a SELECT statement based on specified conditions. 17 | 18 | ```SQL 19 | SELECT column1, column2, ... 20 | FROM table_name 21 | WHERE condition; 22 | ``` 23 | 24 | ## SELECT with an ORDER BY clause 25 | 26 | The ORDER BY clause is used to sort the results of a SELECT statement. 27 | 28 | ```SQL 29 | SELECT column1, column2, ... 30 | FROM table_name 31 | ORDER BY column1 [ASC|DESC]; 32 | ``` 33 | 34 | ## SELECT with a GROUP BY clause 35 | 36 | The GROUP BY clause is used to group the results of a SELECT statement based on the values of one or more columns. 37 | 38 | ```SQL 39 | SELECT column1, SUM(column2), ... 40 | FROM table_name 41 | GROUP BY column1; 42 | ``` 43 | 44 | ## SELECT with a JOIN clause 45 | 46 | The JOIN clause is used to combine rows from two or more tables based on a related column between them. 47 | 48 | ```SQL 49 | SELECT column1, column2, ... 50 | FROM table1 51 | JOIN table2 52 | ON table1.column = table2.column; 53 | ``` 54 | 55 | ## Basic INSERT statement 56 | 57 | The INSERT statement is used to insert data into a table. 58 | 59 | ```SQL 60 | INSERT INTO table_name (column1, column2, ...) 61 | VALUES (value1, value2, ...); 62 | ``` 63 | 64 | ## Basic UPDATE statement 65 | 66 | The UPDATE statement is used to modify data in a table. 67 | 68 | ```SQL 69 | UPDATE table_name 70 | SET column1 = value1, column2 = value2, ... 71 | WHERE condition; 72 | ``` 73 | 74 | ## Basic DELETE statement 75 | 76 | The DELETE statement is used to delete data from a table. 77 | 78 | ```SQL 79 | DELETE FROM table_name 80 | WHERE condition; 81 | ``` 82 | 83 | ## Additional Resources 84 | 85 | - [PostgreSQL 12 Documentation](https://www.postgresql.org/docs/12/index.html) 86 | -------------------------------------------------------------------------------- /databases/redis.md: -------------------------------------------------------------------------------- 1 | # Redis cheatsheet for version 6.0.9 2 | 3 | Redis (Remote Dictionary Server) is an in-memory data structure store that is used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geospatial indexes with radius queries. 4 | 5 | ## Basic SET and GET commands 6 | 7 | The SET command is used to set a value in Redis, while the GET command is used to retrieve a value. 8 | 9 | ```Redis 10 | SET key value 11 | GET key 12 | ``` 13 | 14 | ## Hashing values 15 | 16 | The HMSET command is used to hash multiple key-value pairs, while the HGET command is used to retrieve a value from a hash. 17 | 18 | ```Redis 19 | HMSET key field1 value1 field2 value2 ... 20 | HGET key field 21 | ``` 22 | 23 | ## Storing lists 24 | 25 | The LPUSH command is used to add elements to a list from the left, while the RPUSH command is used to add elements to a list from the right. The LRANGE command is used to retrieve a range of elements from a list. 26 | 27 | ```Redis 28 | LPUSH key value1 value2 ... 29 | RPUSH key value1 value2 ... 30 | LRANGE key start stop 31 | ``` 32 | 33 | ## Storing sets 34 | 35 | The SADD command is used to add elements to a set, while the SMEMBERS command is used to retrieve all elements in a set. 36 | 37 | ```Redis 38 | SADD key value1 value2 ... 39 | SMEMBERS key 40 | ``` 41 | 42 | ## Storing sorted sets 43 | 44 | The ZADD command is used to add elements to a sorted set, while the ZRANGE command is used to retrieve a range of elements from a sorted set based on their scores. 45 | 46 | ```Redis 47 | ZADD key score1 value1 score2 value2 ... 48 | ZRANGE key start stop [WITHSCORES] 49 | ``` 50 | 51 | ## Transactions 52 | 53 | The MULTI command is used to start a transaction, while the EXEC command is used to execute a transaction. 54 | 55 | ```Redis 56 | MULTI 57 | command1 58 | command2 59 | ... 60 | EXEC 61 | ``` 62 | 63 | ## Additional Resources 64 | 65 | - [Redis 6.0.9 Documentation](https://redis.io/documentation) 66 | -------------------------------------------------------------------------------- /databases/snowflake.md: -------------------------------------------------------------------------------- 1 | # Snowflake Database Cheatsheet (Latest LTS Version: Unknown) 2 | 3 | Snowflake is a cloud-based data warehousing platform that provides high performance, secure, and scalable data storage, querying and management capabilities. It is a fully managed service that operates on top of the Amazon Web Services (AWS) cloud infrastructure. 4 | 5 | ## Creating a Database 6 | 7 | ```sql 8 | CREATE DATABASE ; 9 | ``` 10 | 11 | ## Creating a Schema 12 | 13 | ```sql 14 | CREATE SCHEMA ; 15 | ``` 16 | 17 | ## Creating a Table 18 | 19 | ```sql 20 | CREATE TABLE ( 21 | , 22 | , 23 | ... 24 | ); 25 | ``` 26 | 27 | ## Inserting Data into a Table 28 | 29 | ```sql 30 | INSERT INTO (column_1, column_2, ...) 31 | VALUES (value_1, value_2, ...); 32 | ``` 33 | 34 | ## Selecting Data from a Table 35 | 36 | ```sql 37 | SELECT , , ... 38 | FROM ; 39 | ``` 40 | 41 | ## Updating Data in a Table 42 | 43 | ```sql 44 | UPDATE 45 | SET = , = , ... 46 | WHERE ; 47 | ``` 48 | 49 | ## Deleting Data from a Table 50 | 51 | ```sql 52 | DELETE FROM 53 | WHERE ; 54 | ``` 55 | 56 | ## Joining Tables 57 | 58 | ```sql 59 | SELECT 60 | FROM 61 | JOIN 62 | ON ; 63 | ``` 64 | 65 | ## Grouping Data 66 | 67 | ```sql 68 | SELECT , SUM() 69 | FROM 70 | GROUP BY ; 71 | ``` 72 | 73 | For more information and a comprehensive guide on Snowflake, visit the [Official Documentation](https://docs.snowflake.com/en/index.html) 74 | -------------------------------------------------------------------------------- /databases/solr.md: -------------------------------------------------------------------------------- 1 | # Solr cheatsheet for version 8.7.0 2 | 3 | Solr is an open-source, highly scalable, and powerful enterprise search platform that can be used for full-text search, hit highlighting, faceted search, and more. 4 | 5 | ## Connecting to Solr 6 | 7 | To connect to Solr, you can use the SolrJ Java client library or the Solr REST API, which is available over HTTP. 8 | 9 | ## Creating a core 10 | 11 | A core in Solr is an index and set of configuration files. To create a new core, you can use the Solr administration UI or the `bin/solr` script. 12 | 13 | ```bash 14 | ./bin/solr create -c 15 | ``` 16 | 17 | ## Indexing data 18 | 19 | Data can be indexed into Solr in several ways, including using the SolrJ client library, the Solr REST API, or the `bin/post` script. The following example uses the `bin/post` script to index a set of documents in XML format. 20 | 21 | ```bash 22 | ./bin/post -c example/exampledocs/*.xml 23 | ``` 24 | 25 | ## Querying data 26 | 27 | Data can be queried from Solr using the SolrJ client library, the Solr REST API, or the `bin/post` script. The following example uses the Solr REST API to retrieve documents matching the query `*:*`. 28 | 29 | ```bash 30 | curl "http://localhost:8983/solr//select?q=*:*" 31 | ``` 32 | 33 | ## Updating data 34 | 35 | Data can be updated in Solr using the SolrJ client library, the Solr REST API, or the `bin/post` script. The following example uses the Solr REST API to add a field to all documents in the index. 36 | 37 | ```bash 38 | curl "http://localhost:8983/solr//update?stream.body=new_value" 39 | ``` 40 | 41 | ## Deleting data 42 | 43 | Data can be deleted from Solr using the SolrJ client library, the Solr REST API, or the `bin/post` script. The following example uses the Solr REST API to delete all documents in the index. 44 | 45 | ```bash 46 | curl "http://localhost:8983/solr//update?stream.body=*:*" 47 | ``` 48 | 49 | ## Additional Resources 50 | 51 | - [Solr Documentation](https://lucene.apache.org/solr/guide/) 52 | - [SolrJ Client Library](https://lucene.apache.org/solr/guide/7_7/solrj.html) 53 | - [Solr REST API Reference](https://lucene.apache.org/solr/guide/7_7/solr-rest-api.html) 54 | -------------------------------------------------------------------------------- /databases/sqlite.md: -------------------------------------------------------------------------------- 1 | # SQL cheatsheet for SQLite 3.34.0 2 | 3 | SQL (Structured Query Language) is the standard language used for managing relational databases and performing various operations on the data stored in these databases. SQLite is a software library that provides a relational database management system. It is a self-contained, serverless, zero-configuration, transactional SQL database engine. 4 | 5 | ## Basic SELECT statement 6 | 7 | The SELECT statement is used to retrieve data from a table in a database. 8 | 9 | ```SQL 10 | SELECT column1, column2, ... 11 | FROM table_name; 12 | ``` 13 | 14 | ## SELECT with a WHERE clause 15 | 16 | The WHERE clause is used to filter the results of a SELECT statement based on specified conditions. 17 | 18 | ```SQL 19 | SELECT column1, column2, ... 20 | FROM table_name 21 | WHERE condition; 22 | ``` 23 | 24 | ## SELECT with an ORDER BY clause 25 | 26 | The ORDER BY clause is used to sort the results of a SELECT statement. 27 | 28 | ```SQL 29 | SELECT column1, column2, ... 30 | FROM table_name 31 | ORDER BY column1 [ASC|DESC]; 32 | ``` 33 | 34 | ## SELECT with a GROUP BY clause 35 | 36 | The GROUP BY clause is used to group the results of a SELECT statement based on the values of one or more columns. 37 | 38 | ```SQL 39 | SELECT column1, SUM(column2), ... 40 | FROM table_name 41 | GROUP BY column1; 42 | ``` 43 | 44 | ## SELECT with a JOIN clause 45 | 46 | The JOIN clause is used to combine rows from two or more tables based on a related column between them. 47 | 48 | ```SQL 49 | SELECT column1, column2, ... 50 | FROM table1 51 | JOIN table2 52 | ON table1.column = table2.column; 53 | ``` 54 | 55 | ## Basic INSERT statement 56 | 57 | The INSERT statement is used to insert data into a table. 58 | 59 | ```SQL 60 | INSERT INTO table_name (column1, column2, ...) 61 | VALUES (value1, value2, ...); 62 | ``` 63 | 64 | ## Basic UPDATE statement 65 | 66 | The UPDATE statement is used to modify data in a table. 67 | 68 | ```SQL 69 | UPDATE table_name 70 | SET column1 = value1, column2 = value2, ... 71 | WHERE condition; 72 | ``` 73 | 74 | ## Basic DELETE statement 75 | 76 | The DELETE statement is used to delete data from a table. 77 | 78 | ```SQL 79 | DELETE FROM table_name 80 | WHERE condition; 81 | ``` 82 | 83 | ## Additional Resources 84 | 85 | - [SQLite 3.34.0 Documentation](https://sqlite.org/docs.html) 86 | -------------------------------------------------------------------------------- /databases/sqlserver.md: -------------------------------------------------------------------------------- 1 | # SQL Server cheatsheet for version 2022 2 | 3 | SQL Server is a relational database management system (RDBMS) developed by Microsoft. It is commonly used for data warehousing, business intelligence, and web-based application development. 4 | 5 | ## Connecting to the database 6 | 7 | The `sqlcmd` command-line tool is used to connect to a SQL Server database. 8 | 9 | ```SQL 10 | sqlcmd -S server_name -U username -P password 11 | ``` 12 | 13 | ## Creating a table 14 | 15 | The `CREATE TABLE` statement is used to create a new table in a SQL Server database. 16 | 17 | ```SQL 18 | CREATE TABLE table_name ( 19 | column1_name column1_datatype, 20 | column2_name column2_datatype, 21 | ... 22 | ); 23 | ``` 24 | 25 | ## Inserting data 26 | 27 | The `INSERT INTO` statement is used to insert data into a table. 28 | 29 | ```SQL 30 | INSERT INTO table_name (column1_name, column2_name, ...) 31 | VALUES (value1, value2, ...); 32 | ``` 33 | 34 | ## Updating data 35 | 36 | The `UPDATE` statement is used to modify data in a table. 37 | 38 | ```SQL 39 | UPDATE table_name 40 | SET column1_name = value1, 41 | column2_name = value2, 42 | ... 43 | WHERE some_column = some_value; 44 | ``` 45 | 46 | ## Deleting data 47 | 48 | The `DELETE` statement is used to remove data from a table. 49 | 50 | ```SQL 51 | DELETE FROM table_name WHERE some_column = some_value; 52 | ``` 53 | 54 | ## Querying data 55 | 56 | The `SELECT` statement is used to retrieve data from a table. 57 | 58 | ```SQL 59 | SELECT column1_name, column2_name, ... 60 | FROM table_name 61 | WHERE some_column = some_value; 62 | ``` 63 | 64 | ## Joining tables 65 | 66 | The `JOIN` clause is used to combine rows from two or more tables based on a related column between them. 67 | 68 | ```SQL 69 | SELECT column1_name, column2_name, ... 70 | FROM table1_name 71 | JOIN table2_name 72 | ON table1_name.related_column = table2_name.related_column; 73 | ``` 74 | 75 | ## Additional Resources 76 | 77 | - [SQL Server 2022 Documentation](https://docs.microsoft.com/en-us/sql/sql-server/sql-server-technical-documentation?view=sql-server-ver15) 78 | -------------------------------------------------------------------------------- /infrastructure/chef.md: -------------------------------------------------------------------------------- 1 | # Chef Cheatsheet - Latest LTS 2 | 3 | ## Introduction 4 | 5 | Chef is a powerful automation platform that transforms infrastructure into code, ensuring that configurations are consistent, version-controlled, and manageable. It helps you automate everything from a single node to an entire data center with ease. 6 | 7 | ## Getting Started 8 | 9 | Before using Chef, you'll need to install Chef Workstation. To do this, simply follow the instructions on the [Official Website.](https://downloads.chef.io/chef-workstation/) 10 | 11 | ## Basic Chef Concepts 12 | 13 | - **Cookbook:** A cookbook is the fundamental unit of configuration and policy distribution. It consists of recipes, attributes, definitions, and files. 14 | - **Recipe:** A recipe is the most fundamental configuration element within a cookbook. Recipes describe how to install and configure software on a node. 15 | - **Attribute:** An attribute is a value that is associated with a node and can be used in recipes to determine the configuration. 16 | - **Node:** A node is any machine that is under management by Chef. 17 | 18 | ## Chef CLI Commands 19 | 20 | Here are some of the most common Chef CLI commands you'll use: 21 | 22 | ```Bash 23 | # Use this command to view information about your node 24 | $ chef-client -n node_name 25 | 26 | # Use this command to view information about your cookbook 27 | $ knife cookbook show cookbook_name 28 | 29 | # Use this command to upload your cookbook to the Chef server 30 | $ knife cookbook upload cookbook_name 31 | 32 | # Use this command to view information about your role 33 | $ knife role show role_name 34 | 35 | # Use this command to upload your role to the Chef server 36 | $ knife role from file role_file.rb 37 | ``` 38 | 39 | ## Writing Chef Recipes 40 | 41 | A Chef recipe is written in Ruby and follows a specific syntax. Here's an example of a basic recipe: 42 | 43 | ```Ruby 44 | # This recipe installs the Apache web server 45 | package 'httpd' do 46 | action :install 47 | end 48 | 49 | service 'httpd' do 50 | action [:enable, :start] 51 | end 52 | ``` 53 | 54 | ## Conclusion 55 | 56 | That's it! You now have the basic knowledge to start using Chef to automate your infrastructure. For more information, including a full reference of the Chef DSL, visit the [Official Documentation.](https://docs.chef.io/) 57 | -------------------------------------------------------------------------------- /infrastructure/cloud-init.md: -------------------------------------------------------------------------------- 1 | # Cloud-init Cheatsheet 2 | 3 | ## Introduction 4 | 5 | cloud-init is a popular open-source tool for handling initial server configuration. It is used by most cloud providers, including AWS, Google Cloud, and Microsoft Azure, to configure virtual machines and containers. It can perform tasks such as setting the hostname, installing packages, and writing files. 6 | 7 | ## Basic Usage 8 | 9 | Here is an example of how to use cloud-init in an AWS EC2 instance. This will install the `nginx` package and start the service. 10 | 11 | ```Bash 12 | #cloud-config 13 | 14 | package_update: true 15 | 16 | packages: 17 | - nginx 18 | 19 | runcmd: 20 | - service nginx start 21 | ``` 22 | 23 | ## Modules 24 | 25 | cloud-init supports a variety of modules to perform different tasks. Some of the most commonly used modules are: 26 | 27 | ### Package Management 28 | 29 | cloud-init supports both `apt` and `yum` package managers. 30 | 31 | ```Bash 32 | #cloud-config 33 | 34 | package_update: true 35 | 36 | packages: 37 | - nginx 38 | ``` 39 | 40 | ### File Writing 41 | 42 | You can write files to disk using the `write_files` module. 43 | 44 | ```Bash 45 | #cloud-config 46 | 47 | write_files: 48 | - path: /etc/nginx/nginx.conf 49 | content: | 50 | server { 51 | listen 80; 52 | location / { 53 | root /var/www/html; 54 | index index.html index.htm; 55 | } 56 | } 57 | ``` 58 | 59 | ### Command Execution 60 | 61 | You can run commands using the `runcmd` module. 62 | 63 | ```Bash 64 | #cloud-config 65 | 66 | runcmd: 67 | - service nginx start 68 | ``` 69 | 70 | ## Conclusion 71 | 72 | cloud-init is a powerful tool for automating initial server configuration. With its variety of modules, you can perform a wide range of tasks such as package installation, file writing, and command execution. Whether you are using a cloud provider or managing your own infrastructure, cloud-init can save you time and make your life easier. 73 | -------------------------------------------------------------------------------- /infrastructure/cloudformation.md: -------------------------------------------------------------------------------- 1 | # AWS CloudFormation Cheatsheet (Latest LTS) 2 | 3 | AWS CloudFormation is an Amazon Web Services (AWS) service that helps you model and set up your Amazon Web Services resources so you can spend less time managing those resources and more time focusing on your applications that run in AWS. 4 | 5 | ## Terminology 6 | 7 | - Stack: a collection of AWS resources created together 8 | - Template: a JSON or YAML file that describes the AWS resources and how they are connected 9 | - Resource: an AWS component that represents a single item, such as an EC2 instance or an S3 bucket 10 | - Parameter: a value that is passed into a CloudFormation template when a stack is created 11 | - Output: a value that is returned after a stack is created 12 | 13 | ## Basic Syntax 14 | 15 | Here's an example of a basic CloudFormation template in YAML format: 16 | 17 | ```yaml 18 | --- 19 | AWSTemplateFormatVersion: "2010-09-09" 20 | Resources: 21 | S3Bucket: 22 | Type: "AWS::S3::Bucket" 23 | Properties: 24 | BucketName: my-bucket-name 25 | ``` 26 | 27 | ## Resources 28 | 29 | A resource section is required in every CloudFormation template. It describes all the AWS resources that you want to create. 30 | 31 | ```yaml 32 | Resources: 33 | EC2Instance: 34 | Type: "AWS::EC2::Instance" 35 | Properties: 36 | ImageId: ami-0c55b159cbfafe1f0 37 | InstanceType: t2.micro 38 | ``` 39 | 40 | ## Parameters 41 | 42 | A parameter section is optional in a CloudFormation template, but allows you to pass values into the template when you create or update a stack. 43 | 44 | ```yaml 45 | Parameters: 46 | KeyName: 47 | Type: String 48 | InstanceType: 49 | Type: String 50 | Default: t2.micro 51 | ``` 52 | 53 | ## Outputs 54 | 55 | An output section is optional in a CloudFormation template, but can be used to display data to the user after a stack has been created. 56 | 57 | ```yaml 58 | Outputs: 59 | InstanceId: 60 | Description: The instance ID 61 | Value: !Ref EC2Instance 62 | Export: 63 | Name: InstanceId 64 | ``` 65 | 66 | ## Conclusion 67 | 68 | This is just a brief overview of the AWS CloudFormation service and its basic syntax. For more information, you can check out the [Official AWS Documentation.](https://aws.amazon.com/cloudformation/) 69 | -------------------------------------------------------------------------------- /infrastructure/kubernetes/helm.md: -------------------------------------------------------------------------------- 1 | # Helm Cheatsheet - Latest LTS 2 | 3 | Helm is a popular open-source package management tool for Kubernetes. It allows users to easily manage and deploy applications in a Kubernetes cluster. 4 | 5 | ## Installing Helm 6 | 7 | - Download the latest version of Helm from the [Official Website](https://helm.sh/docs/intro/install/) 8 | 9 | - Install Helm using the following command: 10 | 11 | ```bash 12 | curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash 13 | ``` 14 | 15 | ## Initializing Helm 16 | 17 | Initialize Helm on your local machine by running the following command: 18 | 19 | ```bash 20 | helm init 21 | ``` 22 | 23 | ## Creating a Chart 24 | 25 | Create a new directory for your chart: 26 | 27 | ```bash 28 | mkdir mychart 29 | cd mychart 30 | ``` 31 | 32 | Use the following command to create a new chart: 33 | 34 | ```bash 35 | helm create chart 36 | ``` 37 | 38 | ## Deploying a Chart 39 | 40 | Deploy a chart to your Kubernetes cluster by running the following command: 41 | 42 | ```bash 43 | helm install --name myrelease mychart 44 | ``` 45 | 46 | ## Upgrading a Chart 47 | 48 | Upgrade an existing release by running the following command: 49 | 50 | ```bash 51 | helm upgrade myrelease mychart 52 | ``` 53 | 54 | ## Deleting a Chart 55 | 56 | Delete a release by running the following command: 57 | 58 | ```bash 59 | helm delete myrelease 60 | ``` 61 | 62 | For more information on using Helm, visit the [Official Documentation](https://helm.sh/docs/) 63 | -------------------------------------------------------------------------------- /infrastructure/monitoring/alertmanager.md: -------------------------------------------------------------------------------- 1 | # AlertManager Cheatsheet (v0.22.2) 2 | 3 | AlertManager is a tool used to manage alerts sent by client applications such as Prometheus. It groups alerts, deduplicates them, and sends them to notification channels such as email, Slack, or PagerDuty. Here's a cheatsheet for using AlertManager. 4 | 5 | ## Installation 6 | 7 | AlertManager can be installed on Linux, macOS, and Windows. See the [official installation guide](https://prometheus.io/docs/alerting/latest/alertmanager/) for detailed instructions. 8 | 9 | ## Configuration 10 | 11 | AlertManager is configured using a configuration file. The default configuration file is named `alertmanager.yml`. 12 | 13 | ### Routing 14 | 15 | AlertManager defines routes to handle alerts. Routes can be based on labels and can include grouping and deduplication. 16 | 17 | Here's an example of how to route alerts based on a label: 18 | 19 | ```yaml 20 | route: 21 | group_by: ['alertname'] 22 | group_wait: 30s 23 | group_interval: 5m 24 | repeat_interval: 4h 25 | routes: 26 | - match: 27 | job: 'myjob' 28 | receiver: 'myemail' 29 | ``` 30 | 31 | ### Receivers 32 | 33 | AlertManager defines receivers to send alerts to notification channels. Receivers can be email, Slack, PagerDuty, or other custom channels. 34 | 35 | Here's an example of how to define an email receiver: 36 | 37 | ```yaml 38 | receivers: 39 | - name: 'myemail' 40 | email_configs: 41 | - to: 'me@example.com' 42 | from: 'alertmanager@example.com' 43 | smarthost: 'smtp.example.com:587' 44 | auth_username: 'me' 45 | auth_identity: 'me@example.com' 46 | auth_password: 'mypassword' 47 | ``` 48 | 49 | ### Inhibition 50 | 51 | AlertManager defines inhibition rules to suppress alerts. Inhibition rules can be based on labels and can include grouping and deduplication. 52 | 53 | Here's an example of how to define an inhibition rule: 54 | 55 | ```yaml 56 | inhibit_rules: 57 | - source_match: 58 | severity: 'critical' 59 | target_match: 60 | severity: 'warning' 61 | equal: ['alertname'] 62 | ``` 63 | 64 | ## API 65 | 66 | AlertManager provides a REST API for managing alerts. See the [official API documentation](https://prometheus.io/docs/alerting/latest/alertmanager_api/) for details. 67 | 68 | ## Links 69 | 70 | - [AlertManager Documentation](https://prometheus.io/docs/alerting/latest/alertmanager/) 71 | - [AlertManager Configuration Documentation](https://prometheus.io/docs/alerting/latest/configuration/) 72 | - [AlertManager API Documentation](https://prometheus.io/docs/alerting/latest/alertmanager_api/) 73 | - [Prometheus Documentation](https://prometheus.io/docs/introduction/overview/) 74 | -------------------------------------------------------------------------------- /infrastructure/monitoring/grafana.md: -------------------------------------------------------------------------------- 1 | # Grafana Cheatsheet 2 | 3 | Grafana is an open-source data visualization and monitoring tool. It supports a wide range of data sources, including Prometheus, Graphite, Elasticsearch, and more. This cheatsheet covers the basics of using Grafana. 4 | 5 | ## Installation 6 | 7 | Grafana can be installed on Linux, macOS, and Windows. See the [official installation guide](https://grafana.com/docs/grafana/latest/installation/) for detailed instructions. 8 | 9 | ## Configuration 10 | 11 | Grafana is configured using a configuration file. The default configuration file is named `grafana.ini`. 12 | 13 | ### Data Sources 14 | 15 | A data source is a database or API that Grafana uses to fetch data. Data sources are added in the Grafana UI. Here is an example configuration for adding a Prometheus data source: 16 | 17 | 1. In the Grafana UI, click on the "Configuration" gear icon in the sidebar, then click on "Data Sources". 18 | 2. Click on "Add data source". 19 | 3. Select "Prometheus" as the data source type. 20 | 4. Enter the URL of your Prometheus server, and click "Save & Test". 21 | 22 | ### Dashboards 23 | 24 | A dashboard is a collection of panels that display data from one or more data sources. Dashboards are created and edited in the Grafana UI. Here is an example configuration for creating a dashboard: 25 | 26 | 1. In the Grafana UI, click on the "Create" button in the sidebar, then click on "Dashboard". 27 | 2. Click on "Add panel". 28 | 3. Select a data source for the panel. 29 | 4. Choose a visualization type for the panel, such as "Graph" or "Singlestat". 30 | 5. Configure the panel by selecting metrics and setting options. 31 | 32 | ## Panels 33 | 34 | A panel is a visualization of data from a data source. Grafana supports a wide range of panel types, including graphs, tables, and gauges. 35 | 36 | ### Graphs 37 | 38 | A graph is a visualization of time-series data. Grafana supports a variety of graph types, including line graphs, bar graphs, and stacked area graphs. 39 | 40 | ### Tables 41 | 42 | A table is a visualization of tabular data. Grafana supports a variety of table types, including singlestat, table, and heatmap. 43 | 44 | ### Gauges 45 | 46 | A gauge is a visualization of a single value. Grafana supports a variety of gauge types, including gauge, bar gauge, and gauge panel. 47 | 48 | ## Alerts 49 | 50 | Grafana supports alerting based on rules defined in the configuration file. When an alert is fired, it can be sent to various notification channels, such as email or Slack. 51 | 52 | ## Resources 53 | 54 | - [Grafana Documentation](https://grafana.com/docs/) 55 | - [Grafana Panels Documentation](https://grafana.com/docs/grafana/latest/panels/) 56 | - [Grafana Data Sources Documentation](https://grafana.com/docs/grafana/latest/datasources/) 57 | -------------------------------------------------------------------------------- /infrastructure/monitoring/loki.md: -------------------------------------------------------------------------------- 1 | # Loki Cheatsheet (v2.5.0) 2 | 3 | Loki is a horizontally scalable, highly available, multi-tenant log aggregation system. It can be used as a backend for Grafana's Explore feature. Here's a cheatsheet for using Loki. 4 | 5 | ## Installation 6 | 7 | Loki can be installed on Linux, macOS, and Windows. See the [official installation guide](https://grafana.com/docs/loki/latest/installation/) for detailed instructions. 8 | 9 | ## Configuration 10 | 11 | Loki is configured using a configuration file. The default configuration file is named `loki-local-config.yaml`. 12 | 13 | ### Log Labels 14 | 15 | Loki uses log labels to extract and index key-value pairs from logs. Log labels can be added to logs in various ways, including using a logging library that supports log labels or by adding them directly to log lines. 16 | 17 | Here's an example of how to add a log label to a log line using Java: 18 | 19 | ```java 20 | import org.slf4j.Logger; 21 | import org.slf4j.LoggerFactory; 22 | import org.slf4j.MDC; 23 | 24 | public class MyLogger { 25 | private static final Logger logger = LoggerFactory.getLogger(MyLogger.class); 26 | 27 | public void logMessage(String message, String key, String value) { 28 | MDC.put(key, value); 29 | logger.info(message); 30 | MDC.remove(key); 31 | } 32 | } 33 | ``` 34 | 35 | ### Queries 36 | 37 | Loki supports queries using the LogQL query language. Here are some examples of LogQL queries: 38 | 39 | - To get all logs for a specific label value: 40 | 41 | ```bash 42 | {label_name="label_value"} 43 | ``` 44 | 45 | - To filter logs by a regular expression: 46 | 47 | ```bash 48 | {label_name=~"regular_expression"} 49 | ``` 50 | 51 | - To aggregate logs by a label: 52 | 53 | ```bash 54 | sum by (label_name) ({label_name="label_value"} |= "metric_name") 55 | ``` 56 | 57 | - To group logs by a label and show the top 10 values: 58 | 59 | ```bash 60 | topk(10, {label_name}) 61 | ``` 62 | 63 | ### API 64 | 65 | Loki provides a REST API for querying logs and managing the system. See the [official API documentation](https://grafana.com/docs/loki/latest/api/) for details. 66 | 67 | ## Resources 68 | 69 | - [Loki Documentation](https://grafana.com/docs/loki/) 70 | - [LogQL Query Language](https://grafana.com/docs/loki/latest/logql/) 71 | - [Loki API Documentation](https://grafana.com/docs/loki/latest/api/) 72 | -------------------------------------------------------------------------------- /infrastructure/networking/api.md: -------------------------------------------------------------------------------- 1 | # API Cheatsheet 2 | 3 | An API (Application Programming Interface) is a set of protocols, routines, and tools for building software applications. It provides a way for different applications to communicate with each other and exchange data. This cheatsheet provides an overview of APIs, including their functions, common types, and best practices. 4 | 5 | ## Functions of APIs 6 | 7 | - Expose functionality of an application or service to other applications or services 8 | - Enable data exchange between different applications or services 9 | - Improve interoperability between different applications or services 10 | - Enable third-party developers to integrate with an existing application or service 11 | - Allow for rapid development of new applications or services using pre-built functionality 12 | 13 | ## Common Types of APIs 14 | 15 | - REST (Representational State Transfer): A web-based architectural style for building APIs, often used with HTTP protocols 16 | - SOAP (Simple Object Access Protocol): A protocol for exchanging structured information in the implementation of web services in computer networks 17 | - GraphQL: A query language for APIs that enables a more efficient, powerful and flexible approach to data querying and retrieval 18 | 19 | ## Best Practices for API Design and Development 20 | 21 | - Design APIs with a clear and consistent structure that is easy to use and understand 22 | - Use standard HTTP status codes to provide meaningful responses to API requests 23 | - Implement authentication and access control mechanisms to protect API resources from unauthorized access 24 | - Use pagination and filtering to optimize API performance and manage large data sets 25 | - Document the API clearly, including input and output parameters, expected responses, and error messages 26 | 27 | ## Tools and Resources for API Development and Testing 28 | 29 | - Swagger: A tool for designing and documenting REST APIs 30 | - Postman: A platform for designing, testing, and documenting APIs 31 | - CURL: A command-line tool for testing APIs 32 | - OpenAPI: A standard for describing APIs using JSON or YAML 33 | - Apigee: A platform for developing, managing, and testing APIs 34 | 35 | ## Additional Information 36 | 37 | - The use of APIs is becoming increasingly common in software development, with many popular applications and services providing APIs for third-party developers to use 38 | - APIs can be used to integrate applications across different platforms, enabling cross-platform functionality and data exchange 39 | - For more information on APIs and API development, consult the official documentation for the relevant programming language or development platform. 40 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/application.md: -------------------------------------------------------------------------------- 1 | # Application Layer Cheatsheet 2 | 3 | The Application Layer is the seventh and topmost layer of the OSI model, and is responsible for providing services directly to the user or application. It interacts with software applications and provides access to network resources for those applications. This cheatsheet provides an overview of the Application Layer, including its functions, common protocols, and troubleshooting tips. 4 | 5 | ## Functions of the Application Layer 6 | 7 | - Provides a user interface to the network 8 | - Enables user authentication and access control 9 | - Provides application services, such as file transfer, email, and remote login 10 | - Manages the data exchange between applications 11 | - Provides application-specific functionality, such as browser rendering, online search, and social networking 12 | 13 | ## Common Application Layer Protocols 14 | 15 | - HTTP: A protocol for web browsing and transferring hypertext documents 16 | - SMTP: A protocol for sending email messages 17 | - FTP: A protocol for transferring files between computers 18 | - SSH: A protocol for secure remote login and file transfer 19 | - Telnet: A protocol for remote login to a computer 20 | 21 | ## Troubleshooting the Application Layer 22 | 23 | - Verify that the user has the correct login credentials and permissions to access the desired resources 24 | - Check the application configuration settings to ensure they are correct and compatible with the network environment 25 | - Check the availability of the network resources and that they are properly configured 26 | - Use network monitoring tools to detect and resolve any issues that may affect the network performance 27 | - Ensure that all relevant software is up-to-date, including the application itself, the operating system, and any network services 28 | 29 | ## Additional Information 30 | 31 | - The Application Layer is closely related to the Presentation Layer and the Session Layer, which provide services related to data formatting and session management, respectively 32 | - The protocols used at the Application Layer are typically dependent on the requirements of the application and the nature of the data being transmitted 33 | - For more information on the Application Layer and its protocols, consult the official documentation for the relevant protocol standards bodies, such as the IETF or IEEE 34 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/network.md: -------------------------------------------------------------------------------- 1 | # Network Layer Cheatsheet 2 | 3 | The Network Layer is the third layer in the OSI model and is responsible for providing logical addressing and routing services. It is responsible for the transmission of data from the source to the destination by choosing the best path through the network. This cheatsheet provides an overview of the Network Layer, including its functions, common protocols, and troubleshooting tips. 4 | 5 | ## Functions of the Network Layer 6 | 7 | - Provides logical addressing and routing services 8 | - Transmits data between nodes on different networks 9 | - Chooses the best path through the network based on network conditions and congestion 10 | - Provides congestion control mechanisms to prevent network overload 11 | - Implements internetworking, allowing networks to be connected to one another 12 | 13 | ## Common Network Layer Protocols 14 | 15 | - Internet Protocol (IP): A protocol that is used to route data across the Internet 16 | - Internet Control Message Protocol (ICMP): A protocol that is used to report errors and other control information between network devices 17 | - Address Resolution Protocol (ARP): A protocol that is used to map an IP address to a physical address (MAC address) 18 | 19 | ## Troubleshooting the Network Layer 20 | 21 | - Check the network topology to ensure that the network is properly configured 22 | - Use traceroute or ping to verify that the network is properly configured and that packets are being transmitted between devices 23 | - Check the network settings, such as the IP address and subnet mask, to ensure that they are configured correctly 24 | - Use a protocol analyzer to identify issues with the network layer, such as routing errors, congestion, or misconfigured devices 25 | - Check for environmental factors that could affect the network layer, such as temperature, humidity, and electromagnetic interference 26 | 27 | ## Additional Information 28 | 29 | - The Network Layer is closely related to the Data Link layer, which provides reliable data transfer over a physical medium, and the Transport layer, which provides end-to-end error detection and correction and reliability 30 | - The Network Layer is typically implemented in software, using specialized software routines that are designed to provide logical addressing and routing services 31 | - For more information on the Network Layer and its protocols, consult the official documentation for the relevant protocol standards bodies, such as the IETF or IEEE 32 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/osi.md: -------------------------------------------------------------------------------- 1 | # OSI Model Cheatsheet 2 | 3 | ## OSI Model 4 | 5 | The OSI model is a conceptual framework that standardizes the communication functions of a telecommunication or computing system, enabling different systems to communicate with each other. It has seven layers, each providing specific services that contribute to the overall communication process. The seven layers, from top to bottom, are as follows: 6 | 7 | ## 7. Application Layer 8 | 9 | - Provides network services to end-user applications 10 | - Examples: HTTP, FTP, SMTP, DNS 11 | - Protocols: Telnet, FTP, HTTP, SMTP, POP3, IMAP4, SNMP, DNS 12 | 13 | ## 6. Presentation Layer 14 | 15 | - Converts data between the application and network formats 16 | - Examples: Encryption, compression, ASCII, EBCDIC 17 | - Protocols: SSL, TLS 18 | 19 | ## 5. Session Layer 20 | 21 | - Provides session management functions 22 | - Examples: Connection management, authentication, authorization 23 | - Protocols: NetBIOS, SSH 24 | 25 | ## 4. Transport Layer 26 | 27 | - Provides end-to-end transport services, such as reliable data transfer and flow control 28 | - Examples: TCP, UDP 29 | - Protocols: TCP, UDP 30 | 31 | ## 3. Network Layer 32 | 33 | - Provides logical addressing and routing services 34 | - Examples: IP, ICMP 35 | - Protocols: IP, ICMP, ARP 36 | 37 | ## 2. Data Link Layer 38 | 39 | - Provides reliable data transfer between network entities 40 | - Examples: Ethernet, Wi-Fi, ATM 41 | - Protocols: Ethernet, Wi-Fi, Frame Relay, HDLC 42 | 43 | ## 1. Physical Layer 44 | 45 | - Defines the physical characteristics of the communication medium 46 | - Examples: Cables, connectors, electrical currents 47 | - Protocols: RS-232, V.35 48 | 49 | Each layer depends on the layer below it to provide services and uses the layer above it to provide services. 50 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/physical.md: -------------------------------------------------------------------------------- 1 | # Physical Layer Cheatsheet 2 | 3 | ## Physical Layer 4 | 5 | The Physical layer is the first layer in the OSI model and is responsible for defining the physical characteristics of the communication medium, such as the voltage levels, data rates, and transmission distances. It is also responsible for transmitting raw bits over the physical medium. This cheatsheet provides an overview of the Physical layer, including its functions, common protocols, and troubleshooting tips. 6 | 7 | ## Functions of the Physical Layer 8 | 9 | - Defines the physical characteristics of the communication medium, such as the cables, connectors, and electrical currents used to transmit data 10 | - Transmits raw bits over the physical medium, without regard to the meaning or content of the data 11 | - Provides synchronization between the transmitter and receiver, ensuring that the data is transmitted at the correct speed and timing 12 | 13 | ## Common Physical Layer Protocols 14 | 15 | - RS-232: A serial communication standard commonly used to connect computers and peripherals 16 | - V.35: A high-speed serial communication standard commonly used in WAN environments 17 | - Ethernet: A wired networking standard commonly used in LAN environments 18 | - Wi-Fi: A wireless networking standard commonly used in LAN environments 19 | 20 | ## Troubleshooting the Physical Layer 21 | 22 | - Check the physical connection between devices to ensure that the cable is properly connected and the connector is not damaged 23 | - Check the physical characteristics of the communication medium to ensure that the correct type of cable is being used and that it is not damaged or degraded 24 | - Use a cable tester to check for continuity and other physical layer issues 25 | - Use a protocol analyzer to identify issues with the physical layer, such as signal loss or interference 26 | - Check the power supply to ensure that the device is receiving the correct voltage and that there are no power fluctuations or outages 27 | - Check for environmental factors that could affect the physical layer, such as temperature, humidity, and electromagnetic interference 28 | 29 | ## Other Information 30 | 31 | - The Physical layer is typically implemented in hardware, using specialized circuits and chips that are designed to transmit and receive raw bits 32 | - The Physical layer is closely related to the Data Link layer, which provides error detection and correction mechanisms to ensure the accuracy of the data being transmitted 33 | - The Physical layer is also related to the Network layer, which provides logical addressing and routing services to enable communication between devices on different networks 34 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/presentation.md: -------------------------------------------------------------------------------- 1 | # Presentation Layer Cheatsheet 2 | 3 | The Presentation Layer is the sixth layer in the OSI model and is responsible for ensuring that data is properly formatted and presented for application processing. It is responsible for data compression, encryption, and decryption, as well as character encoding and decoding. This cheatsheet provides an overview of the Presentation Layer, including its functions, common protocols, and troubleshooting tips. 4 | 5 | ## Functions of the Presentation Layer 6 | 7 | - Formats and presents data for application processing 8 | - Provides data compression to reduce the size of transmitted data 9 | - Provides data encryption and decryption for secure transmission of data 10 | - Handles character encoding and decoding, converting between different character sets 11 | - Translates data between different data formats, such as binary, ASCII, and EBCDIC 12 | 13 | ## Common Presentation Layer Protocols 14 | 15 | - JPEG: A protocol for compressing image data 16 | - MPEG: A protocol for compressing audio and video data 17 | - SSL/TLS: Protocols for encrypting and decrypting data transmitted over the network 18 | - ASCII: A character encoding scheme for representing text data 19 | - Unicode: A character encoding scheme for representing text data in multiple languages 20 | 21 | ## Troubleshooting the Presentation Layer 22 | 23 | - Check the application settings to ensure that they are configured correctly, including any character encoding and compression settings 24 | - Use a protocol analyzer to identify issues with the Presentation Layer, such as data corruption or failure to decrypt encrypted data 25 | - Check for issues with firewalls or other security measures that may be blocking the use of encryption or compression 26 | - Test the data format with a different protocol or application to determine if the issue is specific to the current protocol or application 27 | 28 | ## Additional Information 29 | 30 | - The Presentation Layer is closely related to the Application Layer, which provides services directly to the user or application, and the Session Layer, which manages the communication sessions between applications 31 | - The protocols used at the Presentation Layer are typically dependent on the requirements of the application and the nature of the data being transmitted 32 | - For more information on the Presentation Layer and its protocols, consult the official documentation for the relevant protocol standards bodies, such as the IETF or IEEE 33 | -------------------------------------------------------------------------------- /infrastructure/networking/osi/transport.md: -------------------------------------------------------------------------------- 1 | # Transport Layer Cheatsheet 2 | 3 | The Transport Layer is the fourth layer in the OSI model and is responsible for providing end-to-end communication between applications running on different hosts. It is responsible for ensuring reliable data transfer and congestion control. This cheatsheet provides an overview of the Transport Layer, including its functions, common protocols, and troubleshooting tips. 4 | 5 | ## Functions of the Transport Layer 6 | 7 | - Provides end-to-end communication between applications running on different hosts 8 | - Ensures reliable data transfer, with mechanisms for error detection and correction 9 | - Implements flow control, preventing the sender from overwhelming the receiver 10 | - Implements congestion control, preventing network overload by limiting the rate of data transfer 11 | - Provides multiplexing and demultiplexing of data, allowing multiple applications to share a single network connection 12 | 13 | ## Common Transport Layer Protocols 14 | 15 | - Transmission Control Protocol (TCP): A reliable, connection-oriented protocol that provides error detection and correction, flow control, congestion control, and multiplexing 16 | - User Datagram Protocol (UDP): A connectionless, unreliable protocol that provides minimal error detection and correction, no flow control, and no congestion control 17 | 18 | ## Troubleshooting the Transport Layer 19 | 20 | - Check the network settings to ensure that they are configured correctly, including port numbers and IP addresses 21 | - Use a protocol analyzer to identify issues with the Transport Layer, such as connection failures, dropped packets, or retransmissions 22 | - Check the application settings to ensure that they are configured correctly, including the protocol used and any security settings 23 | - Test the network connection with a different protocol to determine if the issue is specific to TCP or UDP 24 | - Check for issues with firewalls or other security measures that may be blocking the connection 25 | 26 | ## Additional Information 27 | 28 | - The Transport Layer is closely related to the Network Layer, which provides logical addressing and routing services, and the Session Layer, which provides end-to-end communication between applications 29 | - TCP is the most commonly used Transport Layer protocol for reliable data transfer, while UDP is typically used for applications that require low latency, such as real-time video and audio streaming 30 | - For more information on the Transport Layer and its protocols, consult the official documentation for the relevant protocol standards bodies, such as the IETF or IEEE 31 | -------------------------------------------------------------------------------- /infrastructure/terraform.md: -------------------------------------------------------------------------------- 1 | # Terraform Cheatsheet (Latest LTS: 0.18.3) 2 | 3 | ## Introduction 4 | 5 | Terraform is an open-source infrastructure as code software tool created by HashiCorp. It allows users to define and provision infrastructure components, such as virtual machines, DNS entries, and databases, using a high-level configuration language. Terraform uses a state file to track and manage changes to infrastructure components over time. 6 | 7 | ### Installation 8 | 9 | To install Terraform, download the appropriate package for your operating system from the [Terraform website](https://www.terraform.io/downloads.html). 10 | 11 | ### Basic Syntax 12 | 13 | - Variables are declared using the "variable" keyword followed by the name and data type (string, number, boolean, etc.) 14 | - Providers are defined using the "provider" keyword followed by the provider name and the appropriate configuration block 15 | - Resources are defined using the "resource" keyword followed by the resource type, name, and configuration block 16 | - Data sources are defined using the "data" keyword followed by the data source type and name 17 | - Output values are declared using the "output" keyword followed by a name and an expression to be evaluated 18 | 19 | ```hcl 20 | # Example Terraform code 21 | variable "example_variable" { 22 | type = string 23 | } 24 | 25 | provider "aws" { 26 | region = "us-west-2" 27 | } 28 | 29 | resource "aws_instance" "example" { 30 | ami = "ami-0c55b159cbfafe1f0" 31 | instance_type = "t2.micro" 32 | } 33 | 34 | data "aws_ami" "example" { 35 | most_recent = true 36 | 37 | filter { 38 | name = "name" 39 | values = ["amzn-ami-hvm-*-x86_64-gp2"] 40 | } 41 | } 42 | 43 | output "example_output" { 44 | value = "${aws_instance.example.id}" 45 | } 46 | ``` 47 | 48 | ### Common Commands 49 | 50 | - `terraform init` - initializes a Terraform configuration and downloads any required providers 51 | - `terraform plan` - generates an execution plan for the Terraform configuration 52 | - `terraform apply` - applies changes to infrastructure components defined in the Terraform configuration 53 | - `terraform show` - displays the state file for a Terraform configuration 54 | - `terraform destroy` - destroys all infrastructure components defined in a Terraform configuration 55 | 56 | ### Conclusion 57 | 58 | Terraform is a powerful tool for automating the deployment and management of infrastructure components. The Terraform syntax is relatively straightforward, and the tool integrates well with a variety of providers and data sources. By using Terraform, infrastructure can be versioned and managed in a consistent, reproducible way. 59 | -------------------------------------------------------------------------------- /meta/dry.md: -------------------------------------------------------------------------------- 1 | # DRY (Don't Repeat Yourself) Principle 2 | 3 | DRY is a principle in software development that emphasizes the importance of avoiding code duplication by abstracting common functionality into reusable modules. 4 | 5 | ## Benefits of DRY 6 | 7 | - Improved maintainability: code that's not duplicated in multiple places is easier to modify and maintain, reducing the likelihood of introducing errors. 8 | - Increased productivity: reusing code can help developers build new features more quickly by avoiding unnecessary repetition. 9 | - Better code organization: breaking code into reusable modules can help developers keep their codebase more organized and understandable. 10 | 11 | ## Techniques for achieving DRY 12 | 13 | - Functions: using functions to encapsulate commonly used code. 14 | - Libraries: reusing code from pre-built libraries or frameworks. 15 | - Inheritance: using inheritance to avoid repeating code in subclasses. 16 | - Templates: using templates to generate code from a single source. 17 | 18 | ## When to use DRY 19 | 20 | The DRY principle should be used when you notice duplication in your code. By identifying patterns and similarities in your codebase, you can create reusable components that make your code easier to read, maintain, and test. However, it's important to balance DRY with other principles like simplicity and readability. 21 | 22 | ## When not to use DRY 23 | 24 | Not all code duplication is bad. Sometimes, it may be simpler and more readable to write a small piece of code in-line rather than creating a separate reusable module. Additionally, over-engineering code to be DRY can lead to increased complexity and may be unnecessary for smaller projects. 25 | 26 | ## Additional Information 27 | 28 | To learn more about the DRY principle, check out the following resources: 29 | 30 | - The SOLID design principles: [Link](https://en.wikipedia.org/wiki/SOLID) 31 | - The DRY Wikipedia page: [Link](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) 32 | -------------------------------------------------------------------------------- /meta/id10t.md: -------------------------------------------------------------------------------- 1 | # ID10T Error Cheatsheet 2 | 3 | The term "ID10T error" is often used in the technology industry to refer to user errors that could have been avoided with a little more attention to detail. Here are some common examples of "ID10T errors": 4 | 5 | - Entering incorrect information (e.g. mistyping a password) 6 | - Ignoring error messages or warning prompts 7 | - Failing to follow instructions or guidelines 8 | - Misplacing or losing important files or documents 9 | - Inadvertently clicking on spam or malware links 10 | - Failing to keep software and hardware up-to-date 11 | - Using outdated or unsupported software or hardware 12 | - Failing to properly shut down or restart a device 13 | - Misusing or mishandling technology 14 | 15 | While it can be frustrating to encounter these errors, it's important to remember that everyone makes mistakes, and most issues can be resolved with a little troubleshooting or guidance. If you're experiencing an issue, try taking a step back and double-checking your actions to see if there's something you missed. And if you're a technical support professional, remember to treat users with kindness and respect, even if their mistake seems obvious. 16 | -------------------------------------------------------------------------------- /meta/kiss.md: -------------------------------------------------------------------------------- 1 | # KISS (Keep It Simple, Stupid) Principle 2 | 3 | The KISS principle is a design principle in software development that emphasizes the importance of simplicity in software design. It stands for "Keep It Simple, Stupid." 4 | 5 | ## Benefits of KISS 6 | 7 | - Improved maintainability: simple code is easier to understand, test, and maintain. 8 | - Reduced complexity: simpler code is less prone to bugs and easier to troubleshoot. 9 | - Increased productivity: simpler code is easier to write and requires less time and effort to modify. 10 | 11 | ## Techniques for achieving KISS 12 | 13 | - Writing clean, concise code that is easy to read and understand. 14 | - Breaking down complex problems into smaller, more manageable components. 15 | - Avoiding unnecessary complexity, such as overly complicated algorithms or data structures. 16 | - Striving for simplicity in design and user interface. 17 | 18 | ## When to use KISS 19 | 20 | The KISS principle should be used whenever possible in software development. By simplifying your code and design, you can improve its overall quality, making it easier to maintain, troubleshoot, and modify. 21 | 22 | ## When not to use KISS 23 | 24 | There may be situations where it is necessary to sacrifice simplicity for functionality. For example, when working on complex scientific or financial models, the code may need to be more complex in order to handle all the necessary calculations. 25 | 26 | ## Additional Information 27 | 28 | To learn more about the KISS principle, check out the following resources: 29 | 30 | - The KISS principle Wikipedia page: [Link](https://en.wikipedia.org/wiki/KISS_principle) 31 | -------------------------------------------------------------------------------- /meta/pebcak.md: -------------------------------------------------------------------------------- 1 | # PEBKAC Cheatsheet 2 | 3 | PEBKAC is a common acronym used in the software development industry to describe a user error that is unrelated to the software or tool being used. It stands for "Problem Exists Between Keyboard And Chair." This cheatsheet provides an overview of PEBKAC, including when to use it and tips for troubleshooting user errors. 4 | 5 | ## When to Use PEBKAC 6 | 7 | - When a user reports an issue that cannot be replicated or is unrelated to the software or tool being used 8 | - When a user has difficulty performing a task that is unrelated to the software or tool being used 9 | - When a user error is causing issues with a system or network 10 | 11 | ## Tips for Troubleshooting User Errors 12 | 13 | - Verify that the user is following correct procedures and workflows 14 | - Check for basic user errors, such as misspellings or incorrect input 15 | - Ensure that the user has the necessary permissions and access to perform the task 16 | - Verify that the user is using the correct software version or tool 17 | - Provide clear and concise instructions for the user to follow 18 | 19 | ## Best Practices for User Training 20 | 21 | - Provide comprehensive training for new users, including basic system and software usage 22 | - Use clear and concise language that is easy to understand 23 | - Provide examples and sample workflows to illustrate usage 24 | - Use onboarding checklists and tasks to ensure that users are familiar with basic system and software usage 25 | - Provide ongoing training and support for users to improve their skills and knowledge 26 | 27 | ## Additional Information 28 | 29 | - PEBKAC errors are a common issue in the software development industry, and can cause significant delays and issues with system and software usage 30 | - Effective user training and documentation can help reduce the incidence of PEBKAC errors 31 | - Always verify user errors and troubleshoot effectively to avoid unnecessary downtime and delays 32 | - For more information on troubleshooting user errors, consult the official documentation for the software or tool you are using. 33 | -------------------------------------------------------------------------------- /meta/rtfm.md: -------------------------------------------------------------------------------- 1 | # RTFM Cheatsheet 2 | 3 | RTFM is a common acronym in the software development industry that stands for "Read the fucking Manual." It is often used to encourage others to consult documentation or other resources to find answers to their questions before seeking help from others. This cheatsheet provides an overview of RTFM, including when to use it and tips for effective documentation usage. 4 | 5 | ## When to Use RTFM 6 | 7 | - When you have a question or problem that can be solved by consulting documentation or other resources 8 | - When you want to understand the usage of a software library or tool 9 | - When you want to learn more about a programming language or framework 10 | - When you want to troubleshoot an error or issue with your code 11 | 12 | ## Tips for Effective Documentation Usage 13 | 14 | - Start with the official documentation for the software or tool you are using 15 | - Look for tutorials, sample code, and other resources to help you get started 16 | - Use search engines to find answers to specific questions or issues 17 | - Join online communities and forums related to the software or tool you are using to ask questions and get help 18 | - Take notes and bookmark helpful resources for future reference 19 | 20 | ## Best Practices for Documentation 21 | 22 | - Keep documentation up-to-date with the latest software version and features 23 | - Use clear and concise language that is easy to understand 24 | - Organize documentation in a logical and intuitive manner 25 | - Include examples and sample code to illustrate usage 26 | - Include troubleshooting tips and known issues to help users avoid common pitfalls 27 | 28 | ## Tools and Resources for Documentation 29 | 30 | - Readthedocs: A popular documentation hosting platform for open source projects 31 | - Swagger: A tool for generating API documentation 32 | - Javadoc: A tool for generating documentation for Java code 33 | - Sphinx: A tool for generating documentation for Python projects 34 | - Gitbook: A platform for creating and hosting documentation for software projects 35 | 36 | ## Additional Information 37 | 38 | - Effective documentation usage is an important skill for software developers and engineers 39 | - Always consult documentation and other resources before seeking help from others 40 | - Documentation is a critical component of open source software development, as it enables community contribution and collaboration 41 | - For more information on documentation best practices and tools, consult the official documentation for the software or tool you are using. 42 | -------------------------------------------------------------------------------- /meta/rubberduckdebug.md: -------------------------------------------------------------------------------- 1 | # Rubber Duck Debugging Cheatsheet 2 | 3 | Rubber Duck Debugging is a technique used in software development to help programmers solve complex problems by explaining their code to a rubber duck or other inanimate object. This cheatsheet provides an overview of Rubber Duck Debugging, including when to use it and tips for effective implementation. 4 | 5 | ## When to Use Rubber Duck Debugging 6 | 7 | - When you encounter a complex problem that you cannot solve on your own 8 | - When you need to better understand the logic or flow of your code 9 | - When you want to verify that your code is correct and error-free 10 | - When you want to improve your communication and problem-solving skills 11 | 12 | ## Tips for Effective Rubber Duck Debugging 13 | 14 | - Choose an object that you can use as a "rubber duck," such as a stuffed animal or a figurine 15 | - Explain your code to the rubber duck in a clear and concise manner 16 | - Break down your code into small, manageable chunks to make it easier to explain 17 | - Use descriptive language and diagrams to illustrate your explanations 18 | - Use the rubber duck to ask questions and challenge your assumptions 19 | - Use the process as an opportunity to improve your problem-solving and communication skills 20 | 21 | ## Best Practices for Debugging 22 | 23 | - Take breaks when you get stuck to clear your mind and approach the problem with fresh eyes 24 | - Use multiple sources, such as official documentation and online resources, to research the problem and potential solutions 25 | - Use debugging tools, such as breakpoints and log statements, to identify the source of the problem 26 | - Test your code thoroughly to ensure that the problem has been resolved 27 | - Document your findings and solutions to help prevent similar issues from arising in the future 28 | 29 | ## Additional Information 30 | 31 | - Rubber Duck Debugging is a widely used technique in the software development industry 32 | - It can be used by individuals or in a group setting to facilitate problem-solving and communication 33 | - The process of explaining your code to a rubber duck can help identify logic errors and improve understanding of the code 34 | - For more information on Rubber Duck Debugging, consult the official documentation or online resources. 35 | -------------------------------------------------------------------------------- /meta/yagni.md: -------------------------------------------------------------------------------- 1 | # YAGNI (You Aren't Gonna Need It) Cheatsheet 2 | 3 | YAGNI is a programming principle that encourages developers to avoid adding unnecessary features or functionality to their code. This can help to reduce complexity, improve maintainability, and save time and resources. Here are some key things to keep in mind when applying the YAGNI principle: 4 | 5 | ## When to apply YAGNI 6 | 7 | - **When adding new features:** Before adding a new feature, ask yourself whether it's really necessary. Will it provide value to users? Will it make the codebase more complex or harder to maintain? If the answer is no, don't add it. 8 | 9 | - **When refactoring code:** When refactoring existing code, it can be tempting to add new functionality or improve performance. However, it's important to consider whether these changes are really necessary. If they don't solve a problem or provide value to users, they may not be worth the effort. 10 | 11 | - **When writing tests:** When writing tests, it's important to focus on testing the behavior of the system, rather than specific implementation details. Avoid writing tests for features that aren't yet implemented or may not be necessary. 12 | 13 | ## How to apply YAGNI 14 | 15 | - **Start small:** Begin with the smallest possible solution to a problem, and only add complexity when it's absolutely necessary. 16 | 17 | - **Refactor often:** Regularly review your codebase and look for opportunities to simplify or remove unnecessary code. 18 | 19 | - **Get feedback:** Solicit feedback from users and stakeholders to determine which features are truly valuable, and which can be discarded. 20 | 21 | ## When not to apply YAGNI 22 | 23 | - **For critical functionality:** If a feature is essential to the core functionality of your application, it may be necessary to include it even if it adds complexity. 24 | 25 | - **For performance optimization:** If performance is a critical requirement, it may be necessary to include optimizations even if they add complexity. 26 | 27 | - **For future-proofing:** If a feature is likely to be needed in the future, it may be worth including it even if it's not strictly necessary at the moment. 28 | 29 | -------------------------------------------------------------------------------- /operating_systems/linux/arch.md: -------------------------------------------------------------------------------- 1 | # Arch Linux System Administration Cheatsheet (Latest LTS: 2023) 2 | 3 | ## General System Information 4 | 5 | - Display system information: `cat /etc/os-release` or `cat /lib/os-release` 6 | - Display kernel information: `uname -a` 7 | - Display hostname: `hostname` 8 | - Display system uptime: `uptime` 9 | 10 | ## User Management 11 | 12 | - Add user: `sudo useradd -m [username]` 13 | - Delete user: `sudo userdel [username]` 14 | - Add user to group: `sudo gpasswd -a [username] [groupname]` 15 | - Remove user from group: `sudo gpasswd -d [username] [groupname]` 16 | 17 | ## File System Management 18 | 19 | - Display disk usage: `df -h` 20 | - Create directory: `mkdir [directory name]` 21 | - Change file/directory permissions: `chmod [options] [file/directory name]` 22 | - Change file/directory ownership: `chown [options] [file/directory name]` 23 | 24 | ## Package Management 25 | 26 | - Update package information: `sudo pacman -Sy` 27 | - Upgrade packages: `sudo pacman -Su` 28 | - Install package: `sudo pacman -S [package name]` 29 | - Remove package: `sudo pacman -R [package name]` 30 | - Search for package: `sudo pacman -Ss [package name]` 31 | 32 | ## Network Configuration 33 | 34 | - Display IP address: `ip addr show` 35 | - Display routing information: `ip route` 36 | - Display network interfaces: `ip link show` 37 | - Edit network interfaces: `sudo nano /etc/systemd/network/[interface].network` 38 | 39 | ## Services 40 | 41 | - List all services: `sudo systemctl list-units --type=service` 42 | - Start service: `sudo systemctl start [service name]` 43 | - Stop service: `sudo systemctl stop [service name]` 44 | - Restart service: `sudo systemctl restart [service name]` 45 | - Enable service: `sudo systemctl enable [service name]` 46 | - Disable service: `sudo systemctl disable [service name]` 47 | 48 | ## Process Management 49 | 50 | - Display running processes: `ps aux` 51 | - Kill process: `kill [process ID]` 52 | - Kill process by name: `pkill [process name]` 53 | 54 | ## Conclusion 55 | 56 | This cheatsheet provides a quick reference to some common Arch Linux administration tasks. However, this is by no means a comprehensive guide, and for more information and advanced topics, it's recommended to consult the official [Arch Linux Documentation.](https://wiki.archlinux.org/) 57 | -------------------------------------------------------------------------------- /operating_systems/linux/centos.md: -------------------------------------------------------------------------------- 1 | # CentOS System Administration Cheatsheet 2 | 3 | ## General System Information 4 | 5 | - Display system information: `cat /etc/centos-release` 6 | - Display kernel information: `uname -a` 7 | - Display hostname: `hostname` 8 | - Display system uptime: `uptime` 9 | 10 | ## User Management 11 | 12 | - Add user: `sudo useradd [username]` 13 | - Delete user: `sudo userdel [username]` 14 | - Add user to group: `sudo usermod -a -G [groupname] [username]` 15 | - Delete user from group: `sudo gpasswd -d [username] [groupname]` 16 | 17 | ## File System Management 18 | 19 | - Display disk usage: `df -h` 20 | - Create directory: `mkdir [directory name]` 21 | - Change file permissions: `chmod [options] [file/directory name]` 22 | - Change file ownership: `chown [options] [file/directory name]` 23 | 24 | ## Package Management 25 | 26 | - Update package information: `sudo yum update` 27 | - Upgrade packages: `sudo yum upgrade` 28 | - Install package: `sudo yum install [package name]` 29 | - Remove package: `sudo yum remove [package name]` 30 | - Search for package: `sudo yum search [package name]` 31 | 32 | ## Network Configuration 33 | 34 | - Display IP address: `ip addr show` 35 | - Display routing information: `ip route` 36 | - Display network interfaces: `ifconfig` 37 | - Edit network interfaces: `sudo nano /etc/sysconfig/network-scripts/ifcfg-[interface]` 38 | 39 | ## Services 40 | 41 | - List all services: `sudo systemctl list-units --type=service` 42 | - Start service: `sudo systemctl start [service name]` 43 | - Stop service: `sudo systemctl stop [service name]` 44 | - Restart service: `sudo systemctl restart [service name]` 45 | 46 | ## Process Management 47 | 48 | - Display running processes: `ps aux` 49 | - Kill process: `kill [process ID]` 50 | - Kill process by name: `killall [process name]` 51 | -------------------------------------------------------------------------------- /operating_systems/linux/debian.md: -------------------------------------------------------------------------------- 1 | # Debian Cheatsheet 2 | 3 | ## Basic Terminal Commands 4 | 5 | - ls: List the contents of the current directory 6 | - cd [directory]: Change the current working directory to [directory] 7 | - pwd: Print the current working directory 8 | - cat [file]: Display the contents of [file] 9 | - cp [source] [destination]: Copy [source] to [destination] 10 | - mv [source] [destination]: Move [source] to [destination] 11 | - rm [file]: Remove [file] 12 | - rmdir [directory]: Remove [directory] 13 | - touch [file]: Create a new empty file [file] 14 | - echo [text]: Display [text] on the terminal 15 | 16 | ## Package Management 17 | 18 | - apt update: Update the package list 19 | - apt upgrade: Upgrade installed packages to their latest versions 20 | - apt install [package]: Install [package] 21 | - apt remove [package]: Remove [package] 22 | - apt search [keyword]: Search for packages containing [keyword] 23 | 24 | ## Networking 25 | 26 | - ifconfig: Display information about network interfaces 27 | - ping [host]: Test the connectivity to [host] 28 | - traceroute [host]: Trace the route to [host] 29 | - nmap [host/network]: Scan [host/network] for open ports and services 30 | 31 | ## Services Management 32 | 33 | - service [service_name] start: Start the [service_name] service 34 | - service [service_name] stop: Stop the [service_name] service 35 | - service [service_name] restart: Restart the [service_name] service 36 | - service [service_name] status: Check the status of the [service_name] service 37 | 38 | ## File Permissions 39 | 40 | - chmod [permissions] [file]: Change the permissions of [file] to [permissions] 41 | - chown [user] [file]: Change the owner of [file] to [user] 42 | - chgrp [group] [file]: Change the group of [file] to [group] 43 | 44 | ## Users and Groups 45 | 46 | - adduser [user]: Add a new user [user] 47 | - addgroup [group]: Add a new group [group] 48 | - usermod -a -G [group] [user]: Add [user] to [group] 49 | - passwd [user]: Change the password of [user] 50 | 51 | ## Process Management 52 | 53 | - ps: Display information about running processes 54 | - top: Display a dynamic real-time view of the system processes 55 | - kill [pid]: Send a signal to terminate the process with the PID [pid] 56 | - killall [process]: Send a signal to terminate all processes with the name [process] 57 | -------------------------------------------------------------------------------- /operating_systems/linux/fedora.md: -------------------------------------------------------------------------------- 1 | # Fedora Cheatsheet 2 | 3 | ## Basic Terminal Commands 4 | 5 | - ls: List the contents of the current directory 6 | - cd [directory]: Change the current working directory to [directory] 7 | - pwd: Print the current working directory 8 | - cat [file]: Display the contents of [file] 9 | - cp [source] [destination]: Copy [source] to [destination] 10 | - mv [source] [destination]: Move [source] to [destination] 11 | - rm [file]: Remove [file] 12 | - rmdir [directory]: Remove [directory] 13 | - touch [file]: Create a new empty file [file] 14 | - echo [text]: Display [text] on the terminal 15 | 16 | ## Package Management 17 | 18 | - dnf update: Update the package list 19 | - dnf upgrade: Upgrade installed packages to their latest versions 20 | - dnf install [package]: Install [package] 21 | - dnf remove [package]: Remove [package] 22 | - dnf search [keyword]: Search for packages containing [keyword] 23 | 24 | ## Networking 25 | 26 | - ifconfig: Display information about network interfaces 27 | - ping [host]: Test the connectivity to [host] 28 | - traceroute [host]: Trace the route to [host] 29 | - nmap [host/network]: Scan [host/network] for open ports and services 30 | 31 | ## Services Management 32 | 33 | - systemctl start [service_name]: Start the [service_name] service 34 | - systemctl stop [service_name]: Stop the [service_name] service 35 | - systemctl restart [service_name]: Restart the [service_name] service 36 | - systemctl status [service_name]: Check the status of the [service_name] service 37 | 38 | ## File Permissions 39 | 40 | - chmod [permissions] [file]: Change the permissions of [file] to [permissions] 41 | - chown [user] [file]: Change the owner of [file] to [user] 42 | - chgrp [group] [file]: Change the group of [file] to [group] 43 | 44 | ## Users and Groups 45 | 46 | - useradd [user]: Add a new user [user] 47 | - groupadd [group]: Add a new group [group] 48 | - usermod -a -G [group] [user]: Add [user] to [group] 49 | - passwd [user]: Change the password of [user] 50 | 51 | ## Process Management 52 | 53 | - ps: Display information about running processes 54 | - top: Display a dynamic real-time view of the system processes 55 | - kill [pid]: Send a signal to terminate the process with the PID [pid] 56 | - killall [process]: Send a signal to terminate all processes with the name [process] 57 | -------------------------------------------------------------------------------- /operating_systems/linux/kali.md: -------------------------------------------------------------------------------- 1 | # Kali Linux Cheatsheet 2 | 3 | ## Basic Terminal Commands 4 | 5 | - ls: List the contents of the current directory 6 | - cd [directory]: Change the current working directory to [directory] 7 | - pwd: Print the current working directory 8 | - cat [file]: Display the contents of [file] 9 | - cp [source] [destination]: Copy [source] to [destination] 10 | - mv [source] [destination]: Move [source] to [destination] 11 | - rm [file]: Remove [file] 12 | - rmdir [directory]: Remove [directory] 13 | - touch [file]: Create a new empty file [file] 14 | - echo [text]: Display [text] on the terminal 15 | 16 | ## Package Management 17 | 18 | - apt update: Update the package list 19 | - apt upgrade: Upgrade installed packages to their latest versions 20 | - apt install [package]: Install [package] 21 | - apt remove [package]: Remove [package] 22 | - apt search [keyword]: Search for packages containing [keyword] 23 | 24 | ## Networking 25 | 26 | - ifconfig: Display information about network interfaces 27 | - ping [host]: Test the connectivity to [host] 28 | - traceroute [host]: Trace the route to [host] 29 | - nmap [host/network]: Scan [host/network] for open ports and services 30 | 31 | ## Wireless Networking 32 | 33 | - airmon-ng: Start the wireless network interface in monitor mode 34 | - airodump-ng [interface]: Capture wireless network traffic on [interface] 35 | - aireplay-ng [options] [interface]: Inject wireless network traffic on [interface] 36 | 37 | ## Information Gathering 38 | 39 | - whois [domain]: Look up information about [domain] 40 | - nslookup [domain]: Resolve [domain] to an IP address 41 | - dig [domain]: Look up DNS information for [domain] 42 | - nbtscan [network]: Scan [network] for NetBIOS information 43 | 44 | ## Web Application Testing 45 | 46 | - sqlmap: Automated SQL injection tool 47 | - burp suite: Integrated platform for web application security testing 48 | - w3af: Web Application Attack and Audit Framework 49 | 50 | ## Metasploit Framework 51 | 52 | - msfconsole: Start the Metasploit Framework console 53 | - use [module]: Load the specified Metasploit module 54 | - show options: Display available options for the current module 55 | - exploit: Launch the attack specified by the current module 56 | - back: Go back to the previous context in the Metasploit console 57 | -------------------------------------------------------------------------------- /operating_systems/linux/opensuse.md: -------------------------------------------------------------------------------- 1 | # OpenSUSE Cheatsheet 2 | 3 | ## Basic Terminal Commands 4 | 5 | - ls: List the contents of the current directory 6 | - cd [directory]: Change the current working directory to [directory] 7 | - pwd: Print the current working directory 8 | - cat [file]: Display the contents of [file] 9 | - cp [source] [destination]: Copy [source] to [destination] 10 | - mv [source] [destination]: Move [source] to [destination] 11 | - rm [file]: Remove [file] 12 | - rmdir [directory]: Remove [directory] 13 | - touch [file]: Create a new empty file [file] 14 | - echo [text]: Display [text] on the terminal 15 | 16 | ## Package Management 17 | 18 | - zypper update: Update the package list 19 | - zypper upgrade: Upgrade installed packages to their latest versions 20 | - zypper install [package]: Install [package] 21 | - zypper remove [package]: Remove [package] 22 | - zypper search [keyword]: Search for packages containing [keyword] 23 | 24 | ## Networking 25 | 26 | - ifconfig: Display information about network interfaces 27 | - ping [host]: Test the connectivity to [host] 28 | - traceroute [host]: Trace the route to [host] 29 | - nmap [host/network]: Scan [host/network] for open ports and services 30 | 31 | ## Services Management 32 | 33 | - systemctl start [service_name]: Start the [service_name] service 34 | - systemctl stop [service_name]: Stop the [service_name] service 35 | - systemctl restart [service_name]: Restart the [service_name] service 36 | - systemctl status [service_name]: Check the status of the [service_name] service 37 | 38 | ## File Permissions 39 | 40 | - chmod [permissions] [file]: Change the permissions of [file] to [permissions] 41 | - chown [user] [file]: Change the owner of [file] to [user] 42 | - chgrp [group] [file]: Change the group of [file] to [group] 43 | 44 | ## Users and Groups 45 | 46 | - useradd [user]: Add a new user [user] 47 | - groupadd [group]: Add a new group [group] 48 | - usermod -a -G [group] [user]: Add [user] to [group] 49 | - passwd [user]: Change the password of [user] 50 | 51 | ## Process Management 52 | 53 | - ps: Display information about running processes 54 | - top: Display a dynamic real-time view of the system processes 55 | - kill [pid]: Send a signal to terminate the process with the PID [pid] 56 | - killall [process]: Send a signal to terminate all processes with the name [process] 57 | -------------------------------------------------------------------------------- /operating_systems/linux/rhel.md: -------------------------------------------------------------------------------- 1 | # RHEL System Administration Cheatsheet 2 | 3 | ## General System Information 4 | 5 | - Display system information: `cat /etc/redhat-release` 6 | - Display kernel information: `uname -a` 7 | - Display hostname: `hostname` 8 | - Display system uptime: `uptime` 9 | 10 | ## User Management 11 | 12 | - Add user: `sudo useradd [username]` 13 | - Delete user: `sudo userdel [username]` 14 | - Add user to group: `sudo usermod -a -G [groupname] [username]` 15 | - Delete user from group: `sudo gpasswd -d [username] [groupname]` 16 | 17 | ## File System Management 18 | 19 | - Display disk usage: `df -h` 20 | - Create directory: `mkdir [directory name]` 21 | - Change file permissions: `chmod [options] [file/directory name]` 22 | - Change file ownership: `chown [options] [file/directory name]` 23 | 24 | ## Package Management 25 | 26 | - Update package information: `sudo yum update` 27 | - Upgrade packages: `sudo yum upgrade` 28 | - Install package: `sudo yum install [package name]` 29 | - Remove package: `sudo yum remove [package name]` 30 | - Search for package: `sudo yum search [package name]` 31 | 32 | ## Network Configuration 33 | 34 | - Display IP address: `ip addr show` 35 | - Display routing information: `ip route` 36 | - Display network interfaces: `ifconfig` 37 | - Edit network interfaces: `sudo nano /etc/sysconfig/network-scripts/ifcfg-[interface]` 38 | 39 | ## Services 40 | 41 | - List all services: `sudo systemctl list-units --type=service` 42 | - Start service: `sudo systemctl start [service name]` 43 | - Stop service: `sudo systemctl stop [service name]` 44 | - Restart service: `sudo systemctl restart [service name]` 45 | 46 | ## Process Management 47 | 48 | - Display running processes: `ps aux` 49 | - Kill process: `kill [process ID]` 50 | - Kill process by name: `killall [process name]` 51 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/cat.md: -------------------------------------------------------------------------------- 1 | # Linux Cat Command Cheatsheet 2 | 3 | ## Description 4 | 5 | The `cat` command is a Unix utility used for concatenating and displaying files on the terminal. 6 | 7 | ## Syntax 8 | 9 | `cat [OPTION]... [FILE]...` 10 | 11 | ## Options 12 | 13 | - `-b`: Number non-blank output lines. 14 | - `-e`: Display end-of-line characters as `$`. 15 | - `-n`: Number all output lines. 16 | - `-s`: Squeeze multiple blank lines into one. 17 | - `-T`: Display tab characters as `^I`. 18 | - `-u`: Disable output buffering. 19 | - `-v`: Display non-printable characters as `^` notation. 20 | 21 | ## Examples 22 | 23 | - Display contents of a file: 24 | `cat filename` 25 | 26 | - Display contents of multiple files: 27 | `cat file1 file2 file3` 28 | 29 | - Display contents of all files in a directory: 30 | `cat *` 31 | 32 | - Create a new file and enter text: 33 | `cat > filename` 34 | 35 | - Append text to an existing file: 36 | `cat >> filename` 37 | 38 | ## Additional Resources 39 | 40 | - Official documentation: 41 | - Linux man page: 42 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/df.md: -------------------------------------------------------------------------------- 1 | # df - Display the Amount of Disk Space Used and Available 2 | 3 | ## Introduction 4 | 5 | `df` is a Unix command that shows the amount of disk space used and available on a Linux file system. The `df` command is used to check the disk space available on the file system that a file resides on. 6 | 7 | ## Syntax 8 | 9 | ```bash 10 | df [OPTION]... [FILE]... 11 | ``` 12 | 13 | ## Options 14 | 15 | - `-a, --all`: include pseudo, duplicate, inaccessible file systems 16 | - `-B, --block-size=SIZE`: use SIZE-byte blocks 17 | - `-h, --human-readable`: print sizes in human readable format (e.g., 1K 234M 2G) 18 | - `-H, --si`: equivalent to `--block-size=1000` 19 | - `-i, --inodes`: list inode information instead of block usage 20 | - `-k, --kilobytes`: default, use 1024-byte blocks 21 | - `-l, --local`: limit listing to local file systems 22 | - `-t, --type=TYPE`: limit listing to file systems of type TYPE 23 | - `-T, --print-type`: print file system type 24 | - `-x, --exclude-type=TYPE`: limit listing to file systems not of type TYPE 25 | 26 | ## Examples 27 | 28 | To display the disk space usage of all mounted file systems: 29 | 30 | ```bash 31 | df -h 32 | ``` 33 | 34 | To display disk space usage of a specific file system: 35 | 36 | ```bash 37 | df -h /dev/sda1 38 | ``` 39 | 40 | To display disk space usage in kilobytes: 41 | 42 | ```bash 43 | df -k 44 | ``` 45 | 46 | To display disk space usage of all file systems excluding NFS: 47 | 48 | ```bash 49 | df -x nfs 50 | ``` 51 | 52 | ## Conclusion 53 | 54 | In conclusion, the `df` command is a useful tool for checking disk space usage in Linux. It provides information on the amount of disk space used and available on a file system, and also provides options for displaying disk space usage in different formats, such as human-readable format or kilobytes. By using the `df` command regularly, you can monitor disk space usage and ensure that you have enough disk space for your needs. END_OF_MESSAGE 55 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/find.md: -------------------------------------------------------------------------------- 1 | # Find Command Cheatsheet 2 | 3 | ## Description 4 | 5 | `find` is a powerful command-line tool for searching files and directories in Linux. It can search for files based on various criteria such as name, size, time modified, and ownership. 6 | 7 | ## Syntax 8 | 9 | ```bash 10 | find [path...] [expression] 11 | ``` 12 | 13 | - `path`: The directory or directories to search in. If no path is specified, the search is performed in the current directory and its subdirectories. 14 | - `expression`: The search criteria or actions to perform. 15 | 16 | ## Examples 17 | 18 | ### Search by Name 19 | 20 | Search for a file or directory with exact name: 21 | 22 | ```bash 23 | find /path/to/dir -name "file.txt" 24 | ``` 25 | 26 | Search for files or directories with names that match a pattern: 27 | 28 | ```bash 29 | find /path/to/dir -name "*.txt" 30 | ``` 31 | 32 | ### Search by Type 33 | 34 | Search for files of a specific type: 35 | 36 | ```bash 37 | find /path/to/dir -type f 38 | ``` 39 | 40 | Search for directories: 41 | 42 | ```bash 43 | find /path/to/dir -type d 44 | ``` 45 | 46 | ### Search by Size 47 | 48 | Search for files larger than a certain size (in kilobytes): 49 | 50 | ```bash 51 | find /path/to/dir -type f -size +100k 52 | ``` 53 | 54 | Search for files smaller than a certain size (in kilobytes): 55 | 56 | ```bash 57 | find /path/to/dir -type f -size -100k 58 | ``` 59 | 60 | ### Search by Time 61 | 62 | Search for files modified within the last n days: 63 | 64 | ```bash 65 | find /path/to/dir -type f -mtime -n 66 | ``` 67 | 68 | Search for files modified exactly n days ago: 69 | 70 | ```bash 71 | find /path/to/dir -type f -mtime n 72 | ``` 73 | 74 | ### Search by Ownership 75 | 76 | Search for files owned by a specific user: 77 | 78 | ```bash 79 | find /path/to/dir -type f -user username 80 | ``` 81 | 82 | Search for files owned by a specific group: 83 | 84 | ```bash 85 | find /path/to/dir -type f -group groupname 86 | ``` 87 | 88 | ### Execute Actions 89 | 90 | Execute a command on each file found: 91 | 92 | ```bash 93 | find /path/to/dir -type f -exec command {} \; 94 | ``` 95 | 96 | Print the path of each file found: 97 | 98 | ```bash 99 | find /path/to/dir -type f -print 100 | ``` 101 | 102 | ## Additional Resources 103 | 104 | - [Official `find` documentation](https://www.gnu.org/software/findutils/manual/html_mono/find.html) 105 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/git.md: -------------------------------------------------------------------------------- 1 | # Git 2.30.0 2 | 3 | Git is a distributed version control system that helps you manage your code and track changes. 4 | 5 | ## Basic Commands 6 | 7 | 1. `git clone `: Clone a remote repository to your local machine. 8 | 2. `git status`: Check the status of your repository. 9 | 3. `git add `: Add a file to the staging area. 10 | 4. `git commit -m ""`: Commit changes with a message describing the change. 11 | 5. `git push`: Push your changes to the remote repository. 12 | 6. `git pull`: Pull the latest changes from the remote repository. 13 | 14 | ## Useful Links 15 | 16 | - [Pro Git Book](https://git-scm.com/book/en/v2) 17 | - [Git Documentation](https://git-scm.com/docs) 18 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/htop.md: -------------------------------------------------------------------------------- 1 | # htop 2 | 3 | htop is an interactive process viewer for Unix systems that provides a quick and easy way to monitor system resources in real-time. It is a powerful and feature-rich alternative to the traditional `top` command and is widely used by DevOps, Site Reliability Engineers, and System Administrators to manage system resources. 4 | 5 | ## Basic Usage 6 | 7 | 1. Start htop by opening a terminal window and typing the following command: 8 | 9 | ```bash 10 | htop 11 | ``` 12 | 13 | 2. Use the arrow keys to navigate through the list of processes. 14 | 15 | 3. Use the `F1` key to display a list of available commands. 16 | 17 | 4. Use the `F2` key to customize the display settings for htop. 18 | 19 | 5. Use the `F3` key to search for a specific process. 20 | 21 | 6. Use the `F4` key to filter processes by their attributes. 22 | 23 | 7. Use the `F5` key to sort processes by various attributes such as CPU usage, memory usage, etc. 24 | 25 | 8. Use the `F6` key to select a different process grouping. 26 | 27 | 9. Use the `F9` key to send a signal to a selected process. 28 | 29 | 10. Use the `F10` key to quit htop. 30 | 31 | ## Further Resources 32 | 33 | htop provides a wealth of features and options that can help you better manage your system resources. To learn more about htop and its usage, refer to the following resources: 34 | 35 | - [htop Documentation](https://hisham.hm/htop/): The official documentation for htop, which includes detailed information on how to use the command and its options. 36 | - [Using htop to Monitor System Processes on Linux](https://www.linode.com/docs/guides/using-htop-to-monitor-system-processes-on-linux/): A comprehensive guide that covers the basics of htop and its advanced features. 37 | - [htop GitHub Repository](https://github.com/hishamhm/htop): The official GitHub repository for htop, which contains the latest version of the command and its source code. 38 | 39 | Remember, htop is a powerful tool that can be used to monitor and manage system resources. Always use htop responsibly and ensure that you have obtained proper authorization before using it in your work or projects. 40 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/ls.md: -------------------------------------------------------------------------------- 1 | # ls Command Cheatsheet 2 | 3 | ls is a command in Unix-like operating systems that is used to list the contents of a directory. 4 | 5 | ## Basic Usage 6 | 7 | The basic usage of the `ls` command is as follows: 8 | 9 | ```sh 10 | ls [options] [file or directory] 11 | ``` 12 | 13 | - `[options]`: Options to modify the behavior of the `ls` command. 14 | - `[file or directory]`: The file or directory to list the contents of. If not specified, it defaults to the current working directory. 15 | 16 | ## Common Options 17 | 18 | Here are some of the most commonly used options for the `ls` command: 19 | 20 | - `-a`: Show hidden files and directories. 21 | - `-l`: Show the contents in a long format, including permissions, ownership, size, and timestamps. 22 | - `-h`: Show file sizes in human-readable format (e.g., 1K, 234M, 2G). 23 | - `-t`: Sort the contents by modification time (most recently modified first). 24 | - `-r`: Reverse the order of the sort. 25 | - `-R`: Recursively list the contents of directories. 26 | 27 | ## Examples 28 | 29 | Here are some examples of the `ls` command in action: 30 | 31 | - `ls`: List the contents of the current working directory. 32 | 33 | - `ls -l`: List the contents of the current working directory in long format. 34 | 35 | - `ls -a`: List the contents of the current working directory, including hidden files and directories. 36 | 37 | - `ls -lh`: List the contents of the current working directory in long format and show file sizes in human-readable format. 38 | 39 | - `ls -lt`: List the contents of the current working directory, sorted by modification time (most recently modified first). 40 | 41 | - `ls -ltr`: List the contents of the current working directory, sorted by modification time in reverse order (most recently modified last). 42 | 43 | - `ls -R`: Recursively list the contents of the current working directory and all its subdirectories. 44 | 45 | ## Conclusion 46 | 47 | This cheatsheet has covered the basic usage and common options for the `ls` command. By combining these options, you can easily modify the behavior of the `ls` command to suit your needs. For more information on the `ls` command, consult the manual page by running `man ls` in your terminal. 48 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/nano.md: -------------------------------------------------------------------------------- 1 | # Nano Editor Cheatsheet 2 | 3 | This cheatsheet covers the basic commands and shortcuts for the Nano text editor in Linux. Nano is a simple and user-friendly text editor that is widely used on Linux systems. 4 | 5 | ## Opening and Closing Files 6 | 7 | | Command | Description | 8 | | ----------------- | -------------------------------------------------------------- | 9 | | nano filename.txt | Open the specified file in Nano. | 10 | | Ctrl + X | Exit Nano. If changes have been made, prompt to save the file. | 11 | | N | Answer "no" to the prompt to save changes and exit Nano. | 12 | | Y | Answer "yes" to the prompt to save changes and exit Nano. | 13 | 14 | ## Navigation and Editing 15 | 16 | | Command | Description | 17 | | ---------------- | ------------------------------------------------------------- | 18 | | Arrow keys | Move the cursor in the specified direction. | 19 | | Ctrl + A | Move the cursor to the beginning of the current line. | 20 | | Ctrl + E | Move the cursor to the end of the current line. | 21 | | Ctrl + Y | Scroll up one page. | 22 | | Ctrl + V | Scroll down one page. | 23 | | Ctrl + K | Cut the current line. | 24 | | Ctrl + U | Uncut (paste) the most recently cut text. | 25 | | Ctrl + \_ | Undo the last action. | 26 | | Ctrl + Shift + 6 | Mark a block of text. Press again to select the entire block. | 27 | | Alt + 6 | Copy a marked block of text. | 28 | | Ctrl + G | Display help screen with available commands. | 29 | 30 | ## Search and Replace 31 | 32 | | Command | Description | 33 | | ---------------- | ------------------------------------------------------------- | 34 | | Ctrl + W | Search for text in the file. | 35 | | Ctrl + \ | Replace text in the file. | 36 | | Ctrl + Shift + 7 | Find the next occurrence of the previously searched for text. | 37 | | Ctrl + Shift + 8 | Replace the previously found text. | 38 | 39 | ## Additional Resources 40 | 41 | For more information about using Nano, consult the official Nano documentation: 42 | 43 | - [GNU Nano Official Documentation](https://www.nano-editor.org/dist/latest/nano.html) 44 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/pacman.md: -------------------------------------------------------------------------------- 1 | # Pacman Package Manager Cheatsheet 2 | 3 | Pacman is the package manager for Arch Linux and its derivatives. It is a powerful and easy-to-use tool for installing, upgrading, and managing packages on your system. 4 | 5 | ## Basic Commands 6 | 7 | | Command | Description | 8 | | ------------------------- | -------------------------------------------- | 9 | | `pacman -S package_name` | Install a package | 10 | | `pacman -Syu` | Synchronize and upgrade all packages | 11 | | `pacman -Ss search_term` | Search for a package | 12 | | `pacman -R package_name` | Remove a package | 13 | | `pacman -Q` | List all installed packages | 14 | | `pacman -Qi package_name` | Display detailed information about a package | 15 | | `pacman -Qu` | List all packages that can be upgraded | 16 | 17 | ## Advanced Commands 18 | 19 | | Command | Description | 20 | | ------------------------- | --------------------------------------------------------- | 21 | | `pacman -Sw package_name` | Download a package without installing it | 22 | | `pacman -Scc` | Clear package cache | 23 | | `pacman -U package_name` | Install a local package | 24 | | `pacman -Rs package_name` | Remove a package and its dependencies | 25 | | `pacman -Qdt` | List packages that are no longer required as dependencies | 26 | 27 | ## Configuration Files 28 | 29 | | File | Description | 30 | | -------------------------- | -------------------------------------------------- | 31 | | `/etc/pacman.conf` | Main configuration file for pacman | 32 | | `/etc/pacman.d/mirrorlist` | List of mirrors to use for package synchronization | 33 | 34 | ## Additional Resources 35 | 36 | - [Pacman Documentation](https://wiki.archlinux.org/title/pacman) 37 | - [Pacman Tips and Tricks](https://wiki.archlinux.org/title/Pacman/Tips_and_tricks) 38 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/ps.md: -------------------------------------------------------------------------------- 1 | # PS Cheatsheet 2 | 3 | This cheatsheet contains the essential commands and options of the `ps` command, a utility for displaying information about active processes in Unix-like operating systems. 4 | 5 | `Latest LTS: Ubuntu 20.04` 6 | 7 | ## Basics 8 | 9 | ### Displaying Process Information 10 | 11 | ```bash 12 | # Display information for all processes 13 | ps -e 14 | 15 | # Display information for a specific process by name 16 | ps -C processName 17 | 18 | # Display process information with additional fields 19 | ps -eo pid,ppid,cmd,%mem,%cpu 20 | ``` 21 | 22 | ### Sorting Output 23 | 24 | ```bash 25 | # Sort by process ID (ascending) 26 | ps -e --sort pid 27 | 28 | # Sort by process ID (descending) 29 | ps -e --sort -pid 30 | 31 | # Sort by process name (ascending) 32 | ps -e --sort cmd 33 | 34 | # Sort by process name (descending) 35 | ps -e --sort -cmd 36 | 37 | # Sort by process start time (oldest first) 38 | ps -e --sort start_time 39 | 40 | # Sort by process start time (newest first) 41 | ps -e --sort -start_time 42 | ``` 43 | 44 | ### Filtering Output 45 | 46 | ```bash 47 | # Display process information with a specific PID 48 | ps -p PID 49 | 50 | # Display processes by user name 51 | ps -U userName 52 | 53 | # Display processes by TTY 54 | ps -t TTY 55 | ``` 56 | 57 | ## Advanced 58 | 59 | ### Process Tree 60 | 61 | ```bash 62 | # Display process tree of all processes 63 | ps -e --forest 64 | 65 | # Display process tree for a specific process 66 | ps -f --ppid PARENT_PID 67 | ``` 68 | 69 | ### Continuous Output 70 | 71 | ```bash 72 | # Display process information continuously (like top) 73 | ps -e --forest --sort start_time --no-headers -o pid,ppid,cmd,%mem,%cpu | awk '{print $1,$2,$3,$4,$5; fflush()}' 74 | ``` 75 | 76 | ### Official Documentation 77 | 78 | - [ps man page](https://man7.org/linux/man-pages/man1/ps.1.html) 79 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/screen.md: -------------------------------------------------------------------------------- 1 | # Screen Cheatsheet 2 | 3 | This cheatsheet covers the basic commands and shortcuts for the Screen command in Linux. Screen is a powerful tool that allows you to run multiple terminal sessions within a single console and detach/reattach them at any time. 4 | 5 | ## Basic Commands 6 | 7 | | Command | Description | 8 | | ------------ | ------------------------------------------- | 9 | | screen | Start a new Screen session. | 10 | | screen -r | Reattach to a detached Screen session. | 11 | | screen -ls | List all available Screen sessions. | 12 | | screen -d | Detach a running Screen session. | 13 | | screen -D | Detach and logout a running Screen session. | 14 | | Ctrl + A + D | Detach a running Screen session. | 15 | | exit | Exit the current Screen session. | 16 | 17 | ## Session Management 18 | 19 | | Command | Description | 20 | | ------------ | --------------------------------------------- | 21 | | Ctrl + A + C | Create a new Screen window. | 22 | | Ctrl + A + N | Switch to the next Screen window. | 23 | | Ctrl + A + P | Switch to the previous Screen window. | 24 | | Ctrl + A + " | List all available Screen windows. | 25 | | Ctrl + A + S | Split the current Screen window horizontally. | 26 | | Ctrl + A + | Split the current Screen window vertically. | 27 | | Ctrl + A + X | Remove the current Screen region. | 28 | 29 | ## Other Commands 30 | 31 | | Command | Description | 32 | | ------------ | ---------------------------- | 33 | | Ctrl + A + ? | Display the help screen. | 34 | | Ctrl + A + Z | Suspend a Screen session. | 35 | | Ctrl + A + : | Enter Screen command prompt. | 36 | 37 | ## Additional Resources 38 | 39 | For more information about using Screen, consult the official Screen documentation: 40 | 41 | - [GNU Screen Official Documentation](https://www.gnu.org/software/screen/manual/) 42 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/sed.md: -------------------------------------------------------------------------------- 1 | # Sed Cheatsheet 2 | 3 | ## Description 4 | 5 | Sed is a powerful command-line tool for stream editing. It is used to transform text by applying a series of commands to it. Sed works by reading the input file line by line and performing the specified operations on each line. 6 | 7 | ## Command Options 8 | 9 | | Command | Description | 10 | | ------------------------------------ | --------------------------------------------------------------------- | 11 | | `sed [options] [script] [inputfile]` | Execute the sed script on the input file | 12 | | `-n` | Suppress automatic printing of pattern space | 13 | | `-e script` | Add the script to the commands to be executed | 14 | | `-f script-file` | Add the commands contained in the file to the commands to be executed | 15 | | `-r` | Use extended regular expressions in the script | 16 | | `-i [suffix]` | Edit files in place | 17 | | `-s` | Treat input as a single line | 18 | | `-u` | Use unbuffered output | 19 | 20 | ## Examples 21 | 22 | ### 1. Print specific line of a file 23 | 24 | To print a specific line of a file, use the following command: 25 | 26 | ```bash 27 | sed -n '5p' file.txt 28 | ``` 29 | 30 | ### 2. Replace text in a file 31 | 32 | To replace text in a file, use the following command: 33 | 34 | ```bash 35 | sed -i 's/old-text/new-text/g' file.txt 36 | ``` 37 | 38 | ### 3. Delete lines from a file 39 | 40 | To delete lines from a file, use the following command: 41 | 42 | ```bash 43 | sed -i '2,5d' file.txt 44 | ``` 45 | 46 | ## Common Uses 47 | 48 | - Search and replace text in a file 49 | - Delete lines from a file 50 | - Extract specific lines from a file 51 | - Transform data in a file into a new format 52 | 53 | ## Additional Resources 54 | 55 | Official sed documentation: https://www.gnu.org/software/sed/manual/sed.html 56 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/ssh.md: -------------------------------------------------------------------------------- 1 | # SSH Cheatsheet 2 | 3 | ## Introduction 4 | 5 | Secure Shell (SSH) is a cryptographic network protocol used for secure data communication, remote shell services or command execution and other secure network services between two networked computers. It was designed as a replacement for Telnet and other insecure remote shell protocols. 6 | 7 | ## Key-based authentication 8 | 9 | Key-based authentication is more secure than password-based authentication, as it eliminates the need to send a password over the network, which could be intercepted. With key-based authentication, the client machine has a public key, and the server machine has a private key. 10 | 11 | ### Generating an SSH Key-Pair 12 | 13 | To generate a key-pair, run the following command in a terminal: 14 | 15 | ```bash 16 | ssh-keygen -t rsa 17 | ``` 18 | 19 | ### Adding your public key to the remote server 20 | 21 | To add your public key to the remote server, use the following command: 22 | 23 | ```bash 24 | ssh-copy-id user@remote_server 25 | ``` 26 | 27 | ## Connecting to a Remote Server 28 | 29 | To connect to a remote server, use the following command: 30 | 31 | ```bash 32 | ssh user@remote_server 33 | ``` 34 | 35 | ## Port Forwarding 36 | 37 | Port forwarding allows you to forward traffic from a local port to a remote server. For example, to forward traffic from port 8080 on your local machine to port 80 on a remote server, run the following command: 38 | 39 | ```bash 40 | ssh -L 8080:remote_server:80 user@remote_server 41 | ``` 42 | 43 | ## SCP (Secure Copy) 44 | 45 | SCP is a secure way to copy files between two machines over an SSH connection. To copy a file from your local machine to a remote server, run the following command: 46 | 47 | ```bash 48 | scp file.txt user@remote_server:~/ 49 | ``` 50 | 51 | To copy a file from a remote server to your local machine, run the following command: 52 | 53 | ```bash 54 | scp user@remote_server:file.txt ~/ 55 | ``` 56 | 57 | ## Conclusion 58 | 59 | This cheatsheet provides a basic understanding of how to use SSH to securely connect to remote servers and transfer files. There are many more features and options available in SSH, but these basic commands should cover most common use cases. 60 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/systemd.md: -------------------------------------------------------------------------------- 1 | # Systemd Cheatsheet 2 | 3 | This cheatsheet contains the essential commands and concepts of Systemd, a system and service manager for Linux operating systems. 4 | 5 | `Latest LTS: Systemd 249` 6 | 7 | ## Basics 8 | 9 | ### Systemctl 10 | 11 | ```bash 12 | # Start a service 13 | systemctl start serviceName 14 | 15 | # Stop a service 16 | systemctl stop serviceName 17 | 18 | # Restart a service 19 | systemctl restart serviceName 20 | 21 | # Reload a service 22 | systemctl reload serviceName 23 | 24 | # Enable a service at boot 25 | systemctl enable serviceName 26 | 27 | # Disable a service at boot 28 | systemctl disable serviceName 29 | 30 | # Check status of a service 31 | systemctl status serviceName 32 | ``` 33 | 34 | ### Journalctl 35 | 36 | ```bash 37 | # Show log entries for a service 38 | journalctl -u serviceName 39 | 40 | # Show log entries starting from a specific time 41 | journalctl --since "2022-02-13 00:00:00" 42 | 43 | # Show log entries for a specific process 44 | journalctl _PID=processID 45 | 46 | # Show log entries for a specific unit type 47 | journalctl -t unitType 48 | ``` 49 | 50 | ### Unit Files 51 | 52 | ```bash 53 | # List all unit files 54 | systemctl list-unit-files 55 | 56 | # Show the status of a unit 57 | systemctl status unitName.service 58 | 59 | # Edit a unit file 60 | systemctl edit unitName.service 61 | 62 | # Check syntax of a unit file 63 | systemctl daemon-reload 64 | systemctl is-active unitName.service 65 | ``` 66 | 67 | ## Advanced 68 | 69 | ### Targets 70 | 71 | ```bash 72 | # Show default target 73 | systemctl get-default 74 | 75 | # Change default target 76 | systemctl set-default targetName 77 | 78 | # List available targets 79 | systemctl list-units --type target 80 | ``` 81 | 82 | ### Dependencies 83 | 84 | ```bash 85 | # Show dependencies for a unit 86 | systemctl list-dependencies unitName.service 87 | 88 | # Show all units that depend on a unit 89 | systemctl list-dependencies --reverse unitName.service 90 | ``` 91 | 92 | ### Systemd-Resolved 93 | 94 | ```bash 95 | # Show current DNS settings 96 | systemd-resolve --status 97 | 98 | # Show DNS server IP addresses 99 | systemd-resolve --status | grep "DNS Servers" 100 | ``` 101 | 102 | ## Official Documentation 103 | 104 | - [Systemd Documentation](https://systemd.io/) 105 | - [Systemd on Wikipedia](https://en.wikipedia.org/wiki/Systemd) 106 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/tar.md: -------------------------------------------------------------------------------- 1 | # tar Command Cheatsheet 2 | 3 | tar is a command in Unix-like operating systems that is used to create and extract archive files. 4 | 5 | ## Basic Usage 6 | 7 | The basic usage of the `tar` command is as follows: 8 | 9 | ```sh 10 | tar [options] [operation] [archive file] [files and directories to be archived] 11 | ``` 12 | 13 | - `[options]`: Options to modify the behavior of the `tar` command. 14 | - `[operation]`: The operation to perform on the archive file, either `-c` (create) or `-x` (extract). 15 | - `[archive file]`: The name of the archive file. 16 | - `[files and directories to be archived]`: The files and directories to be included in the archive file. 17 | 18 | ## Common Options 19 | 20 | Here are some of the most commonly used options for the `tar` command: 21 | 22 | - `-c`: Create a new archive file. 23 | - `-x`: Extract the contents of an archive file. 24 | - `-v`: Verbosely list the contents of an archive file or show the progress of an operation. 25 | - `-f`: Specify the name of the archive file to be used. 26 | - `-z`: Compress the archive file using gzip compression. 27 | - `-j`: Compress the archive file using bzip2 compression. 28 | - `-C`: Change to the specified directory before starting the operation. 29 | - `--exclude`: Exclude specified files and directories from the archive. 30 | 31 | ## Examples 32 | 33 | Here are some examples of the `tar` command in action: 34 | 35 | - `tar -cvf archive.tar file1.txt file2.txt`: Create a new archive file named `archive.tar` that includes the files `file1.txt` and `file2.txt`. 36 | 37 | - `tar -xvf archive.tar`: Extract the contents of the archive file `archive.tar`. 38 | 39 | - `tar -czvf archive.tar.gz file1.txt file2.txt`: Create a new gzip-compressed archive file named `archive.tar.gz` that includes the files `file1.txt` and `file2.txt`. 40 | 41 | - `tar -xzvf archive.tar.gz`: Extract the contents of the gzip-compressed archive file `archive.tar.gz`. 42 | 43 | - `tar -C /tmp -cvf archive.tar file1.txt file2.txt`: Create a new archive file named `archive.tar` in the directory `/tmp` that includes the files `file1.txt` and `file2.txt`. 44 | 45 | - `tar -cvf archive.tar --exclude='*.log' /var/log`: Create a new archive file named `archive.tar` that includes the contents of the directory `/var/log`, excluding all files with the `.log` extension. 46 | 47 | ## Conclusion 48 | 49 | This cheatsheet has covered the basic usage and common options for the `tar` command. By combining these options, you can easily create and extract archive files using the `tar` command. For more information on the `tar` command, consult the manual page by running `man tar` in your terminal. 50 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/top.md: -------------------------------------------------------------------------------- 1 | # TOP COMMAND CHEATSHEET 2 | 3 | ## Introduction 4 | 5 | The `top` command is a utility that provides real-time information about the system's running processes, memory usage, and CPU utilization. By default, it displays a dynamic view of the system that updates periodically. 6 | 7 | ## Basic Usage 8 | 9 | To run the `top` command, simply open a terminal and type: 10 | 11 | ```bash 12 | top 13 | ``` 14 | 15 | This will launch the `top` utility and display a real-time view of the system's processes. 16 | 17 | ## Command-Line Options 18 | 19 | Here are some of the most commonly used command-line options for the `top` command: 20 | 21 | | Option | Description | 22 | | --------------- | -------------------------------------------- | 23 | | `-d ` | Set the delay between updates (in seconds) | 24 | | `-p ` | Monitor a specific process ID (PID) | 25 | | `-u ` | Monitor a specific user's processes | 26 | | `-b` | Run `top` in batch mode (useful for scripts) | 27 | | `-c` | Show the command-line arguments of processes | 28 | 29 | ## Interactive Commands 30 | 31 | While `top` is running, you can use a number of interactive commands to control its behavior. Here are some of the most useful ones: 32 | 33 | | Command | Description | 34 | | ------- | -------------------------------------- | 35 | | `q` | Quit `top` | 36 | | `k` | Kill a process | 37 | | `r` | Renice a process (change its priority) | 38 | | `f` | Show or hide fields | 39 | | `o` | Change the sort order of the processes | 40 | | `s` | Change the update interval | 41 | | `l` | Toggle display of load average | 42 | 43 | ## Sorting Options 44 | 45 | By default, `top` displays processes sorted by CPU usage. However, you can change the sorting order by using the following keys: 46 | 47 | | Key | Description | 48 | | --- | --------------------------- | 49 | | `P` | Sort by CPU usage (default) | 50 | | `M` | Sort by memory usage | 51 | | `T` | Sort by process time | 52 | | `N` | Sort by process name | 53 | | `<` | Sort by PID (ascending) | 54 | | `>` | Sort by PID (descending) | 55 | 56 | ## Conclusion 57 | 58 | The `top` command is an essential tool for monitoring system performance and troubleshooting issues related to CPU and memory usage. By using the options and commands outlined in this cheatsheet, you can customize its behavior and get the most out of it. 59 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/tree.md: -------------------------------------------------------------------------------- 1 | # Tree Cheatsheet 2 | 3 | This cheatsheet contains the essential commands and options of the `tree` command, a utility for displaying directory trees in Unix-like operating systems. 4 | 5 | `Latest LTS: Ubuntu 20.04` 6 | 7 | ## Basics 8 | 9 | ### Displaying Directory Trees 10 | 11 | ```bash 12 | # Display directory tree with depth of 1 13 | tree -L 1 14 | 15 | # Display directory tree with specified depth 16 | tree -L 2 path/to/directory 17 | 18 | # Display directory tree with full path 19 | tree -f path/to/directory 20 | 21 | # Display directory tree with hidden files 22 | tree -a path/to/directory 23 | 24 | # Display directory tree in long format 25 | tree -l path/to/directory 26 | 27 | # Display directory tree with file sizes 28 | tree -s path/to/directory 29 | 30 | # Display directory tree with file sizes and human-readable units 31 | tree -h path/to/directory 32 | ``` 33 | 34 | ### Filtering Output 35 | 36 | ```bash 37 | # Display directory tree with specific file extensions 38 | tree -P "*.txt" path/to/directory 39 | 40 | # Display directory tree without specified file extensions 41 | tree -I "*.txt" path/to/directory 42 | ``` 43 | 44 | ### Output Control 45 | 46 | ```bash 47 | # Save directory tree to file 48 | tree path/to/directory > output.txt 49 | 50 | # Display directory tree in color 51 | tree -C path/to/directory 52 | 53 | # Display directory tree with file permissions 54 | tree -p path/to/directory 55 | 56 | # Display directory tree with file modification times 57 | tree -D path/to/directory 58 | 59 | # Display directory tree in XML format 60 | tree -X path/to/directory 61 | 62 | # Display directory tree in JSON format 63 | tree -J path/to/directory 64 | ``` 65 | 66 | ### Display Options 67 | 68 | ```bash 69 | # Display directory tree without indentation lines 70 | tree -i path/to/directory 71 | 72 | # Display directory tree without showing the root directory 73 | tree -O path/to/directory 74 | 75 | # Display directory tree with only directories 76 | tree -d path/to/directory 77 | ``` 78 | 79 | ## Advanced 80 | 81 | ### Compare Directories 82 | 83 | ```bash 84 | # Compare two directories 85 | tree --du --inodes path/to/directory1 > directory1.txt 86 | tree --du --inodes path/to/directory2 > directory2.txt 87 | diff directory1.txt directory2.txt 88 | ``` 89 | 90 | ### Filter Based on Size 91 | 92 | ```bash 93 | # Display directory tree with files larger than a specified size 94 | tree -L 2 path/to/directory --filelimit size 95 | 96 | # Display directory tree with files smaller than a specified size 97 | tree -L 2 path/to/directory --filelimit -size 98 | ``` 99 | 100 | ### Official Documentation 101 | 102 | - [tree man page](https://manned.org/tree) 103 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/yum.md: -------------------------------------------------------------------------------- 1 | # Yum Cheatsheet 2 | 3 | This cheatsheet provides a quick reference guide for using Yum package manager. 4 | 5 | ## Basic Commands 6 | 7 | | Command | Description | 8 | | ------------------ | ------------------------------------------------------------- | 9 | | `yum update` | Update all installed packages to their latest versions | 10 | | `yum install` | Install packages from a repository | 11 | | `yum remove` | Remove installed packages | 12 | | `yum search` | Search for a package in repositories | 13 | | `yum list` | List installed packages or packages available in repositories | 14 | | `yum info` | Display detailed information about a package | 15 | | `yum clean` | Remove cached data | 16 | | `yum check-update` | Check for available package updates | 17 | | `yum upgrade` | Upgrade installed packages to their latest versions | 18 | | `yum downgrade` | Downgrade installed packages to a previous version | 19 | | `yum groupinstall` | Install all packages in a specific package group | 20 | | `yum groupremove` | Remove all packages in a specific package group | 21 | 22 | ## Display the Transaction History of Yum Commands 23 | 24 | | Command | Description | 25 | | ------------------ | --------------------------------------------------------- | 26 | | `yum history` | Display a summary of all previous transactions | 27 | | `yum history list` | Display a detailed list of all previous transactions | 28 | | `yum history info` | Display detailed information about a specific transaction | 29 | | `yum history undo` | Undo a specific transaction | 30 | 31 | ## Additional Resources 32 | 33 | - Yum command cheat sheet: https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf 34 | - Yum documentation: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-yum 35 | -------------------------------------------------------------------------------- /operating_systems/linux/tools/zstd.md: -------------------------------------------------------------------------------- 1 | # Zstandard (zstd) Command Cheatsheet 2 | 3 | ## Description 4 | 5 | `zstd` is a fast lossless compression algorithm and command-line tool developed by Facebook. It can compress and decompress files and streams, and supports multi-threading for improved performance. 6 | 7 | ## Syntax 8 | 9 | Compression: `zstd [OPTIONS]... [FILE]...` 10 | 11 | Decompression: `zstd -d [OPTIONS]... [FILE]...` 12 | 13 | ## Options 14 | 15 | | Option | Description | 16 | | ------ | --------------------------------------------------- | 17 | | `-#` | Set compression level (1-22, default: 3). | 18 | | `-d` | Decompress input file(s). | 19 | | `-k` | Keep input file(s) after compression/decompression. | 20 | | `-f` | Force compression, even if output file exists. | 21 | | `-t` | Test compressed file(s) integrity. | 22 | | `-C` | Change directory before operation. | 23 | 24 | ## Examples 25 | 26 | Compress file `file.txt` with maximum compression level: 27 | 28 | ```bash 29 | zstd -19 file.txt 30 | ``` 31 | 32 | Decompress file `file.txt.zst`: 33 | 34 | ```bash 35 | zstd -d file.txt.zst 36 | ``` 37 | 38 | Compress all files in current directory with default compression level and keep original files: 39 | 40 | ```bash 41 | zstd -k * 42 | ``` 43 | 44 | Compress all files in current directory and subdirectories with maximum compression level: 45 | 46 | ```bash 47 | find . -type f -print0 | xargs -0 zstd -19 48 | ``` 49 | 50 | Test integrity of compressed file: 51 | 52 | ```bash 53 | zstd -t file.txt.zst 54 | ``` 55 | 56 | ## Additional Resources 57 | 58 | - [Official zstd documentation](https://github.com/facebook/zstd/blob/dev/README.md) 59 | - [Zstandard website](https://facebook.github.io/zstd/) 60 | -------------------------------------------------------------------------------- /operating_systems/linux/ubuntu.md: -------------------------------------------------------------------------------- 1 | # Ubuntu System Administration Cheatsheet 2 | 3 | ## General System Information 4 | 5 | - Display system information: `lsb_release -a` 6 | - Display kernel information: `uname -a` 7 | - Display hostname: `hostname` 8 | - Display system uptime: `uptime` 9 | 10 | ## User Management 11 | 12 | - Add user: `sudo adduser [username]` 13 | - Delete user: `sudo userdel [username]` 14 | - Add user to group: `sudo adduser [username] [groupname]` 15 | - Delete user from group: `sudo gpasswd -d [username] [groupname]` 16 | 17 | ## File System Management 18 | 19 | - Display disk usage: `df -h` 20 | - Create directory: `mkdir [directory name]` 21 | - Change file permissions: `chmod [options] [file/directory name]` 22 | - Change file ownership: `chown [options] [file/directory name]` 23 | 24 | ## Package Management 25 | 26 | - Update package information: `sudo apt update` 27 | - Upgrade packages: `sudo apt upgrade` 28 | - Install package: `sudo apt install [package name]` 29 | - Remove package: `sudo apt remove [package name]` 30 | - Search for package: `sudo apt search [package name]` 31 | 32 | ## Network Configuration 33 | 34 | - Display IP address: `ip addr show` 35 | - Display routing information: `ip route` 36 | - Display network interfaces: `ifconfig` 37 | - Edit network interfaces: `sudo nano /etc/network/interfaces` 38 | 39 | ## Services 40 | 41 | - List all services: `sudo service --status-all` 42 | - Start service: `sudo service [service name] start` 43 | - Stop service: `sudo service [service name] stop` 44 | - Restart service: `sudo service [service name] restart` 45 | 46 | ## Process Management 47 | 48 | - Display running processes: `ps aux` 49 | - Kill process: `kill [process ID]` 50 | - Kill process by name: `killall [process name]` 51 | -------------------------------------------------------------------------------- /operating_systems/macos/ventura.md: -------------------------------------------------------------------------------- 1 | # Ventura macOS Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Ventura on macOS. 4 | 5 | ## Terminal Commands 6 | 7 | ### Basic Commands 8 | 9 | | Command | Description | 10 | | ------- | --------------------------------------------------------- | 11 | | `pwd` | Displays the current working directory. | 12 | | `ls` | Lists the files and directories in the current directory. | 13 | | `cd` | Changes the current working directory. | 14 | | `mkdir` | Creates a new directory. | 15 | | `touch` | Creates a new file. | 16 | | `rm` | Removes a file. | 17 | | `rmdir` | Removes a directory. | 18 | | `cp` | Copies a file. | 19 | | `mv` | Moves a file. | 20 | | `man` | Displays the manual page for a command. | 21 | 22 | ### System Commands 23 | 24 | | Command | Description | 25 | | ---------- | --------------------------------- | 26 | | `top` | Displays system processes. | 27 | | `kill` | Terminates a process. | 28 | | `ps` | Displays running processes. | 29 | | `ifconfig` | Displays network configuration. | 30 | | `ping` | Sends a packet to a network host. | 31 | 32 | ## Keyboard Shortcuts 33 | 34 | | Shortcut | Description | 35 | | --------------------------- | --------------------------------- | 36 | | `Command + C` | Copy selected text or file. | 37 | | `Command + V` | Paste copied text or file. | 38 | | `Command + Z` | Undo the last action. | 39 | | `Command + Q` | Quit the active application. | 40 | | `Command + Space` | Open Spotlight search. | 41 | | `Command + Tab` | Switch between open applications. | 42 | | `Command + Option + Escape` | Force quit an application. | 43 | 44 | ## Additional Resources 45 | 46 | - [macOS Documentation](https://support.apple.com/macos) 47 | - [Mac Keyboard Shortcuts](https://support.apple.com/en-us/HT201236) 48 | -------------------------------------------------------------------------------- /operating_systems/macos/versions.md: -------------------------------------------------------------------------------- 1 | # macOS Versions 2 | 3 | | macOS Version | Release Date | Version Number | 4 | | ------------- | ------------------ | -------------- | 5 | | Cheetah | March 24, 2001 | 10.0 | 6 | | Puma | September 25, 2001 | 10.1 | 7 | | Jaguar | August 24, 2002 | 10.2 | 8 | | Panther | October 24, 2003 | 10.3 | 9 | | Tiger | April 29, 2005 | 10.4 | 10 | | Leopard | October 26, 2007 | 10.5 | 11 | | Snow Leopard | August 28, 2009 | 10.6 | 12 | | Lion | July 20, 2011 | 10.7 | 13 | | Mountain Lion | July 25, 2012 | 10.8 | 14 | | Mavericks | October 22, 2013 | 10.9 | 15 | | Yosemite | October 16, 2014 | 10.10 | 16 | | El Capitan | September 30, 2015 | 10.11 | 17 | | Sierra | September 20, 2016 | 10.12 | 18 | | High Sierra | September 25, 2017 | 10.13 | 19 | | Mojave | September 24, 2018 | 10.14 | 20 | | Catalina | October 7, 2019 | 10.15 | 21 | | Big Sur | November 12, 2020 | 11.0 | 22 | | Monterey | October 25, 2021 | 12.0 | 23 | | Ventura | October 24, 2022 | 13.0 | 24 | -------------------------------------------------------------------------------- /operating_systems/windows/versions.md: -------------------------------------------------------------------------------- 1 | # Cheatsheet of all Windows versions, both consumer-level and server-level in the last 10 years 2 | 3 | | Windows Version | Release Date | End of Support | 4 | | ------------------------- | ----------------- | ---------------- | 5 | | Windows 7 | July 22, 2009 | January 14, 2020 | 6 | | Windows 8 | October 26, 2012 | January 10, 2023 | 7 | | Windows 8.1 | October 17, 2013 | January 10, 2023 | 8 | | Windows 10 | July 29, 2015 | October 14, 2025 | 9 | | Windows 10 IoT Enterprise | August 2, 2016 | October 14, 2025 | 10 | | Windows 11 | October 5, 2021 | October 14, 2031 | 11 | | Windows Server 2008 | February 27, 2008 | January 14, 2020 | 12 | | Windows Server 2008 R2 | July 22, 2009 | January 14, 2020 | 13 | | Windows Server 2012 | September 4, 2012 | October 10, 2023 | 14 | | Windows Server 2012 R2 | October 18, 2013 | October 10, 2023 | 15 | | Windows Server 2016 | October 12, 2016 | January 11, 2022 | 16 | | Windows Server 2019 | October 2, 2018 | January 9, 2024 | 17 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_10.md: -------------------------------------------------------------------------------- 1 | # Windows 10 Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Windows 10. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | ------------------- | ------------------------- | 9 | | `Windows Key + D` | Show or hide the desktop. | 10 | | `Windows Key + E` | Open File Explorer. | 11 | | `Windows Key + I` | Open Settings. | 12 | | `Windows Key + L` | Lock the device. | 13 | | `Windows Key + R` | Open the Run dialog box. | 14 | | `Windows Key + S` | Open Search. | 15 | | `Windows Key + X` | Open the Quick Link menu. | 16 | | `Windows Key + P` | Project the screen. | 17 | | `Windows Key + Tab` | Open Task View. | 18 | 19 | ## Command Prompt Commands 20 | 21 | | Command | Description | 22 | | ---------- | --------------------------------- | 23 | | `cd` | Change directory. | 24 | | `dir` | List the contents of a directory. | 25 | | `md` | Create a new directory. | 26 | | `rd` | Remove a directory. | 27 | | `type` | Display the contents of a file. | 28 | | `copy` | Copy a file. | 29 | | `move` | Move a file. | 30 | | `del` | Delete a file. | 31 | | `ping` | Test the network connection. | 32 | | `ipconfig` | Display network configuration. | 33 | 34 | ## PowerShell Commands 35 | 36 | | Command | Description | 37 | | --------------- | --------------------------------- | 38 | | `Get-Process` | List running processes. | 39 | | `Stop-Process` | Stop a process. | 40 | | `Get-Service` | List running services. | 41 | | `Stop-Service` | Stop a service. | 42 | | `Get-ChildItem` | List the contents of a directory. | 43 | | `New-Item` | Create a new file or directory. | 44 | | `Remove-Item` | Remove a file or directory. | 45 | | `Copy-Item` | Copy a file or directory. | 46 | | `Move-Item` | Move a file or directory. | 47 | 48 | ## Additional Resources 49 | 50 | - [Windows 10 Documentation](https://docs.microsoft.com/en-us/windows/) 51 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts) 52 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_11.md: -------------------------------------------------------------------------------- 1 | # Windows 11 Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Windows 11. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | ------------------- | ------------------------- | 9 | | `Windows Key + D` | Show or hide the desktop. | 10 | | `Windows Key + E` | Open File Explorer. | 11 | | `Windows Key + I` | Open Settings. | 12 | | `Windows Key + L` | Lock the device. | 13 | | `Windows Key + R` | Open the Run dialog box. | 14 | | `Windows Key + S` | Open Search. | 15 | | `Windows Key + X` | Open the Quick Link menu. | 16 | | `Windows Key + P` | Project the screen. | 17 | | `Windows Key + Tab` | Open Task View. | 18 | 19 | ## Command Prompt Commands 20 | 21 | | Command | Description | 22 | | ---------- | --------------------------------- | 23 | | `cd` | Change directory. | 24 | | `dir` | List the contents of a directory. | 25 | | `md` | Create a new directory. | 26 | | `rd` | Remove a directory. | 27 | | `type` | Display the contents of a file. | 28 | | `copy` | Copy a file. | 29 | | `move` | Move a file. | 30 | | `del` | Delete a file. | 31 | | `ping` | Test the network connection. | 32 | | `ipconfig` | Display network configuration. | 33 | 34 | ## PowerShell Commands 35 | 36 | | Command | Description | 37 | | --------------- | --------------------------------- | 38 | | `Get-Process` | List running processes. | 39 | | `Stop-Process` | Stop a process. | 40 | | `Get-Service` | List running services. | 41 | | `Stop-Service` | Stop a service. | 42 | | `Get-ChildItem` | List the contents of a directory. | 43 | | `New-Item` | Create a new file or directory. | 44 | | `Remove-Item` | Remove a file or directory. | 45 | | `Copy-Item` | Copy a file or directory. | 46 | | `Move-Item` | Move a file or directory. | 47 | 48 | ## Additional Resources 49 | 50 | - [Windows 11 Documentation](https://docs.microsoft.com/windows/) 51 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec) 52 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_2000.md: -------------------------------------------------------------------------------- 1 | # Windows 2000 Cheatsheet 2 | 3 | **Latest LTS Version:** N/A 4 | 5 | ## General Tips 6 | 7 | - Windows 2000 was released in 2000 and is an outdated operating system that is no longer supported by Microsoft. It is not recommended to use this operating system for any purpose, especially for online activities. 8 | - If you must use Windows 2000, it is recommended to use it in an isolated environment or offline machine to avoid potential security threats. 9 | - Windows 2000 was designed to support modern hardware components and is capable of running on newer hardware compared to its predecessor, Windows 98. 10 | 11 | ## Basic Commands 12 | 13 | - To open a program or file, double-click on its icon. 14 | - To move a file or folder, click and drag it to a new location. 15 | - To copy a file or folder, right-click on it and select "Copy" then right-click on the destination folder and select "Paste". 16 | - To delete a file or folder, right-click on it and select "Delete". 17 | - To change the desktop background, right-click on the desktop, select "Properties", then choose the "Background" tab and select a new image. 18 | 19 | ## System Commands 20 | 21 | - To access the Control Panel, click on the "Start" button, select "Settings", and then select "Control Panel". 22 | - To shut down or restart the computer, click on the "Start" button, select "Shut Down", and then select the appropriate option. 23 | 24 | ## Command Prompt 25 | 26 | - To access the Command Prompt, click on the "Start" button, select "Run", type "cmd", and then press "Enter". 27 | - To change the current directory, use the "cd" command followed by the directory name. For example, "cd C:\Windows\System32". 28 | - To list the files and directories in the current directory, use the "dir" command. 29 | 30 | ## Additional Resources 31 | 32 | - [Windows 2000 Resource Kit](https://www.microsoft.com/en-us/download/details.aspx?id=6245) 33 | - [Windows 2000 Support Center](https://support.microsoft.com/en-us/topic/windows-2000-support-has-ended-46376b8d-3a03-750d-49b5-d5e8e07f0ac9) 34 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_7.md: -------------------------------------------------------------------------------- 1 | # Windows 7 Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Windows 7. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | --- | --- | 9 | | `Windows Key` | Open or close the Start menu. | 10 | | `Windows Key + D` | Show or hide the desktop. | 11 | | `Windows Key + E` | Open Windows Explorer. | 12 | | `Windows Key + F` | Search for files or folders. | 13 | | `Windows Key + L` | Lock the device. | 14 | | `Windows Key + R` | Open the Run dialog box. | 15 | | `Windows Key + P` | Project to a different display. | 16 | | `Windows Key + X` | Open the Windows Mobility Center. | 17 | | `Ctrl + Shift + Esc` | Open Task Manager. | 18 | 19 | ## Command Prompt Commands 20 | 21 | | Command | Description | 22 | | --- | --- | 23 | | `cd` | Change directory. | 24 | | `dir` | List the contents of a directory. | 25 | | `md` | Create a new directory. | 26 | | `rd` | Remove a directory. | 27 | | `type` | Display the contents of a file. | 28 | | `copy` | Copy a file. | 29 | | `move` | Move a file. | 30 | | `del` | Delete a file. | 31 | | `ping` | Test the network connection. | 32 | | `ipconfig` | Display network configuration. | 33 | 34 | ## PowerShell Commands 35 | 36 | | Command | Description | 37 | | --- | --- | 38 | | `Get-Process` | List running processes. | 39 | | `Stop-Process` | Stop a process. | 40 | | `Get-Service` | List running services. | 41 | | `Stop-Service` | Stop a service. | 42 | | `Get-ChildItem` | List the contents of a directory. | 43 | | `New-Item` | Create a new file or directory. | 44 | | `Remove-Item` | Remove a file or directory. | 45 | | `Copy-Item` | Copy a file or directory. | 46 | | `Move-Item` | Move a file or directory. | 47 | 48 | ## Additional Resources 49 | 50 | - [Windows 7 Documentation](https://docs.microsoft.com/en-us/windows/) 51 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts) 52 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_8.md: -------------------------------------------------------------------------------- 1 | # Windows 8/8.1 Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Windows 8/8.1. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | --- | --- | 9 | | `Windows Key` | Open or close the Start screen. | 10 | | `Windows Key + D` | Show or hide the desktop. | 11 | | `Windows Key + X` | Open the Quick Link menu. | 12 | | `Windows Key + C` | Open Charms. | 13 | | `Windows Key + I` | Open Settings. | 14 | | `Windows Key + L` | Lock the device. | 15 | | `Windows Key + R` | Open the Run dialog box. | 16 | | `Windows Key + Q` | Search for apps. | 17 | | `Windows Key + W` | Search for settings. | 18 | 19 | ## Command Prompt Commands 20 | 21 | | Command | Description | 22 | | --- | --- | 23 | | `cd` | Change directory. | 24 | | `dir` | List the contents of a directory. | 25 | | `md` | Create a new directory. | 26 | | `rd` | Remove a directory. | 27 | | `type` | Display the contents of a file. | 28 | | `copy` | Copy a file. | 29 | | `move` | Move a file. | 30 | | `del` | Delete a file. | 31 | | `ping` | Test the network connection. | 32 | | `ipconfig` | Display network configuration. | 33 | 34 | ## PowerShell Commands 35 | 36 | | Command | Description | 37 | | --- | --- | 38 | | `Get-Process` | List running processes. | 39 | | `Stop-Process` | Stop a process. | 40 | | `Get-Service` | List running services. | 41 | | `Stop-Service` | Stop a service. | 42 | | `Get-ChildItem` | List the contents of a directory. | 43 | | `New-Item` | Create a new file or directory. | 44 | | `Remove-Item` | Remove a file or directory. | 45 | | `Copy-Item` | Copy a file or directory. | 46 | | `Move-Item` | Move a file or directory. | 47 | 48 | ## Additional Resources 49 | 50 | - [Windows 8/8.1 Documentation](https://docs.microsoft.com/en-us/windows/) 51 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/en-us/help/12606/windows-keyboard-shortcuts) 52 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_95.md: -------------------------------------------------------------------------------- 1 | # Windows 95 Cheatsheet 2 | 3 | ## Keyboard Shortcuts 4 | 5 | - Ctrl + Esc: Open the Start menu 6 | - Ctrl + Alt + Del: Open the Task Manager 7 | - Windows key + D: Show the desktop 8 | - Windows key + E: Open File Explorer 9 | - Windows key + R: Open the Run dialog 10 | - Alt + Tab: Switch between open windows 11 | 12 | ## File Explorer 13 | 14 | - Right-click the Start button: Open File Explorer 15 | - F3: Search for a file or folder 16 | - Alt + Enter: Open the Properties of a selected file or folder 17 | - Shift + Delete: Permanently delete a file or folder 18 | - Ctrl + A: Select all files or folders in a directory 19 | 20 | ## Task Manager 21 | 22 | - Ctrl + Shift + Esc: Open the Task Manager directly 23 | - End Task: End a running process 24 | - Start Task: Start a stopped process 25 | 26 | ## Display Properties 27 | 28 | - Right-click the desktop: Open Display Properties 29 | - Ctrl + Alt + Minus sign (-): Switch to the previous screen 30 | - Ctrl + Alt + Plus sign (+): Switch to the next screen 31 | 32 | ## Power Management 33 | 34 | - Windows key + X: Open the Quick Link menu 35 | - Shut down: Close all programs and shut down the computer 36 | - Restart: Close all programs and restart the computer 37 | - Sleep: Put the computer into sleep mode 38 | - Hibernate: Put the computer into hibernation mode 39 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_98.md: -------------------------------------------------------------------------------- 1 | # Windows 98 Cheatsheet 2 | 3 | **Latest LTS Version:** N/A 4 | 5 | ## General Tips 6 | 7 | - Windows 98 was released in 1998 and is an outdated operating system that is no longer supported by Microsoft. It is not recommended to use this operating system for any purpose, especially for online activities. 8 | - If you must use Windows 98, it is recommended to use it in an isolated environment or offline machine to avoid potential security threats. 9 | - Windows 98 was designed for older hardware, and it may not support modern hardware components such as USB drives or high-speed internet connections. 10 | 11 | ## Basic Commands 12 | 13 | - To open a program or file, double-click on its icon. 14 | - To move a file or folder, click and drag it to a new location. 15 | - To copy a file or folder, right-click on it and select "Copy" then right-click on the destination folder and select "Paste". 16 | - To delete a file or folder, right-click on it and select "Delete". 17 | - To change the desktop background, right-click on the desktop, select "Properties", then choose the "Background" tab and select a new image. 18 | 19 | ## System Commands 20 | 21 | - To access the Control Panel, click on the "Start" button, select "Settings", and then select "Control Panel". 22 | - To shut down or restart the computer, click on the "Start" button, select "Shut Down", and then select the appropriate option. 23 | 24 | ## Additional Resources 25 | 26 | - [Windows 98 User's Guide](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-98/) 27 | - [Windows 98 Support Center](https://support.microsoft.com/en-us/topic/windows-98-support-has-ended-851f0db7-e8ea-1342-9e73-ee5a1f6982a2) 28 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_server.md: -------------------------------------------------------------------------------- 1 | # Windows Server System Administration Cheatsheet 2 | 3 | ## General System Information 4 | 5 | - Display system information: `systeminfo` 6 | - Display kernel information: `winver` 7 | - Display hostname: `hostname` 8 | - Display system uptime: `net statistics server` 9 | 10 | ## User Management 11 | 12 | - Add user: `net user [username] [password] /add` 13 | - Delete user: `net user [username] /delete` 14 | - Add user to group: `net localgroup [groupname] [username] /add` 15 | - Remove user from group: `net localgroup [groupname] [username] /delete` 16 | 17 | ## File System Management 18 | 19 | - Display disk usage: `fsutil volume diskfree [drive letter]` 20 | - Create directory: `md [directory name]` 21 | - Change file/directory permissions: `icacls [file/directory name] [options] [permission specifications]` 22 | 23 | ## Package Management 24 | 25 | - Install package: `Server Manager` > `Manage` > `Add Roles and Features` 26 | - Remove package: `Server Manager` > `Manage` > `Remove Roles and Features` 27 | - Search for package: `Get-WindowsFeature` 28 | 29 | ## Network Configuration 30 | 31 | - Display IP address: `ipconfig` 32 | - Display routing information: `route print` 33 | - Display network interfaces: `Get-NetAdapter` 34 | - Edit network interfaces: `ncpa.cpl` 35 | 36 | ## Services 37 | 38 | - List all services: `Get-Service` 39 | - Start service: `Start-Service [service name]` 40 | - Stop service: `Stop-Service [service name]` 41 | - Restart service: `Restart-Service [service name]` 42 | 43 | ## Process Management 44 | 45 | - Display running processes: `Get-Process` 46 | - Kill process: `Stop-Process -Id [process ID]` 47 | - Kill process by name: `Get-Process | Where-Object { $_.ProcessName -eq "[process name]" } | Stop-Process` 48 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_vista.md: -------------------------------------------------------------------------------- 1 | # Windows Vista Cheatsheet 2 | 3 | This cheatsheet covers essential commands and shortcuts for the latest LTS version of Windows Vista. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | -------------------- | --------------------------------- | 9 | | `Windows Key` | Open or close the Start menu. | 10 | | `Windows Key + D` | Show or hide the desktop. | 11 | | `Windows Key + E` | Open Windows Explorer. | 12 | | `Windows Key + F` | Search for files or folders. | 13 | | `Windows Key + L` | Lock the device. | 14 | | `Windows Key + R` | Open the Run dialog box. | 15 | | `Windows Key + P` | Project to a different display. | 16 | | `Windows Key + X` | Open the Windows Mobility Center. | 17 | | `Ctrl + Shift + Esc` | Open Task Manager. | 18 | 19 | ## Command Prompt Commands 20 | 21 | | Command | Description | 22 | | ---------- | --------------------------------- | 23 | | `cd` | Change directory. | 24 | | `dir` | List the contents of a directory. | 25 | | `md` | Create a new directory. | 26 | | `rd` | Remove a directory. | 27 | | `type` | Display the contents of a file. | 28 | | `copy` | Copy a file. | 29 | | `move` | Move a file. | 30 | | `del` | Delete a file. | 31 | | `ping` | Test the network connection. | 32 | | `ipconfig` | Display network configuration. | 33 | 34 | ## Additional Resources 35 | 36 | - [Windows Vista Documentation](https://docs.microsoft.com/en-us/windows/) 37 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts) 38 | -------------------------------------------------------------------------------- /operating_systems/windows/windows_xp.md: -------------------------------------------------------------------------------- 1 | # Windows XP Cheatsheet 2 | 3 | This comprehensive cheatsheet covers essential commands, shortcuts, and tips for the latest LTS version of Windows XP. 4 | 5 | ## Keyboard Shortcuts 6 | 7 | | Shortcut | Description | 8 | | --- | --- | 9 | | `Windows Key` | Open or close the Start menu. | 10 | | `Windows Key + D` | Show or hide the desktop. | 11 | | `Windows Key + E` | Open Windows Explorer. | 12 | | `Windows Key + F` | Search for files or folders. | 13 | | `Windows Key + L` | Lock the device. | 14 | | `Windows Key + R` | Open the Run dialog box. | 15 | | `Windows Key + U` | Open the Utility Manager. | 16 | | `Ctrl + Alt + Del` | Open the Windows Security dialog box. | 17 | | `Alt + F4` | Close the active window. | 18 | | `Alt + Tab` | Switch between open windows. | 19 | 20 | ## Command Prompt Commands 21 | 22 | | Command | Description | 23 | | --- | --- | 24 | | `cd` | Change directory. | 25 | | `dir` | List the contents of a directory. | 26 | | `md` | Create a new directory. | 27 | | `rd` | Remove a directory. | 28 | | `type` | Display the contents of a file. | 29 | | `copy` | Copy a file. | 30 | | `move` | Move a file. | 31 | | `del` | Delete a file. | 32 | | `ping` | Test the network connection. | 33 | | `ipconfig` | Display network configuration. | 34 | 35 | ## Additional Tips 36 | 37 | - To access the "System Properties" dialog box, right-click on "My Computer" and select "Properties." 38 | - To view the Task Manager, press `Ctrl + Shift + Esc`. 39 | - To take a screenshot of the entire screen, press `Print Screen` key. To capture a specific window, press `Alt + Print Screen`. 40 | - To quickly launch a program from the Start menu, press the Windows key, type the program name, and press `Enter`. 41 | - To change the desktop background, right-click on the desktop, select "Properties," and navigate to the "Desktop" tab. 42 | 43 | ## Additional Resources 44 | 45 | - [Windows XP Documentation](https://docs.microsoft.com/en-us/windows/) 46 | - [Windows Keyboard Shortcuts](https://support.microsoft.com/en-us/help/12445/windows-keyboard-shortcuts) -------------------------------------------------------------------------------- /programming_languages/coffeescript.md: -------------------------------------------------------------------------------- 1 | # CoffeeScript (2.3.3) 2 | 3 | CoffeeScript is a high-level, dynamic, and interpreted programming language that compiles to JavaScript. 4 | 5 | ## Variables 6 | 7 | You can declare variables in CoffeeScript with the `=` operator. 8 | 9 | ```javascript 10 | x = 10 11 | y = 20 12 | z = x + y 13 | ``` 14 | 15 | ## Loops 16 | 17 | CoffeeScript has several ways to write loops. 18 | 19 | ### For Loop 20 | 21 | A for loop can be written using the `for` keyword. 22 | 23 | ```javascript 24 | for i in [0...10] 25 | console.log i 26 | ``` 27 | 28 | ### While Loop 29 | 30 | A while loop can be written using the `while` keyword. 31 | 32 | ```javascript 33 | i = 0 34 | while i < 10 35 | console.log i 36 | i++ 37 | ``` 38 | 39 | ## Functions 40 | 41 | Functions in CoffeeScript are declared using the `->` operator. 42 | 43 | ```javascript 44 | square = (x) -> x * x 45 | console.log square(10) 46 | ``` 47 | -------------------------------------------------------------------------------- /programming_languages/crystal.md: -------------------------------------------------------------------------------- 1 | # Crystal (0.35.1) 2 | 3 | Crystal is a statically-typed, object-oriented programming language that aims to have the syntax and performance of Ruby. It is designed to be fast and efficient, allowing developers to write high-performance code that is easy to read and maintain. 4 | 5 | ## Hello World 6 | 7 | A classic "Hello World" program in Crystal: 8 | 9 | ```ruby 10 | puts "Hello World" 11 | ``` 12 | 13 | ## Variables 14 | 15 | Variables in Crystal are declared with the `var` keyword. The type of the variable can be explicitly set or inferred from the value assigned to it: 16 | 17 | ```ruby 18 | var name = "Alice" # Inferred type is String 19 | var age : Int32 = 30 # Explicitly set as Int32 20 | ``` 21 | 22 | ## Arrays 23 | 24 | Arrays in Crystal are declared using square brackets: 25 | 26 | ```ruby 27 | array = [1, 2, 3] 28 | puts array[0] # Outputs 1 29 | ``` 30 | 31 | ## Hashes 32 | 33 | Hashes (also known as dictionaries or associative arrays) in Crystal are declared using curly braces: 34 | 35 | ```ruby 36 | hash = { "name" => "Alice", "age" => 30 } 37 | puts hash["name"] # Outputs "Alice" 38 | ``` 39 | 40 | ## Functions 41 | 42 | Functions in Crystal are declared using the `def` keyword. They can take parameters and return a value: 43 | 44 | ```ruby 45 | def greet(name : String) : String 46 | return "Hello, #{name}" 47 | end 48 | 49 | puts greet("Alice") # Outputs "Hello, Alice" 50 | ``` 51 | 52 | ## Classes 53 | 54 | Classes in Crystal are declared using the `class` keyword. They can have properties and methods: 55 | 56 | ```ruby 57 | class Person 58 | property name : String 59 | property age : Int32 60 | 61 | def initialize(@name, @age) 62 | end 63 | 64 | def greet 65 | return "Hello, I am #{@name} and I am #{@age} years old." 66 | end 67 | end 68 | 69 | person = Person.new("Alice", 30) 70 | puts person.greet # Outputs "Hello, I am Alice and I am 30 years old." 71 | ``` 72 | -------------------------------------------------------------------------------- /programming_languages/csharp.md: -------------------------------------------------------------------------------- 1 | # C# Cheatsheet 2 | 3 | C# is a modern, object-oriented programming language developed by Microsoft. It is used to develop a wide range of applications, including desktop applications, mobile applications, and web applications. 4 | 5 | ## Variables 6 | 7 | Variables are containers for storing data values. In C#, variables must be declared before they can be used and they have a specific data type that determines what kind of data they can store. 8 | 9 | ```C# 10 | int x = 10; 11 | float y = 20.5f; 12 | string name = "John Doe"; 13 | ``` 14 | 15 | ## Conditional Statements 16 | 17 | Conditional statements allow you to make decisions based on certain conditions. The `if` statement is used to execute a block of code only if a specified condition is true. 18 | 19 | ```C# 20 | int x = 10; 21 | if (x > 5) { 22 | Console.WriteLine("x is greater than 5"); 23 | } 24 | ``` 25 | 26 | ## Loops 27 | 28 | Loops are used to repeat a block of code multiple times. The `for` loop is used to execute a block of code a specified number of times. 29 | 30 | ```C# 31 | for (int i = 0; i < 10; i++) { 32 | Console.WriteLine(i); 33 | } 34 | ``` 35 | 36 | ## Arrays 37 | 38 | Arrays are data structures that store multiple values in a single variable. 39 | 40 | ```C# 41 | int[] numbers = new int[] { 1, 2, 3, 4, 5 }; 42 | foreach (int number in numbers) { 43 | Console.WriteLine(number); 44 | } 45 | ``` 46 | 47 | ## Methods 48 | 49 | Methods are blocks of code that perform a specific task. They can be called multiple times in a program. 50 | 51 | ```C# 52 | static void PrintHello() { 53 | Console.WriteLine("Hello World!"); 54 | } 55 | ``` 56 | 57 | ## Classes and Objects 58 | 59 | Classes are blueprint for creating objects, a blueprint defines a set of attributes and behaviors. Objects are instances of classes. 60 | 61 | ```C# 62 | class Car { 63 | public string Brand; 64 | public string Model; 65 | public int Year; 66 | 67 | public void StartEngine() { 68 | Console.WriteLine("Engine started!"); 69 | } 70 | } 71 | ``` 72 | 73 | ## Exception Handling 74 | 75 | Exception handling is a mechanism for handling errors and exceptional conditions that may occur in a program. 76 | 77 | ```C# 78 | try { 79 | int x = 10; 80 | int y = 0; 81 | if (y == 0) { 82 | throw new DivideByZeroException(); 83 | } 84 | int z = x / y; 85 | } catch (DivideByZeroException ex) { 86 | Console.WriteLine("Error: division by zero."); 87 | } 88 | ``` 89 | -------------------------------------------------------------------------------- /programming_languages/d.md: -------------------------------------------------------------------------------- 1 | # D Programming Language Cheatsheet 2 | 3 | D is a statically-typed, multi-paradigm system programming language created by Walter Bright of Digital Mars. It is known for its high performance, modern features and its interoperability with C code. 4 | 5 | ## Variables 6 | 7 | In D, variables are declared with a specific type and can be mutable or immutable: 8 | 9 | ```D 10 | // Mutable variable 11 | int x = 10; 12 | x = 20; 13 | 14 | // Immutable variable 15 | const int y = 10; 16 | y = 20; // Error: cannot modify a const 17 | ``` 18 | 19 | ## Functions 20 | 21 | Functions are declared using the `void` return type, or with a specific return type: 22 | 23 | ```D 24 | void printHello() 25 | { 26 | writeln("Hello"); 27 | } 28 | 29 | int add(int a, int b) 30 | { 31 | return a + b; 32 | } 33 | ``` 34 | 35 | ## Conditional Statements 36 | 37 | Conditional statements in D use the `if` and `switch` keywords: 38 | 39 | ```D 40 | int x = 10; 41 | 42 | if (x < 20) 43 | { 44 | writeln("x is less than 20"); 45 | } 46 | else if (x == 20) 47 | { 48 | writeln("x is equal to 20"); 49 | } 50 | else 51 | { 52 | writeln("x is greater than 20"); 53 | } 54 | 55 | switch (x) 56 | { 57 | case 10: 58 | writeln("x is 10"); 59 | break; 60 | case 20: 61 | writeln("x is 20"); 62 | break; 63 | default: 64 | writeln("x is not 10 or 20"); 65 | break; 66 | } 67 | ``` 68 | 69 | ## Arrays 70 | 71 | Arrays in D are declared with a specific type and size: 72 | 73 | ```D 74 | int[] arr = [1, 2, 3, 4, 5]; 75 | 76 | foreach (int element; arr) 77 | { 78 | writeln(element); 79 | } 80 | ``` 81 | 82 | ## Classes and Objects 83 | 84 | D supports object-oriented programming, with classes and objects: 85 | 86 | ```D 87 | class Person 88 | { 89 | string name; 90 | int age; 91 | 92 | void printInfo() 93 | { 94 | writeln("Name: ", name); 95 | writeln("Age: ", age); 96 | } 97 | } 98 | 99 | auto person = new Person(); 100 | person.name = "John Doe"; 101 | person.age = 30; 102 | person.printInfo(); 103 | ``` 104 | 105 | ## Conclusion 106 | 107 | This cheatsheet has covered some of the basic elements of the D programming language. There are many more features and advanced concepts in D that are not covered here. To learn more about D, refer to the official D documentation and resources. 108 | -------------------------------------------------------------------------------- /programming_languages/fortran.md: -------------------------------------------------------------------------------- 1 | # Fortran Programming Language 2 | 3 | Fortran is a high-level programming language used primarily in scientific and engineering applications. It was first developed in the 1950s and has since evolved through various versions. The current version is Fortran 2018, released in November 2018. 4 | 5 | ## Hello, World 6 | 7 | ```fortran 8 | program hello 9 | print *, "Hello, World!" 10 | end program hello 11 | ``` 12 | 13 | ## Variables 14 | 15 | ```fortran 16 | ! Declare a variable 17 | integer :: x 18 | real :: y 19 | character(len=10) :: name 20 | 21 | ! Assign a value to a variable 22 | x = 10 23 | y = 3.14159 24 | name = "Fortran" 25 | ``` 26 | 27 | ## Data Types 28 | 29 | ```fortran 30 | ! Numbers 31 | integer :: i 32 | real :: x 33 | complex :: z 34 | 35 | ! Characters 36 | character(len=10) :: name 37 | 38 | ! Arrays 39 | integer, dimension(3) :: a 40 | real, dimension(3,3) :: b 41 | ``` 42 | 43 | ## Control Structures 44 | 45 | ```fortran 46 | ! Conditionals 47 | if (x == 0) then 48 | print *, "x is zero" 49 | elseif (x < 0) then 50 | print *, "x is negative" 51 | else 52 | print *, "x is positive" 53 | end if 54 | 55 | ! Loops 56 | do i = 1, 10 57 | print *, i 58 | end do 59 | 60 | do i = 1, 10, 2 61 | print *, i 62 | end do 63 | 64 | do while (x < 10) 65 | print *, x 66 | x = x + 1 67 | end do 68 | ``` 69 | 70 | ## Functions 71 | 72 | ```fortran 73 | function factorial(n) 74 | integer :: n, factorial 75 | if (n == 0) then 76 | factorial = 1 77 | else 78 | factorial = n * factorial(n - 1) 79 | end if 80 | end function factorial 81 | 82 | result = factorial(5) 83 | ``` 84 | 85 | ## Subroutines 86 | 87 | ```fortran 88 | subroutine swap(a, b) 89 | integer :: a, b, temp 90 | temp = a 91 | a = b 92 | b = temp 93 | end subroutine swap 94 | 95 | call swap(x, y) 96 | ``` 97 | 98 | ## File I/O 99 | 100 | ```fortran 101 | ! Read from a file 102 | open(unit=1, file="input.txt") 103 | read(1, *) x, y 104 | close(1) 105 | 106 | ! Write to a file 107 | open(unit=2, file="output.txt") 108 | write(2, *) "The result is ", x + y 109 | close(2) 110 | ``` 111 | 112 | ## Modules 113 | 114 | ```fortran 115 | module my_module 116 | integer :: x 117 | contains 118 | subroutine my_subroutine(y) 119 | integer :: y 120 | x = y + 1 121 | end subroutine my_subroutine 122 | end module my_module 123 | 124 | use my_module 125 | call my_subroutine(10) 126 | print *, x 127 | ``` 128 | 129 | For more information on Fortran programming, please refer to the [Fortran WikiBook](https://en.wikibooks.org/wiki/Fortran). 130 | -------------------------------------------------------------------------------- /programming_languages/groovy.md: -------------------------------------------------------------------------------- 1 | # Groovy Cheatsheet 2 | 3 | Groovy is a dynamic, object-oriented programming language for the Java platform that provides a syntax that is concise and readable, making it easy for developers to write scripts and applications in this language. It supports both functional and object-oriented programming paradigms, making it a versatile language that can be used in a variety of applications. 4 | 5 | ## Variables 6 | 7 | In Groovy, variables are declared using the def keyword. 8 | 9 | ```groovy 10 | def name = "John Doe" 11 | println(name) 12 | ``` 13 | 14 | ## Strings 15 | 16 | String concatenation in Groovy can be done using the + operator. 17 | 18 | ```groovy 19 | def firstName = "John" 20 | def lastName = "Doe" 21 | def fullName = firstName + " " + lastName 22 | println(fullName) 23 | ``` 24 | 25 | ## Conditionals 26 | 27 | Conditionals in Groovy are similar to those in other programming languages. 28 | 29 | ```groovy 30 | def x = 5 31 | if (x > 4) { 32 | println("x is greater than 4") 33 | } else { 34 | println("x is not greater than 4") 35 | } 36 | ``` 37 | 38 | ## Loops 39 | 40 | The for loop in Groovy is similar to the for loop in Java. 41 | 42 | ```groovy 43 | for (int i = 0; i < 5; i++) { 44 | println(i) 45 | } 46 | ``` 47 | 48 | The while loop in Groovy is also similar to the while loop in other programming languages. 49 | 50 | ```groovy 51 | def i = 0 52 | while (i < 5) { 53 | println(i) 54 | i++ 55 | } 56 | ``` 57 | 58 | ## Arrays 59 | 60 | Arrays in Groovy can be declared using square brackets. 61 | 62 | ```groovy 63 | def numbers = [1, 2, 3, 4, 5] 64 | println(numbers) 65 | ``` 66 | 67 | ## Maps 68 | 69 | Maps in Groovy are similar to dictionaries in other programming languages. 70 | 71 | ```groovy 72 | def map = [firstName: "John", lastName: "Doe"] 73 | println(map) 74 | ``` 75 | 76 | ## Functions 77 | 78 | Functions in Groovy are declared using the def keyword. 79 | 80 | ```groovy 81 | def add(a, b) { 82 | return a + b 83 | } 84 | println(add(2, 3)) 85 | ``` 86 | 87 | ## Classes and Objects 88 | 89 | Classes in Groovy can be declared using the class keyword. 90 | 91 | ```groovy 92 | class Person { 93 | String firstName 94 | String lastName 95 | 96 | String getFullName() { 97 | return firstName + " " + lastName 98 | } 99 | } 100 | 101 | def person = new Person(firstName: "John", lastName: "Doe") 102 | println(person.fullName) 103 | ``` 104 | 105 | This is a basic cheatsheet for Groovy programming language. There is much more to learn about Groovy, including its advanced features and functionality, and how to use it to build powerful and effective applications. 106 | -------------------------------------------------------------------------------- /programming_languages/julia.md: -------------------------------------------------------------------------------- 1 | 2 | # Julia Cheatsheet 3 | 4 | ## Variables 5 | 6 | In Julia, variables are created and assigned a value using the `=` operator. 7 | 8 | ```julia 9 | x = 3 10 | y = "Hello, world!" 11 | ``` 12 | 13 | ## Data Types 14 | 15 | Julia supports a variety of data types, including integers, floating-point numbers, strings, and booleans. 16 | 17 | ```julia 18 | # integers 19 | x = 3 20 | 21 | # floating-point numbers 22 | y = 3.14 23 | 24 | # strings 25 | z = "Hello, world!" 26 | 27 | # booleans 28 | a = true 29 | b = false 30 | ``` 31 | 32 | ## Operators 33 | 34 | Julia supports a variety of operators, including arithmetic, comparison, and logical operators. 35 | 36 | ```julia 37 | # arithmetic operators 38 | x = 3 + 4 # 7 39 | y = 3 - 4 # -1 40 | z = 3 * 4 # 12 41 | w = 3 / 4 # 0.75 42 | 43 | # comparison operators 44 | a = 3 == 4 # false 45 | b = 3 != 4 # true 46 | c = 3 < 4 # true 47 | d = 3 > 4 # false 48 | 49 | # logical operators 50 | e = true && false # false 51 | f = true || false # true 52 | ``` 53 | 54 | ## Control Flow 55 | 56 | Julia supports a variety of control flow statements, including `if`-`else` and `for` loops. 57 | 58 | ```julia 59 | # if-else statement 60 | x = 3 61 | if x > 0 62 | println("x is positive") 63 | else 64 | println("x is non-positive") 65 | 66 | # for loop 67 | for i in 1:5 68 | println(i) 69 | ``` 70 | 71 | ## Functions 72 | 73 | In Julia, functions are defined using the `function` keyword. 74 | 75 | ```julia 76 | function add(x, y) 77 | x + y 78 | end 79 | 80 | add(3, 4) # 7 81 | ``` 82 | 83 | ## Types 84 | 85 | Julia is a dynamically-typed language, but it also supports user-defined types. 86 | 87 | ```julia 88 | # defining a type 89 | type Person 90 | name::String 91 | age::Int 92 | end 93 | 94 | # creating an instance of a type 95 | p = Person("John Doe", 30) 96 | ``` 97 | 98 | ## Arrays 99 | 100 | In Julia, arrays are created using the `[]` syntax. 101 | 102 | ```julia 103 | a = [1, 2, 3, 4] 104 | a[1] # 1 105 | ``` 106 | 107 | ## Dictionaries 108 | 109 | In Julia, dictionaries are created using the `Dict` type. 110 | 111 | ```julia 112 | d = Dict("a" => 1, "b" => 2) 113 | d["a"] # 1 114 | ``` 115 | 116 | -------------------------------------------------------------------------------- /programming_languages/lisp.md: -------------------------------------------------------------------------------- 1 | # Lisp Programming Language 2 | 3 | Lisp is a family of programming languages that have been used in many applications over the years. It was originally developed in the late 1950s as a mathematical notation for computer programs and has since evolved into a general-purpose programming language. The latest stable version of Lisp is Common Lisp 21.2, released in December 2021. 4 | 5 | ## Variables 6 | 7 | ```lisp 8 | (defvar variable value) ; Define a variable 9 | (setf variable value) ; Set the value of a variable 10 | (setq variable value) ; Set the value of a variable 11 | ``` 12 | 13 | ## Data Types 14 | 15 | ```lisp 16 | ;; Numbers 17 | 1 18 | 1.0 19 | #b101 ; binary 20 | #c(1 2) ; complex 21 | 22 | ;; Strings 23 | "hello, world!" 24 | 25 | ;; Characters 26 | #\a 27 | 28 | ;; Lists 29 | '(1 2 3) 30 | (list 1 2 3) 31 | 32 | ;; Arrays 33 | (make-array '(2 2) :initial-element 0) 34 | ``` 35 | 36 | ## Control Structures 37 | 38 | ```lisp 39 | ;; Conditionals 40 | (if test-form then-form [else-form]) 41 | (cond [test-form then-form] ...) 42 | 43 | ;; Loops 44 | (dotimes (var count) body) 45 | (dolist (var list) body) 46 | (loop for var in list [for var2 in list2] [while condition] do body) 47 | ``` 48 | 49 | ## Functions 50 | 51 | ```lisp 52 | (defun name (args) body) ; Define a function 53 | (funcall function args) ; Call a function with arguments 54 | (apply function args) ; Call a function with a list of arguments 55 | (lambda (args) body) ; Create an anonymous function 56 | ``` 57 | 58 | ## Objects 59 | 60 | ```lisp 61 | (defclass class-name [superclass-name] (slot-definition ...)) 62 | (make-instance class-name :slot-name value) 63 | (slot-value object slot-name) 64 | (setf (slot-value object slot-name) value) 65 | ``` 66 | 67 | ## File I/O 68 | 69 | ```lisp 70 | (with-open-file (var file-name :direction :input) body) 71 | (with-open-file (var file-name :direction :output) body) 72 | (write-line string file) 73 | (format stream format-string &rest args) 74 | ``` 75 | 76 | ## Error Handling 77 | 78 | ```lisp 79 | (catch 'tag body) 80 | (throw 'tag result) 81 | (handler-bind ((condition-type handler-function)) body) 82 | (ignore-errors body) 83 | ``` 84 | 85 | For more information on Lisp programming, please refer to the [Common Lisp Hyperspec](http://www.lispworks.com/documentation/HyperSpec/Front/index.htm). 86 | -------------------------------------------------------------------------------- /programming_languages/r.md: -------------------------------------------------------------------------------- 1 | # R 2 | 3 | R is a programming language and software environment for statistical computing and graphics. It is widely used for data analysis, visualization, and predictive modeling. 4 | 5 | ## Vectors 6 | 7 | Vectors are one-dimensional arrays of data in R. 8 | 9 | ```r 10 | # Create a vector 11 | vector1 <- c(1, 2, 3, 4) 12 | 13 | # Access elements of a vector 14 | vector1[2] # returns 2 15 | 16 | # Perform operations on a vector 17 | sum(vector1) # returns 10 18 | mean(vector1) # returns 2.5 19 | ``` 20 | 21 | ### Matrices 22 | 23 | Matrices are two-dimensional arrays of data in R. 24 | 25 | ```r 26 | # Create a matrix 27 | matrix1 <- matrix(1:6, ncol = 2) 28 | 29 | # Access elements of a matrix 30 | matrix1[2, 2] # returns 4 31 | 32 | # Perform operations on a matrix 33 | colSums(matrix1) # returns the sum of each column 34 | rowMeans(matrix1) # returns the mean of each row 35 | ``` 36 | 37 | ### Data Frames 38 | 39 | Data frames are two-dimensional arrays with named columns, similar to tables in a relational database. 40 | 41 | ```r 42 | # Create a data frame 43 | data.frame1 <- data.frame(Name = c('John', 'Jane', 'Jim'), 44 | Age = c(30, 28, 35), 45 | Gender = c('Male', 'Female', 'Male')) 46 | 47 | # Access elements of a data frame 48 | data.frame1$Name # returns the Name column 49 | 50 | # Perform operations on a data frame 51 | aggregate(Age ~ Gender, data = data.frame1, mean) # returns the mean Age by Gender 52 | ``` 53 | 54 | ### Plotting 55 | 56 | R has a wide range of plotting capabilities, including scatter plots, bar charts, line charts, and more. 57 | 58 | ```r 59 | # Scatter plot 60 | plot(data.frame1$Age, data.frame1$Gender) 61 | 62 | # Bar chart 63 | barplot(table(data.frame1$Gender)) 64 | 65 | # Line chart 66 | lines(data.frame1$Age, data.frame1$Gender) 67 | ``` 68 | -------------------------------------------------------------------------------- /programming_languages/ruby.md: -------------------------------------------------------------------------------- 1 | # Ruby Cheatsheet 2 | 3 | Ruby is a dynamic, object-oriented, general-purpose programming language. It was created in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. 4 | 5 | ## Variables 6 | 7 | In Ruby, variables do not need to be declared before they are used. You simply assign a value to a variable with the `=` operator. 8 | 9 | ```ruby 10 | name = "John Doe" 11 | puts name 12 | ``` 13 | 14 | ## Arrays 15 | 16 | An array is an ordered collection of objects. In Ruby, you can create an array using square brackets `[]`. 17 | 18 | ```ruby 19 | names = ["John", "Jane", "Jim"] 20 | puts names[0] # prints "John" 21 | ``` 22 | 23 | ## Hashes 24 | 25 | A hash is similar to an array, but instead of accessing elements with an index, you access them with a key. 26 | 27 | ```ruby 28 | person = { "name" => "John Doe", "age" => 30 } 29 | puts person["name"] # prints "John Doe" 30 | ``` 31 | 32 | ## Control Flow 33 | 34 | ### If/Else 35 | 36 | ```ruby 37 | age = 20 38 | if age >= 18 39 | puts "You are an adult" 40 | else 41 | puts "You are a minor" 42 | end 43 | ``` 44 | 45 | ### Loops 46 | 47 | #### For Loop 48 | 49 | ```ruby 50 | for i in 0..9 51 | puts i 52 | end 53 | ``` 54 | 55 | #### While Loop 56 | 57 | ```ruby 58 | counter = 0 59 | while counter < 10 60 | puts counter 61 | counter += 1 62 | end 63 | ``` 64 | 65 | ## Methods 66 | 67 | Methods are blocks of code that can be called multiple times with different arguments. In Ruby, you define a method using the `def` keyword. 68 | 69 | ```ruby 70 | def say_hello(name) 71 | puts "Hello, #{name}!" 72 | end 73 | 74 | say_hello("John") 75 | ``` 76 | 77 | ## Classes and Objects 78 | 79 | In Ruby, everything is an object, and classes are used to create new objects. 80 | 81 | ```ruby 82 | class Person 83 | def initialize(name, age) 84 | @name = name 85 | @age = age 86 | end 87 | 88 | def say_hello 89 | puts "Hello, my name is #{@name} and I am #{@age} years old." 90 | end 91 | end 92 | 93 | person = Person.new("John Doe", 30) 94 | person.say_hello 95 | ``` 96 | -------------------------------------------------------------------------------- /programming_languages/scala.md: -------------------------------------------------------------------------------- 1 | # Scala Cheatsheet (2.13.4 LTS) 2 | 3 | ## Basic Data Types 4 | 5 | - Integer: `val x: Int = 5` 6 | - Long: `val x: Long = 5L` 7 | - Double: `val x: Double = 5.0` 8 | - Float: `val x: Float = 5.0f` 9 | - String: `val x: String = "Hello, Scala!"` 10 | - Boolean: `val x: Boolean = true` 11 | - Char: `val x: Char = 'a'` 12 | 13 | ## Variables 14 | 15 | - Immutable variable: `val x = 5` 16 | - Mutable variable: `var x = 5` 17 | 18 | ## Functions 19 | 20 | - Define function: 21 | 22 | ```java 23 | def add(x: Int, y: Int): Int = { 24 | x + y 25 | } 26 | ``` 27 | 28 | - Call function: `add(5, 6)` 29 | - Anonymous function (lambda): `(x: Int, y: Int) => x + y` 30 | 31 | ## Control Structures 32 | 33 | - If-else statement: 34 | 35 | ```java 36 | if (x > 5) { 37 | println("x is greater than 5") 38 | } else { 39 | println("x is less than or equal to 5") 40 | } 41 | ``` 42 | 43 | - For loop: 44 | 45 | ```java 46 | for (i <- 1 to 5) { 47 | println(i) 48 | } 49 | ``` 50 | 51 | - While loop: 52 | 53 | ```java 54 | var i = 1 55 | while (i <= 5) { 56 | println(i) 57 | i = i + 1 58 | } 59 | ``` 60 | 61 | ## Arrays 62 | 63 | - Define array: `val x = Array(1, 2, 3, 4, 5)` 64 | - Access array elements: `x(0)` 65 | 66 | ## Collections 67 | 68 | - List: `val x = List(1, 2, 3, 4, 5)` 69 | - Set: `val x = Set(1, 2, 3, 4, 5)` 70 | - Map: `val x = Map("one" -> 1, "two" -> 2, "three" -> 3)` 71 | 72 | ## Classes 73 | 74 | - Define class: 75 | 76 | ```java 77 | class Person { 78 | val name: String = "John Doe" 79 | var age: Int = 30 80 | } 81 | ``` 82 | 83 | - Create object: `val p = new Person` 84 | - Access object properties: `p.name` 85 | - Define constructor: 86 | 87 | ```java 88 | class Person(val name: String, var age: Int) 89 | ``` 90 | 91 | ## Traits 92 | 93 | - Define trait: 94 | 95 | ```java 96 | trait Greeter { 97 | def greet(name: String): Unit = { 98 | println(s"Hello, $name") 99 | } 100 | } 101 | ``` 102 | 103 | - Use trait: 104 | 105 | ```java 106 | class Person extends Greeter 107 | ``` 108 | 109 | ## Official Documentation 110 | 111 | - [Scala Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/) 112 | - [Scala Standard Library](https://www.scala-lang.org/api/2.13.4/) 113 | -------------------------------------------------------------------------------- /programming_languages/shell/powershell.md: -------------------------------------------------------------------------------- 1 | # PowerShell (7.2.0) 2 | 3 | PowerShell is a task-based command-line shell and scripting language built on .NET. It helps to automate administrative tasks and manage different components of Windows operating systems. 4 | 5 | ## Variables 6 | 7 | Variables in PowerShell are declared using the `$` symbol. 8 | 9 | ```powershell 10 | $x = 10 11 | $y = 20 12 | $z = $x + $y 13 | Write-Output $z 14 | ``` 15 | 16 | ## Loops 17 | 18 | PowerShell has several ways to write loops. 19 | 20 | ### For Loop 21 | 22 | A for loop can be written using the `For` keyword. 23 | 24 | ```powershell 25 | For ($i = 0; $i -lt 10; $i++) { 26 | Write-Output $i 27 | } 28 | ``` 29 | 30 | ### Foreach Loop 31 | 32 | A foreach loop can be written using the `Foreach` keyword. 33 | 34 | ```powershell 35 | $numbers = 1,2,3,4,5 36 | Foreach ($number in $numbers) { 37 | Write-Output $number 38 | } 39 | ``` 40 | 41 | ## Functions 42 | 43 | Functions in PowerShell are declared using the `Function` keyword. 44 | 45 | ```powershell 46 | Function Square($x) { 47 | return $x * $x 48 | } 49 | Write-Output (Square 10) 50 | ``` 51 | -------------------------------------------------------------------------------- /programming_languages/typescript.md: -------------------------------------------------------------------------------- 1 | # TypeScript 2 | 3 | TypeScript is a statically typed, object-oriented programming language that builds on top of JavaScript. It is designed to provide optional type annotations and increased code maintainability, scalability, and readability. 4 | 5 | ## Basic Types 6 | 7 | TypeScript supports the following basic types: 8 | 9 | ```typescript 10 | let name: string = 'John Doe'; 11 | let age: number = 30; 12 | let isMarried: boolean = true; 13 | let children: string[] = ['Jane', 'John']; 14 | let person: [string, number, boolean] = ['John Doe', 30, true]; 15 | ``` 16 | 17 | ### Interfaces 18 | 19 | Interfaces define the structure of objects and are used to enforce type contracts. 20 | 21 | ```typescript 22 | interface Person { 23 | name: string; 24 | age: number; 25 | } 26 | 27 | let john: Person = { 28 | name: 'John Doe', 29 | age: 30 30 | }; 31 | ``` 32 | 33 | ### Classes 34 | 35 | Classes are used to create objects and enforce object-oriented programming principles. 36 | 37 | ```typescript 38 | class Person { 39 | name: string; 40 | age: number; 41 | 42 | constructor(name: string, age: number) { 43 | this.name = name; 44 | this.age = age; 45 | } 46 | } 47 | 48 | let john = new Person('John Doe', 30); 49 | ``` 50 | 51 | ### Functions 52 | 53 | Functions are used to execute blocks of code. 54 | 55 | ```typescript 56 | function greet(name: string): void { 57 | console.log(`Hello, ${name}!`); 58 | } 59 | 60 | greet('John Doe'); 61 | ``` 62 | 63 | ### Generics 64 | 65 | Generics allow functions, classes, and interfaces to accept a variety of types, rather than being limited to a specific type. 66 | 67 | ```typescript 68 | function identity(arg: T): T { 69 | return arg; 70 | } 71 | 72 | let output = identity('Hello, world!'); 73 | ``` 74 | -------------------------------------------------------------------------------- /programming_languages/v.md: -------------------------------------------------------------------------------- 1 | # V (0.2.2) 2 | 3 | V is a statically-typed, interpreted language designed to improve the developer experience and make programming more accessible and enjoyable. It aims to provide a clean, efficient, and fast syntax, while still being simple to understand. 4 | 5 | ## Variables 6 | 7 | In V, variables are declared using the `let` keyword, followed by the variable name and value. The type of the variable can be explicitly specified using a colon `:` and the type name. If no type is specified, V will infer the type from the value assigned to the variable. 8 | 9 | ```go 10 | let x = 10 11 | let y: f64 = 3.14 12 | let name = "John" 13 | ``` 14 | 15 | ## Functions 16 | 17 | Functions in V are declared using the `fn` keyword, followed by the function name, arguments, and the code block. Arguments are specified within parenthesis `()`, and the code block is enclosed within curly braces `{}`. The return type of a function can be specified using an arrow `->` and the type name. 18 | 19 | ```go 20 | fn add(x: i32, y: i32) -> i32 { 21 | return x + y 22 | } 23 | 24 | let result = add(10, 20) 25 | ``` 26 | 27 | ## Control Flow 28 | 29 | V provides several control flow constructs for making decisions and repeating actions in code. 30 | 31 | ### If/Else 32 | 33 | The `if` statement is used to evaluate a boolean expression and execute a block of code if the expression is true. An optional `else` clause can be used to specify alternative code to be executed if the expression is false. 34 | 35 | ```go 36 | let x = 10 37 | 38 | if x > 5 { 39 | println("x is greater than 5") 40 | } else { 41 | println("x is less than or equal to 5") 42 | } 43 | ``` 44 | 45 | ### Loop 46 | 47 | V provides two types of loops: `for` and `while`. The `for` loop is used to repeat a block of code a specific number of times, while the `while` loop is used to repeat a block of code as long as a condition is true. 48 | 49 | ```go 50 | for i in 0..10 { 51 | println(i) 52 | } 53 | 54 | let x = 10 55 | while x > 0 { 56 | println(x) 57 | x -= 1 58 | } 59 | ``` 60 | 61 | ## Modules 62 | 63 | Modules in V are used to group related functions and data together. A module is defined in a separate file with the `.v` extension, and can be imported into other files using the `import` keyword. 64 | 65 | ```go 66 | // my_module.v 67 | 68 | fn add(x: i32, y: i32) -> i32 { 69 | return x + y 70 | } 71 | 72 | // main.v 73 | 74 | import my_module 75 | 76 | let result = my_module.add(10, 20) 77 | ``` -------------------------------------------------------------------------------- /programming_languages/web_technologies/json.md: -------------------------------------------------------------------------------- 1 | # JSON Cheatsheet 2 | 3 | JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. 4 | 5 | ## JSON Syntax 6 | 7 | A JSON object is a key-value data format that is typically rendered in curly braces. A JSON object contains keys, which are strings, and values, which can be any of the following data types: 8 | 9 | - String 10 | - Number 11 | - Object 12 | - Array 13 | - Boolean 14 | - Null 15 | 16 | Here's a simple example of a JSON object: 17 | 18 | ```json 19 | { 20 | "name": "John Doe", 21 | "age": 30, 22 | "address": { 23 | "street": "123 Main St.", 24 | "city": "Anytown", 25 | "state": "CA" 26 | }, 27 | "isEmployed": true 28 | } 29 | ``` 30 | 31 | A JSON array is a list of values that are separated by commas and enclosed in square brackets. Here's an example of a JSON array: 32 | 33 | ```json 34 | ["apple", "banana", "cherry"] 35 | ``` 36 | 37 | ## Parsing and Stringifying JSON 38 | 39 | To parse a JSON string and convert it into a JavaScript object, you can use the `JSON.parse` method: 40 | 41 | ```javascript 42 | const jsonString = '{"name":"John Doe","age":30}'; 43 | const object = JSON.parse(jsonString); 44 | console.log(object.name); // "John Doe" 45 | ``` 46 | 47 | To convert a JavaScript object into a JSON string, you can use the `JSON.stringify` method: 48 | 49 | ```javascript 50 | const object = { name: "John Doe", age: 30 }; 51 | const jsonString = JSON.stringify(object); 52 | console.log(jsonString); // '{"name":"John Doe","age":30}' 53 | ``` 54 | 55 | ## Common Use Cases 56 | 57 | JSON is commonly used as a data exchange format between the server and client in web applications. It's also used as a configuration file format in many modern technologies, such as Node.js and npm. 58 | 59 | Here are a few other common use cases for JSON: 60 | 61 | - Storing and exchanging data in a structured manner between systems. 62 | - Generating dynamic data for websites using JavaScript and AJAX. 63 | - Persisting data in NoSQL databases, such as MongoDB and CouchDB. 64 | 65 | ## Resources 66 | 67 | Here are some resources for learning more about JSON: 68 | 69 | - [JSON.org](http://json.org) - The official website for JSON. 70 | - [JSON on MDN](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON) - A comprehensive guide to JSON on the Mozilla Developer Network. 71 | - [JSON on W3Schools](https://www.w3schools.com/js/js_json_intro.asp) - A beginner-friendly guide to JSON on W3Schools. 72 | -------------------------------------------------------------------------------- /programming_languages/web_technologies/svg.md: -------------------------------------------------------------------------------- 1 | # SVG Cheat Sheet 2 | 3 | Scalable Vector Graphics (SVG) is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. Here are some basic concepts and elements of SVG. 4 | 5 | ## SVG Elements 6 | 7 | - ``: Defines the root of the SVG document, which contains the graphic content. 8 | 9 | - ``: Draws a rectangle. 10 | 11 | - ``: Draws a circle. 12 | 13 | - ``: Draws an ellipse. 14 | 15 | - ``: Draws a line. 16 | 17 | - ``: Draws a series of connected lines. 18 | 19 | - ``: Draws a series of connected lines and closes the shape by connecting the last point to the first. 20 | 21 | - ``: Draws a path using a series of commands, such as lines, arcs, and curves. 22 | 23 | ## Coordinate System 24 | 25 | SVG uses a coordinate system where (0, 0) is the top-left corner and the positive x-axis goes to the right, while the positive y-axis goes down. By default, the unit of measurement is the pixel. 26 | 27 | ## Colors and Styling 28 | 29 | SVG supports various color models, including RGB, HSL, and CMYK. Colors can be defined in CSS, inline styles, or presentation attributes. 30 | 31 | ## Animation and Interactivity 32 | 33 | SVG supports animation and interactivity through scripting (JavaScript) and declarative animation (SMIL). 34 | 35 | ## Example 36 | 37 | Here is a simple example of an SVG that draws a red circle with a diameter of 50 pixels: 38 | 39 | ```xml 40 | 41 | 42 | 43 | ``` 44 | 45 | ## Conclusion 46 | 47 | This cheat sheet provided an overview of the basic concepts and elements of Scalable Vector Graphics (SVG). To learn more, it is recommended to visit the [W3C SVG specification](https://www.w3.org/TR/SVG11/) and the [MDN web docs.](https://developer.mozilla.org/en-US/docs/Web/SVG) 48 | -------------------------------------------------------------------------------- /programming_languages/web_technologies/xml.md: -------------------------------------------------------------------------------- 1 | # XML Cheat Sheet 2 | 3 | eXtensible Markup Language (XML) is a markup language that provides a format for encoding and exchanging structured data. Here are some basic concepts and elements of XML. 4 | 5 | ## Document Structure 6 | 7 | An XML document has a root element and can contain other elements, attributes, and text. The root element is defined as follows: 8 | 9 | ```xml 10 | 11 | 12 | 13 | ``` 14 | 15 | ## Elements 16 | 17 | An XML element is defined by a start tag, an end tag, and the content between them: 18 | 19 | ```xml 20 | Content 21 | ``` 22 | 23 | An empty element can be defined as follows: 24 | 25 | ```xml 26 | 27 | ``` 28 | 29 | ## Attributes 30 | 31 | An attribute provides additional information about an element and is defined within the start tag of an element: 32 | 33 | ```xml 34 | Content 35 | ``` 36 | 37 | ## Namespaces 38 | 39 | A namespace is a collection of element and attribute names that are used to avoid naming conflicts in an XML document. A namespace is declared using the xmlns attribute: 40 | 41 | ```xml 42 | 43 | 44 | 45 | ``` 46 | 47 | Validation 48 | 49 | An XML document can be validated against a schema, which defines the structure, elements, and attributes that are allowed in the document. The most common schema languages for XML are XML Schema (XSD) and RelaxNG. 50 | 51 | ## Example 52 | 53 | Here is a simple example of an XML document that describes a book: 54 | 55 | ```xml 56 | 57 | The Great Gatsby 58 | F. Scott Fitzgerald 59 | 1925 60 | 61 | ``` 62 | 63 | ## Conclusion 64 | 65 | This cheat sheet provided an overview of the basic concepts and elements of eXtensible Markup Language (XML). To learn more, it is recommended to visit the [W3C XML specification](https://www.w3.org/TR/xml/) and the [MDN web docs.](https://developer.mozilla.org/en-US/docs/Web/XML) 66 | -------------------------------------------------------------------------------- /programming_languages/yaml.md: -------------------------------------------------------------------------------- 1 | # YAML Cheatsheet 2 | 3 | ## Introduction 4 | 5 | YAML (short for "YAML Ain't Markup Language") is a human-friendly data serialization standard for all programming languages. It is a popular choice for configuration files, data storage, and data exchange formats. 6 | 7 | ## Basic Syntax 8 | 9 | - YAML uses whitespace to indicate the structure of data. 10 | - The number of spaces before each line determines the hierarchy of data. 11 | - Key-value pairs are separated by a colon (:) 12 | - Strings can be wrapped in single quotes (') or double quotes (") 13 | - Lists are indicated by a hyphen (-) 14 | - Multiline strings are indicated by using the `|` character 15 | 16 | ## Key-Value Pairs 17 | 18 | The basic structure of YAML consists of key-value pairs. 19 | 20 | ```yaml 21 | key: value 22 | ``` 23 | 24 | ## Lists 25 | 26 | Lists are indicated by a hyphen (-) and are used to represent an ordered collection of items. 27 | 28 | ```yaml 29 | - item1 30 | - item2 31 | - item3 32 | ``` 33 | 34 | ## Multi-line Strings 35 | 36 | Multi-line strings are indicated by using the `|` character. 37 | 38 | ```yaml 39 | multiline_string: | 40 | This is line 1 41 | This is line 2 42 | This is line 3 43 | ``` 44 | 45 | ## Indentation 46 | 47 | Indentation is important in YAML, as it determines the hierarchy of data. 48 | 49 | ```yaml 50 | parent: 51 | child1: value1 52 | child2: value2 53 | ``` 54 | 55 | ## Resources 56 | 57 | - [Official YAML Website](https://yaml.org/) 58 | - [YAML 1.2 Specification](https://yaml.org/spec/1.2/spec.html) 59 | - [YAML Examples](https://yaml.org/start.html) 60 | -------------------------------------------------------------------------------- /security/tools/aircrack-ng.md: -------------------------------------------------------------------------------- 1 | # Aircrack-ng (1.7) 2 | 3 | Aircrack-ng is a suite of tools to assess Wi-Fi network security. It works by capturing and analyzing packets of data sent and received over a wireless network. 4 | 5 | ## Scanning for Networks 6 | 7 | To scan for available Wi-Fi networks, use the following command: 8 | 9 | ```bash 10 | airodump-ng wlan0 11 | ``` 12 | 13 | Replace `wlan0` with the name of your wireless interface. 14 | 15 | ## Capturing Packets 16 | 17 | To capture packets from a specific network, use the following command: 18 | 19 | ```bash 20 | airodump-ng -c --bssid -w wlan0 21 | ``` 22 | 23 | Replace `` with the channel number of the network, `` with the BSSID (MAC address) of the access point, `` with a desired name for the output file, and `wlan0` with the name of your wireless interface. 24 | 25 | ## Cracking Passwords 26 | 27 | To crack the password of a WPA/WPA2 network, use the following command: 28 | 29 | ```bash 30 | aircrack-ng .cap -w 31 | ``` 32 | 33 | Replace `` with the name of the captured packets file and `` with the path to a wordlist file containing possible passwords. 34 | -------------------------------------------------------------------------------- /security/tools/ettercap.md: -------------------------------------------------------------------------------- 1 | # Ettercap Cheatsheet 2 | 3 | Ettercap is a network security tool that allows users to monitor and analyze network traffic, as well as perform man-in-the-middle attacks. This cheatsheet provides a quick reference guide for using Ettercap. 4 | 5 | ## Installation 6 | 7 | Ettercap can be installed on Linux-based operating systems using the following command: 8 | 9 | ```bash 10 | sudo apt-get install ettercap-graphical 11 | ``` 12 | 13 | ## Starting Ettercap 14 | 15 | Ettercap can be started with the following command: 16 | 17 | ```bash 18 | sudo ettercap -G 19 | ``` 20 | 21 | ## Capturing Packets 22 | 23 | To capture packets on a specific network interface, use the following command: 24 | 25 | ```bash 26 | sudo ettercap -T 27 | ``` 28 | 29 | ## Sniffing Passwords 30 | 31 | To sniff passwords on a network, use the following command: 32 | 33 | ```bash 34 | sudo ettercap -T -P password_sniffer -i 35 | ``` 36 | 37 | ## ARP Spoofing 38 | 39 | To perform ARP spoofing on a network, use the following command: 40 | 41 | ```bash 42 | sudo ettercap -T -M arp:remote /// /// 43 | ``` 44 | 45 | ## DNS Spoofing 46 | 47 | To perform DNS spoofing on a network, use the following command: 48 | 49 | ```bash 50 | sudo ettercap -T -M dns_spoof /// /// 51 | ``` 52 | 53 | ## Plugins 54 | 55 | Ettercap has various plugins that can be used to extend its functionality. To view the available plugins, use the following command: 56 | 57 | ```bash 58 | ettercap --show-plugins 59 | ``` 60 | 61 | To use a specific plugin, use the following command: 62 | 63 | ```bash 64 | sudo ettercap -T -M /// /// 65 | ``` 66 | 67 | ## Additional Resources 68 | 69 | - [Official Ettercap Website](https://ettercap.github.io/ettercap/) 70 | - [Ettercap User Manual](https://ettercap.github.io/ettercap/downloads/EttercapUserManual.pdf) 71 | - [Ettercap Wiki](https://github.com/Ettercap/ettercap/wiki) 72 | -------------------------------------------------------------------------------- /security/tools/metasploit.md: -------------------------------------------------------------------------------- 1 | # Metasploit Framework 2 | 3 | Metasploit is a free and open-source framework that is widely used by security professionals, researchers, and penetration testers for developing and executing exploits to identify and fix vulnerabilities in computer systems. However, it is important to use Metasploit responsibly and ethically, as it can also be used for malicious purposes. 4 | 5 | ## Basic Usage 6 | 7 | 1. Start Metasploit by opening a terminal window and typing the following command: 8 | 9 | ```bash 10 | msfconsole 11 | ``` 12 | 13 | 2. Once Metasploit is started, use the `help` command to display a list of available commands. 14 | 15 | ```bash 16 | help 17 | ``` 18 | 19 | 3. Use the `search` command to find an exploit module. 20 | 21 | ```bash 22 | search 23 | ``` 24 | 25 | 4. Once you have found an exploit, use the `use` command to select it. 26 | 27 | ```bash 28 | use 29 | ``` 30 | 31 | 5. Use the `show options` command to display the required options for the selected exploit. 32 | 33 | ```bash 34 | show options 35 | ``` 36 | 37 | 6. Set the required options using the `set` command. 38 | 39 | ```bash 40 | set