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; | |
| 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
| # 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 | |
| # 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
| #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
| import java.util.HashSet; | |
| import java.util.Scanner; | |
| import java.util.Set; | |
| public class Empezamos { | |
| public static void main(String[] args) { | |
| Scanner in = new Scanner(System.in); | |
| boolean fin = false; | |
| boolean primero; |
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
| package asale; | |
| import java.text.ParseException; | |
| import java.text.RuleBasedCollator; | |
| import java.util.Scanner; | |
| public class asale { | |
| public static void main(String[] args) throws ParseException { | |
| Scanner in = new Scanner(System.in); | |
| String primera; |
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
| sudo xhost local:test |
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 | |
| # TODO: comprobar que xprintidle está instalado. | |
| USER="" | |
| DISPLAY="" | |
| check_xprintidle() { | |
| if [ $(dpkg-query -W -f='${Status}' xprintidle 2>/dev/null | grep -c "ok installed") -eq 0 ]; | |
| then | |
| apt-get install xprintidle; |