This file contains hidden or 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> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
int comparar(char *cad1, char *cad2) { | |
int i=0; | |
while ((cad1[i]!='\0') && (cad2[i] != '\0')) { | |
if (cad1[i] < cad2[i]) return -1; | |
if (cad1[i] > cad2[i]) return 1; |
This file contains hidden or 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
#!/bin/bash | |
# Grabar archivo a la vez que hacemos multicast y grabar audio también!!! | |
filename="salida" | |
URL="udp://239.0.0.1:1234/" | |
rm -rf "{$filename}.mp4" | |
titulo=$(zenity --entry --title="Grabación" --text="Introduce el titulo del video (se empezará a grabar a continuación:") | |
now=$(date +"%m_%d_%Y") | |
ffmpeg -f x11grab -s 1920x1080 -framerate 10 -i :0.0 -f pulse -i default -acodec libmp3lame -tune zerolatency -c:v libx264 -x264-params keyint=5:min_keyint=2 -pix_fmt yuv420p -s 1280x800 -threads 0 -f tee -map 0:v -map 1:a "${filename}.mp4|[f=mpegts]${URL}" | |
# Aquí tenemos que recortar los últimos 5 segundos y añadir la cabecera y el final. |
This file contains hidden or 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
# Servidor multicast | |
ffmpeg -f x11grab -s 1920x1080 -framerate 10 -i :0.0 -c:v libx264 -tune zerolatency -x264-params keyint=5:min_keyint=2 -pix_fmt yuv420p -s 1280x800 -threads 0 -f mpegts udp://239.0.0.1:1234 | |
# Cliente multicast | |
ffplay -probesize 32 -sync ext udp:239.0.0.1:1234 | |
# Grabar archivo a la vez que hacemos multicast y grabar audio también!!! | |
now=$(date +"%m_%d_%Y") | |
ffmpeg -f x11grab -s 1920x1080 -framerate 10 -i :0.0 -f pulse -i default -acodec libmp3lame -tune zerolatency -c:v libx264 -x264-params keyint=5:min_keyint=2 -pix_fmt yuv420p -s 1280x800 -threads 0 -f tee -map 0:v -map 1:a "salida_${now}.mp4|[f=mpegts]udp://239.0.0.1:1234/" |
This file contains hidden or 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
#!/bin/bash | |
exec 3>&1; | |
urls=$(dialog --title "URL accesibles" --inputbox "Indica las URL's que podrán ser accesibles (separadas por espacio)" 0 60 2>&1 1>&3); | |
exitcode=$?; | |
exec 3>&1; | |
for url in $urls; do | |
echo "iptables -I FORWARD -s $url -j ACCEPT"; | |
done |
This file contains hidden or 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
#!/bin/bash | |
exec 3>&1; | |
ips=$(dialog --title "IPs internas permitidas" --inputbox "Indica las IPs que podrán navegar sin restricciones (192.168.0.X)" 0 0 2>&1 1>&3); | |
exec 3>&1; | |
for ip in $ips; do | |
echo "iptables -I FORWARD -s 192.168.0.$ip -j ACCEPT"; | |
done |
This file contains hidden or 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
#!/bin/bash | |
exec 3>&1; | |
ips=$(dialog --title "IPs internas permitidas" --inputbox "Indica las IPs que podrán navegar sin restricciones (192.168.0.X)" 0 0 2>&1 1>&3); | |
exec 3>&1; | |
for ip in $ips; do | |
echo "iptables -I FORWARD -s 192.168.0.$ip -j ACCEPT"; | |
done |
This file contains hidden or 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
#!/bin/bash | |
# | |
# 'reset_courses' is a script to bulk reset all courses and unenrol their students. | |
# by Ruben Cancho (@canx) | |
# | |
# DEPENDENCIES: moosh installed. | |
# NOTE: for deleting old students is recommended to install "Inactive User Cleanup" plugin | |
# | |
############ CONFIG ############# | |
userdb='root' # add your moodle db user |
This file contains hidden or 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
options { | |
directory "/var/cache/bind"; | |
zone-statistics yes; | |
statistics-file "/var/log/bind/named.stats"; | |
// TODO: Actualizar bind para que esté soportado! | |
//statistics-channels { | |
// inet 127.0.0.1 port 8888 allow { 127.0.0.1; }; | |
// inet ::1 port 8888 allow { ::1; }; |
This file contains hidden or 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
logging { | |
channel default_log { | |
file "/var/log/bind/default" versions 3 size 20m; | |
print-time yes; | |
print-category yes; | |
print-severity yes; | |
severity info; | |
}; | |
channel auth_servers_log { | |
file "/var/log/bind/auth_servers" versions 100 size 20m; |