Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* PrimerServidorTCP.c
Servicio: Las cadenas de texto recibidas de un Cliente son enviadas a la salida estándar.
Nota: Por simplicidad del código no se realiza ningún tipo de control de errores. No obstante el servidor es totalmente funcional.
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@D3f0
D3f0 / Makefile
Created March 23, 2018 18:27
Creación de Teoría y Práctica de una materia basada en pandoc (por año)
# Definición automática del año de cursado
YEAR ?= $(shell date "+%Y")
# Directorios y cálculo de los archivos fuente
TEORIA_DIR_NAME ?= Teoría
TEORIA_SRC ?= Teoría
TEORIAS_MD := $(shell ls $(TEORIA_SRC)/*.md | xargs basename)
TOERIAS_PDF := $(foreach FILE,$(TEORIAS_MD),$(YEAR)/$(TEORIA_DIR_NAME)/$(patsubst %.md,%.pdf,$(FILE)))
# Prácticas
PRACTICA_DIR_NAME ?= Práctica
@D3f0
D3f0 / Makefile
Last active January 19, 2018 17:20
Makefile biolerplate
.DEFAULT_GOAL := help
# Some Makefile utilities
define PRINT_HELP_PYSCRIPT
import re, sys
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
@D3f0
D3f0 / silent_load.py
Created January 19, 2018 14:05
Silent model %load_ext django_extensions.management.notebook_extension
# Just quick and dirty way to avoid output in the Jupyter extensions
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
from django.core.management.color import no_style
from django_extensions.management.shells import import_objects
imported_objects = import_objects(options={'dont_load': [], 'quiet_load': True}, style=no_style())
locals().update(**imported_objects) # Very ugly
version: '3'
services:
core:
image: d3f0/coreemu_vnc
ports:
- 8080:8080
cap_add:
- NET_ADMIN
- SYS_ADMIN
version: '3'
services:
jupyter:
image: jupyter/base-notebook
ports:
- 8888:8888
@D3f0
D3f0 / docker-compose.yml
Last active September 25, 2017 20:01
Utilización de Docker Compose para pruebas
version: '3'
services:
mosquitto:
image: eclipse-mosquitto
ports:
- 1883:1883
- 9001:9001
nodered:
image: cpswan/node-red
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.