Skip to content

Instantly share code, notes, and snippets.

View josejuansanchez's full-sized avatar

José Juan Sánchez josejuansanchez

View GitHub Profile
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This file has been truncated, but you can view the full file.
-- Sakila Sample Database Schema
-- Version 1.0
-- Copyright (c) 2006, 2015, Oracle and/or its affiliates.
-- All rights reserved.
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice,
-- Sakila Sample Database Schema
-- Version 1.0
-- Copyright (c) 2006, 2015, Oracle and/or its affiliates.
-- All rights reserved.
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice,
http://api.openweathermap.org/data/2.5/weather?q=Almeria&APPID=2e1771d6989168058859fdd4b1b30d89
FROM ubuntu
LABEL title="soldat" \
author="José Juan Sánchez"
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y libc6:i386 \
&& apt-get install -y libstdc++6:i386 \
&& apt-get install -y wget \
@josejuansanchez
josejuansanchez / cambiar_rol_admin_moodle_mysql.md
Created September 17, 2018 17:15
Cómo asignar el rol de administrador a un usuario en Moodle desde MySQL

Paso 1

Obtenemos el id del usuario al que queremos actualizar su rol. Suponemos que el username del usuario es pepe.

SELECT id FROM mdl_user WHERE username LIKE '%pepe%'

Salida:

@josejuansanchez
josejuansanchez / tienda.sql
Last active May 21, 2019 17:51
Base de datos de prueba para el proyecto de IAW
DROP DATABASE IF EXISTS tienda;
CREATE DATABASE tienda CHARACTER SET utf8mb4;
USE tienda;
CREATE TABLE usuario (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(50) NOT NULL UNIQUE,
password VARCHAR(128) NOT NULL,
nombre VARCHAR(128) NOT NULL
);
@josejuansanchez
josejuansanchez / universidad_a.sql
Last active May 5, 2025 15:19
Script SQL para crear la base de datos `universidad` (Tipo A) utilizada en los ejercicios de clase. http://josejuansanchez.org/bd/
DROP DATABASE IF EXISTS universidad;
CREATE DATABASE universidad CHARACTER SET utf8mb4;
USE universidad;
CREATE TABLE departamento (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(50) NOT NULL
);
CREATE TABLE persona (
@josejuansanchez
josejuansanchez / jardineria.sql
Last active October 28, 2025 22:57
Script SQL para crear la base de datos `jardineria` que aparece en el libro Bases de Datos de Iván López Montalbán.
DROP DATABASE IF EXISTS jardineria;
CREATE DATABASE jardineria CHARACTER SET utf8mb4;
USE jardineria;
CREATE TABLE oficina (
codigo_oficina VARCHAR(10) NOT NULL,
ciudad VARCHAR(30) NOT NULL,
pais VARCHAR(50) NOT NULL,
region VARCHAR(50) DEFAULT NULL,
codigo_postal VARCHAR(10) NOT NULL,
#!/bin/bash
# Credenciales de Telegram
TOKEN=""
CHATID=""
# API de Telegram
URL="https://api.telegram.org/bot$TOKEN/sendMessage"