Skip to content

Instantly share code, notes, and snippets.

View Javinator9889's full-sized avatar
🏠
Working from home

Javinator9889 Javinator9889

🏠
Working from home
View GitHub Profile
@Javinator9889
Javinator9889 / fm.sh
Created June 8, 2021 15:52
File manager - script based
#!/bin/env bash
# Terminar cuando haya errores
# set -e
# Modo de depuración - se muestran los comandos que se están
# ejecutando
# set -x
# Error si una variable está sin definir
@Javinator9889
Javinator9889 / mp3-player.sh
Created May 25, 2021 16:54
Simple MP3 player using "select" - won't work with files with spaces (must fix)
#!/bin/env bash
# Limpiamos el terminal
clear
# Instalación de la aplicación si no existe
if [[ ! $(command -v mpg321) ]]; then
CORRECT=1
while [[ $CORRECT -ne 0 ]]; do
read -n1 -p "La aplicación \"mpg321\" no está instalada. ¿Instalar? [Y/n] " INSTALL
@Javinator9889
Javinator9889 / cpsh.sh
Created May 25, 2021 11:03
A simple sample script for copying all scripts at the specified location to the specified destination
#!/bin/env bash
# Aplicación para copiar todos los scripts que existan en
# el directorio establecido, indiferentemente de dónde estén, a un
# USB (u otro directorio) que especifiquemos. Si los ficheros
# ya existen, se actualiza si procede. En otro caso, los copia.
# Se buscan scripts con formato .sh
# Comprobaciones de seguridad sobre los parámetros
[[ $# -ne 2 ]] && echo "Usage: $0 SOURCE DESTINATION" && exit 1
@Javinator9889
Javinator9889 / remove-chroot.sh
Last active May 11, 2021 15:48
Scripts for creating/removing a chroot
#!/usr/bin/env bash
# exit on error
set -e
# define tput commands
# background color using ANSI escape
bgBlack=$(tput setab 0) # black
bgRed=$(tput setab 1) # red
@Javinator9889
Javinator9889 / setup-jail-ssh.sh
Last active April 6, 2021 13:53
Setup jail - general script for setting up a chroot jail with SSH support built-in
#!/usr/bin/env bash
# exit on error
set -e
# define tput commands
# background color using ANSI escape
bgBlack=$(tput setab 0) # black
bgRed=$(tput setab 1) # red
#!/usr/bin/env bash
# exit on error
set -e
# define tput commands
# background color using ANSI escape
bgBlack=$(tput setab 0) # black
bgRed=$(tput setab 1) # red
@Javinator9889
Javinator9889 / watcher.py
Created January 23, 2021 10:29
Solución examen PSP (DAM2) | 1ª evaluación | 2020/21
# Exam
# Copyright (C) 2021 - Javinator9889
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@Javinator9889
Javinator9889 / FPGA_VGA.vhd
Created June 13, 2019 16:11 — forked from jgibbard/FPGA_VGA.vhd
VHDL VGA PONG
--VHDL VGA PONG demo
--An FPGA version of the classic pong game
--Score counts up to 9
--Right player uses buttons 0 and 1
--Left player uses Switch 0 (Much harder!)
--Button 2 resets the game and score
library ieee; use ieee.std_logic_1164.all; USE ieee.std_logic_arith.all;
entity FPGA_VGA is
@Javinator9889
Javinator9889 / FPGA_VGA.vhd
Created June 13, 2019 16:11 — forked from jgibbard/FPGA_VGA.vhd
VHDL VGA PONG
--VHDL VGA PONG demo
--An FPGA version of the classic pong game
--Score counts up to 9
--Right player uses buttons 0 and 1
--Left player uses Switch 0 (Much harder!)
--Button 2 resets the game and score
library ieee; use ieee.std_logic_1164.all; USE ieee.std_logic_arith.all;
entity FPGA_VGA is
public enum Enumeration {
ONE, // Posición: 0, constructor #1
TWO(2), // Posición: 1, constructor #2
THREE(3, "THREE"), // Posición: 2, constructor #3
FOUR, // Posición: 3, constructor #1
FIVE; // Posición: 4, constructor #1
private int number;
private String name;