This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$books = [ | |
[ | |
'name' => 'Earth 1', | |
'author' => 'Andrew', | |
'pubDate' => '2024-03-08' | |
], | |
[ | |
'name' => 'Earth 3', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. (optional) install some php version: sudo apt -y install php7.4 | |
2. switch php version: sudo update-alternatives --config php | |
2.1. disable current version: sudo a2dismod php7.1 | |
2.2. enable version: sudo a2enmod php7.4 | |
3. restart apache sudo systemctl restart apache2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE CUSTOM NETWROK | |
docker network create wordpress | |
# START MYSQL | |
docker run \ | |
--network wordpress \ | |
-e MYSQL_ROOT_PASSWORD=hotch \ | |
-e MYSQL_DATABASE=sample \ | |
-e MYSQL_USER=mario \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXAMPLE > DEFAULT BRIDGE NETWORK | |
START MYSQL WITH CUSTOM ROOT PASSWORD | |
docker run -e MYSQL_ROOT_PASSWORD=hotch mysql | |
START MYSQL CLIENT | |
docker exec -it <CONTAINER_ID> bash | |
GET MYSQL ROOT PASSWORD | |
docker exec <CONTAINER_ID> env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Algoritmo sin_titulo | |
T = 10 | |
Dimension arreglo[T] | |
arreglo[0] <- 100 | |
arreglo[1] <- 20 | |
arreglo[2] <- 5 | |
arreglo[3] <- 1 | |
arreglo[4] <- 16 | |
arreglo[5] <- 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Algoritmo ordenamiento_por_insercion | |
T = 10 | |
Dimension arreglo[T] | |
arreglo[0] <- 100 | |
arreglo[1] <- 20 | |
arreglo[2] <- 5 | |
arreglo[3] <- 1 | |
arreglo[4] <- 16 | |
arreglo[5] <- 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<style> | |
.main { | |
display: flex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
printf("char size: %lu bytes\n", sizeof(char)); | |
printf("int size: %lu bytes\n", sizeof(int)); | |
printf("short size: %lu bytes\n", sizeof(short)); | |
printf("long size: %lu bytes\n", sizeof(long)); | |
printf("float size: %lu bytes\n", sizeof(float)); | |
printf("double size: %lu bytes\n", sizeof(double)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add docker format to environment | |
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED{{.CreatedAt}}\nSTATUS\t{{.Status}}\n" | |
# list docker containers pretty formatted | |
docker ps --format=$FORMAT |
NewerOlder