Skip to content

Instantly share code, notes, and snippets.

View adriasir123's full-sized avatar
👽

Adrián Jaramillo Rodríguez adriasir123

👽
View GitHub Profile
@adriasir123
adriasir123 / gist:f96108d2e2523856ee29b907f3df4962
Last active July 16, 2023 15:13
Recopilación de blogs de prácticas de antiguos alumnos del IES Gonzalo Nazareno
https://www.jonathanmarquez.com
https://www.celiagm.es
https://ernestovazquez.es
https://franmadu6.github.io
https://franjavimn.onrender.com
https://sysadblog.onrender.com
https://jpcarmona.github.io
https://adrianjimenezb.wordpress.com
@adriasir123
adriasir123 / scott-mariadb.sql
Created January 24, 2023 22:51
Oracle SCOTT schema for MariaDB
-- MySQL equivalent of Oracle SCOTT default schema.
-- (datatypes are different but should generally be equivalent)
--
-- Oracle database installations reportedly have included a default
-- schema called SCOTT, accessed by user "scott" with password "tiger".
-- Wikipedia reports the SCOTT schema originated with Bruce Scott, one
-- of the first employees at Oracle (then Software Development
-- Laboratories), who had a cat named Tiger.
--
-- (1) Wikipedia contributors, "Oracle Database," Wikipedia, The Free
@adriasir123
adriasir123 / gist:51f018d18d794f9d66db8c72aa6a7134
Created January 21, 2023 00:59
Output de `SELECT role FROM DBA_ROLES;`
ROLE
--------------------------------------------------------------------------------------------------------------------------------
CONNECT
RESOURCE
DBA
PDB_DBA
AUDIT_ADMIN
AUDIT_VIEWER
SELECT_CATALOG_ROLE
EXECUTE_CATALOG_ROLE
@adriasir123
adriasir123 / script-examen-bd-3-4.sql
Last active January 11, 2023 07:58
Script para la generación de tablas y poblado de datos usado en el exámen de base de datos de las prácticas 3 y 4
CREATE TABLE ALUMNOS
(
DNI VARCHAR2(10) NOT NULL,
APENOM VARCHAR2(36),
DIREC VARCHAR2(30),
POBLA VARCHAR2(15),
TELEF VARCHAR2(10)
);
@adriasir123
adriasir123 / gran-hipodromo-postgres.sql
Last active December 23, 2022 01:27
Creación de tablas y carga de datos del proyecto "Gran Hipódromo" para PostgreSQL
create table caballosCarreras
(
codigoCaballo integer,
peso numeric(6,2),
nacionalidad varchar(30),
constraint pk_caballosCarreras primary key(codigoCaballo)
);
create table instalacionesCuadras
@adriasir123
adriasir123 / gran-hipodromo-oracle.sql
Last active December 14, 2022 05:03
Creación de tablas y carga de datos del proyecto "Gran Hipódromo" para Oracle
create table caballosCarreras
(
codigoCaballo number(3),
peso number(6,2),
nacionalidad varchar2(30),
constraint pk_caballosCarreras primary key(codigoCaballo)
);
create table instalacionesCuadras
(
@adriasir123
adriasir123 / gist:4b68f6910cdcbca08ab7556c14f06289
Created December 10, 2022 20:29
Output de `EXEC mostrar_privilegios_usuario('SYS');`
El usuario recibido ha sido: SYS
Sus privilegios de sistema son:
ALTER ANY ANALYTIC VIEW
DROP ANY HIERARCHY
LOGMINING
DROP LOCKDOWN PROFILE
INHERIT ANY PRIVILEGES
CREATE ANY MEASURE FOLDER
DROP ANY CUBE
@adriasir123
adriasir123 / scott.sql
Created December 6, 2022 16:17
Oracle SCOTT schema
SET TERMOUT OFF
SET ECHO OFF
GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY tiger;
ALTER USER SCOTT DEFAULT TABLESPACE USERS;
ALTER USER SCOTT TEMPORARY TABLESPACE TEMP;
CONNECT SCOTT/tiger
DROP TABLE DEPT;
CREATE TABLE DEPT
(DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
@adriasir123
adriasir123 / gist:d5f66f5ff99bb9feb69bbd9108a08d9a
Created November 13, 2022 10:12
Compile kernel specifying threads, getting the duration of the execution, and making the speaker notify you with a beep at the end (not the motherboard speaker)
time make -j 12 bindeb-pkg && ( speaker-test -t sine -f 500 )& pid=$! ; sleep 1s ; kill -9 $pid
@adriasir123
adriasir123 / gist:87e695b74b16955a22816e881a78f101
Created November 7, 2022 21:23
List all KVM VMs along with their respective disk files
for i in $(virsh -c qemu:///system list --all | awk "{print \$2}" | tail -n +3); do echo "Discos de $i:\n\n$(virsh -c qemu:///system domblklist $i)\n"; done