From 72d18ac6c0214a5ae70fbde4668f4e0dd8878c78 Mon Sep 17 00:00:00 2001 From: ale Date: Thu, 3 Oct 2024 01:47:38 +0200 Subject: [PATCH] initial commit --- bash/Alias to view Raspberry temperature | 3 + ...to delete ALL docker containers and images | 3 + bash/Curl + HTTP-3 (Build on the fly) | 30 ++++ bash/certs.sh | 6 + bash/clean-mastodon.sh | 10 ++ bash/mp3.sh | 2 + bash/pssh.sh | 2 + bash/stats-project.sh | 9 + bash/temp.sh | 1 + bash/youtube-mp3.sh | 2 + config/Config DNS Bind9 | 12 ++ config/Sudo group without password | 1 + docker/Building ARM Docker Containers on x86 | 2 + docker/Dockerfile-ssh-vuln | 6 + docker/Install vieux-sshfs docker driver | 13 ++ ...tch for use with docker and docker-compose | 166 ++++++++++++++++++ docker/ci => docker + jenkins + sonar | 31 ++++ docker/docker-compose-es7.yml | 40 +++++ docker/docker-compose-kamailio.yml | 24 +++ docker/docker-compose-liferay-7.1.1-ga2.yml | 95 ++++++++++ docker/docker-compose-rocketchat.yml | 92 ++++++++++ js/Simple Node HTTP Server | 1 + js/convert-ytdl-mp3.js | 10 ++ .../instalar-docker-kubernetes-win2k22.ps1 | 22 +++ test/Python @Decorador | 13 ++ 25 files changed, 596 insertions(+) create mode 100644 bash/Alias to view Raspberry temperature create mode 100644 bash/Bash script to delete ALL docker containers and images create mode 100644 bash/Curl + HTTP-3 (Build on the fly) create mode 100644 bash/certs.sh create mode 100644 bash/clean-mastodon.sh create mode 100644 bash/mp3.sh create mode 100644 bash/pssh.sh create mode 100644 bash/stats-project.sh create mode 100644 bash/temp.sh create mode 100644 bash/youtube-mp3.sh create mode 100644 config/Config DNS Bind9 create mode 100644 config/Sudo group without password create mode 100644 docker/Building ARM Docker Containers on x86 create mode 100644 docker/Dockerfile-ssh-vuln create mode 100644 docker/Install vieux-sshfs docker driver create mode 100644 docker/OrangePi Prime kernel patch for use with docker and docker-compose create mode 100644 docker/ci => docker + jenkins + sonar create mode 100644 docker/docker-compose-es7.yml create mode 100644 docker/docker-compose-kamailio.yml create mode 100644 docker/docker-compose-liferay-7.1.1-ga2.yml create mode 100644 docker/docker-compose-rocketchat.yml create mode 100644 js/Simple Node HTTP Server create mode 100644 js/convert-ytdl-mp3.js create mode 100644 powershell/instalar-docker-kubernetes-win2k22.ps1 create mode 100644 test/Python @Decorador diff --git a/bash/Alias to view Raspberry temperature b/bash/Alias to view Raspberry temperature new file mode 100644 index 0000000..4cc30e2 --- /dev/null +++ b/bash/Alias to view Raspberry temperature @@ -0,0 +1,3 @@ +$ alias temp="vcgencmd measure_temp" +$ temp +temp=64.5'C \ No newline at end of file diff --git a/bash/Bash script to delete ALL docker containers and images b/bash/Bash script to delete ALL docker containers and images new file mode 100644 index 0000000..dfe2ada --- /dev/null +++ b/bash/Bash script to delete ALL docker containers and images @@ -0,0 +1,3 @@ +#!/bin/bash │· +for i in $(docker ps -a | tail +2 | awk '{print $1}'); do docker rm $i; done │· +for i in $(docker images | tail +2 | awk '{print $3}'); do docker rmi $i; done \ No newline at end of file diff --git a/bash/Curl + HTTP-3 (Build on the fly) b/bash/Curl + HTTP-3 (Build on the fly) new file mode 100644 index 0000000..204795c --- /dev/null +++ b/bash/Curl + HTTP-3 (Build on the fly) @@ -0,0 +1,30 @@ +#!/bin/bash +THREADS=8 +apt update && apt install -y build-essential cmake automake git libtool pkg-config libev-dev +rm -rf /usr/local/tmp && mkdir -p /usr/local/tmp && cd /usr/local/tmp +git clone --depth 1 -b openssl-quic-draft-22 https://github.com/tatsuhiro-t/openssl openssl +cd openssl +./config enable-tls1_3 enable-shared --prefix=/usr/lib/x86_64-linux-gnu +make -j$THREADS && make install_sw || exit 0 +cd .. +git clone https://github.com/ngtcp2/nghttp3 +cd nghttp3 +sed -i 's/PKG_PROG_PKG_CONFIG([0.20])/PKG_PROG_PKG_CONFIG([0.29])/' configure.ac +autoreconf -i +./configure --prefix=/usr/lib/x86_64-linux-gnu --enable-lib-only +make -j$THREADS && make install || exit 0 +cd .. +git clone -b draft-25 https://github.com/ngtcp2/ngtcp2 +cd ngtcp2 +autoreconf -i +./configure PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/lib/pkgconfig LDFLAGS="-Wl,-rpath,/usr/lib/x86_64-linux-gnu/lib" --prefix=/usr/lib/x86_64-linux-gnu +make -j$THREADS && make install || exit 0 +cd .. +git clone https://github.com/curl/curl +cd curl +git checkout curl-7_69_1 +./buildconf +LDFLAGS="-Wl,-rpath,/usr/lib/x86_64-linux-gnu/lib" ./configure --with-ssl=/usr/lib/x86_64-linux-gnu --with-nghttp3=/usr/lib/x86_64-linux-gnu --with-ngtcp2=/usr/lib/x86_64-linux-gnu --prefix=/usr/local --libdir=/usr/lib/x86_64-linux-gnu --enable-alt-svc +make -j$THREADS && make install || exit 0 +rm -rf /usr/local/tmp +LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu /usr/local/bin/curl -V diff --git a/bash/certs.sh b/bash/certs.sh new file mode 100644 index 0000000..cad6afc --- /dev/null +++ b/bash/certs.sh @@ -0,0 +1,6 @@ +#!/bin/bash +DOMAINS="domain.com example.com pepe.com" +for domain in $DOMAINS; do +echo $domain +openssl s_client -connect $domain:443 2>/dev/null /dev/null +RUN echo 'deb https://deb.sipwise.com/debian bookworm main contrib non-free' >> /etc/apt/sources.list +ENV VERSION=1:9.2p1-2+deb12u2 +RUN apt update && apt -y install openssh-server=$VERSION openssh-client=$VERSION openssh-sftp-server=$VERSION && apt clean diff --git a/docker/Install vieux-sshfs docker driver b/docker/Install vieux-sshfs docker driver new file mode 100644 index 0000000..f79109e --- /dev/null +++ b/docker/Install vieux-sshfs docker driver @@ -0,0 +1,13 @@ +#!/bin/bash +git clone https://github.com/vieux/docker-volume-sshfs +cd docker-volume-sshfs/ +docker build -t rootfsimage . +cd .. +mkdir -p docker-volume-sshfs/rootfs +id=$(docker create rootfsimage true) +sudo docker export "$id" | sudo tar -x -C docker-volume-sshfs/rootfs +docker rm -vf "$id" +docker rmi rootfsimage +sudo docker plugin create vieux/sshfs docker-volume-sshfs/ +docker plugin enable vieux/sshfs:latest +docker plugin ls \ No newline at end of file diff --git a/docker/OrangePi Prime kernel patch for use with docker and docker-compose b/docker/OrangePi Prime kernel patch for use with docker and docker-compose new file mode 100644 index 0000000..0475916 --- /dev/null +++ b/docker/OrangePi Prime kernel patch for use with docker and docker-compose @@ -0,0 +1,166 @@ +--- .config 2018-09-02 18:58:17.646331196 +0200 ++++ .orangepi-docker-config.config 2018-09-02 18:57:30.621852013 +0200 +@@ -37,7 +37,8 @@ + CONFIG_SWAP=y + CONFIG_SYSVIPC=y + CONFIG_SYSVIPC_SYSCTL=y +-# CONFIG_POSIX_MQUEUE is not set ++CONFIG_POSIX_MQUEUE=y ++CONFIG_POSIX_MQUEUE_SYSCTL=y + CONFIG_FHANDLE=y + CONFIG_AUDIT=y + # CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set +@@ -91,12 +92,12 @@ + # CONFIG_RCU_BOOST is not set + # CONFIG_RCU_NOCB_CPU is not set + CONFIG_IKCONFIG=y +-# CONFIG_IKCONFIG_PROC is not set ++CONFIG_IKCONFIG_PROC=y + CONFIG_LOG_BUF_SHIFT=17 + CONFIG_CGROUPS=y + CONFIG_CGROUP_DEBUG=y + CONFIG_CGROUP_FREEZER=y +-# CONFIG_CGROUP_DEVICE is not set ++CONFIG_CGROUP_DEVICE=y + CONFIG_CPUSETS=y + CONFIG_PROC_PID_CPUSET=y + CONFIG_CGROUP_CPUACCT=y +@@ -552,6 +553,7 @@ + CONFIG_NETFILTER=y + # CONFIG_NETFILTER_DEBUG is not set + CONFIG_NETFILTER_ADVANCED=y ++CONFIG_BRIDGE_NETFILTER=y + + # + # Core Netfilter Configuration +@@ -635,7 +637,7 @@ + # + # Xtables matches + # +-# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set ++CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y + # CONFIG_NETFILTER_XT_MATCH_BPF is not set + # CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set + CONFIG_NETFILTER_XT_MATCH_COMMENT=y +@@ -658,11 +660,12 @@ + CONFIG_NETFILTER_XT_MATCH_LIMIT=y + CONFIG_NETFILTER_XT_MATCH_MAC=y + CONFIG_NETFILTER_XT_MATCH_MARK=y +-# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set ++CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y + # CONFIG_NETFILTER_XT_MATCH_NFACCT is not set + # CONFIG_NETFILTER_XT_MATCH_OSF is not set + # CONFIG_NETFILTER_XT_MATCH_OWNER is not set + CONFIG_NETFILTER_XT_MATCH_POLICY=y ++CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m + CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y + CONFIG_NETFILTER_XT_MATCH_QTAGUID=y + CONFIG_NETFILTER_XT_MATCH_QUOTA=y +@@ -737,16 +740,20 @@ + CONFIG_IP6_NF_RAW=y + CONFIG_IP6_NF_SECURITY=y + # CONFIG_NF_NAT_IPV6 is not set ++# CONFIG_BRIDGE_NF_EBTABLES is not set + # CONFIG_IP_DCCP is not set + # CONFIG_IP_SCTP is not set + # CONFIG_RDS is not set + # CONFIG_TIPC is not set + # CONFIG_ATM is not set + # CONFIG_L2TP is not set +-# CONFIG_BRIDGE is not set ++CONFIG_STP=m ++CONFIG_BRIDGE=m ++# CONFIG_BRIDGE_IGMP_SNOOPING is not set + CONFIG_HAVE_NET_DSA=y + # CONFIG_VLAN_8021Q is not set + # CONFIG_DECNET is not set ++CONFIG_LLC=m + # CONFIG_LLC2 is not set + # CONFIG_IPX is not set + # CONFIG_ATALK is not set +@@ -816,6 +823,7 @@ + # CONFIG_NET_CLS_IND is not set + CONFIG_NET_SCH_FIFO=y + # CONFIG_DCB is not set ++# CONFIG_DNS_RESOLVER is not set + # CONFIG_BATMAN_ADV is not set + # CONFIG_OPENVSWITCH is not set + # CONFIG_VSOCKETS is not set +@@ -1068,9 +1076,12 @@ + CONFIG_BLK_DEV_DM=y + # CONFIG_DM_DEBUG is not set + CONFIG_DM_BUFIO=y ++CONFIG_DM_BIO_PRISON=y ++CONFIG_DM_PERSISTENT_DATA=y + CONFIG_DM_CRYPT=y + # CONFIG_DM_SNAPSHOT is not set +-# CONFIG_DM_THIN_PROVISIONING is not set ++CONFIG_DM_THIN_PROVISIONING=y ++# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set + # CONFIG_DM_CACHE is not set + # CONFIG_DM_MIRROR is not set + # CONFIG_DM_RAID is not set +@@ -1095,7 +1106,7 @@ + # CONFIG_NETPOLL is not set + # CONFIG_NET_POLL_CONTROLLER is not set + CONFIG_TUN=y +-# CONFIG_VETH is not set ++CONFIG_VETH=y + + # + # CAIF transport drivers +@@ -2901,7 +2912,7 @@ + # CONFIG_FANOTIFY_ACCESS_PERMISSIONS is not set + # CONFIG_QUOTA is not set + # CONFIG_QUOTACTL is not set +-# CONFIG_AUTOFS4_FS is not set ++CONFIG_AUTOFS4_FS=y + CONFIG_FUSE_FS=y + CONFIG_CUSE=y + CONFIG_GENERIC_ACL=y +@@ -2956,6 +2967,7 @@ + CONFIG_MISC_FILESYSTEMS=y + # CONFIG_ADFS_FS is not set + # CONFIG_AFFS_FS is not set ++# CONFIG_ECRYPT_FS is not set + # CONFIG_HFS_FS is not set + # CONFIG_HFSPLUS_FS is not set + # CONFIG_BEFS_FS is not set +@@ -2997,8 +3009,10 @@ + CONFIG_CIFS=y + # CONFIG_CIFS_STATS is not set + # CONFIG_CIFS_WEAK_PW_HASH is not set ++# CONFIG_CIFS_UPCALL is not set + # CONFIG_CIFS_XATTR is not set + # CONFIG_CIFS_DEBUG is not set ++# CONFIG_CIFS_DFS_UPCALL is not set + # CONFIG_CIFS_SMB2 is not set + CONFIG_CIFS_FSCACHE=y + # CONFIG_NCP_FS is not set +@@ -3208,7 +3222,9 @@ + # + # Security options + # +-# CONFIG_KEYS is not set ++CONFIG_KEYS=y ++CONFIG_ENCRYPTED_KEYS=m ++CONFIG_KEYS_DEBUG_PROC_KEYS=y + # CONFIG_SECURITY_DMESG_RESTRICT is not set + CONFIG_SECURITY=y + CONFIG_SECURITYFS=y +@@ -3230,6 +3246,7 @@ + # CONFIG_SECURITY_APPARMOR is not set + # CONFIG_SECURITY_YAMA is not set + # CONFIG_IMA is not set ++# CONFIG_EVM is not set + CONFIG_DEFAULT_SECURITY_SELINUX=y + # CONFIG_DEFAULT_SECURITY_DAC is not set + CONFIG_DEFAULT_SECURITY="selinux" +@@ -3343,6 +3360,7 @@ + CONFIG_CRYPTO_USER_API_RNG=m + CONFIG_CRYPTO_HW=y + CONFIG_CRYPTO_SUNXI=m ++# CONFIG_ASYMMETRIC_KEY_TYPE is not set + # CONFIG_ARM64_CRYPTO is not set + CONFIG_BINARY_PRINTF=y + diff --git a/docker/ci => docker + jenkins + sonar b/docker/ci => docker + jenkins + sonar new file mode 100644 index 0000000..c34d46e --- /dev/null +++ b/docker/ci => docker + jenkins + sonar @@ -0,0 +1,31 @@ +version: '2' +services: + jenkins: + image: jenkins/jenkins + container_name: jenkins + hostname: jenkins + restart: always + volumes: + - ./jenkins:/var/jenkins_home + expose: + - 8080 + networks: + - icnet + + sonarqube: + image: sonarqube + container_name: sonarqube + hostname: sonarqube + restart: always + expose: + - 9000 + volumes: + - ./sonar/conf:/opt/sonarqube/conf + - ./sonar/data:/opt/sonarqube/data + - ./sonar/logs:/opt/sonarqube/logs + - ./sonar/extensions:/opt/sonarqube/extensions + networks: + - icnet + +networks: + icnet: \ No newline at end of file diff --git a/docker/docker-compose-es7.yml b/docker/docker-compose-es7.yml new file mode 100644 index 0000000..7a60498 --- /dev/null +++ b/docker/docker-compose-es7.yml @@ -0,0 +1,40 @@ +version: '3.6' + +services: + elasticsearch: + image: 'docker.elastic.co/elasticsearch/elasticsearch:7.0.0-alpha2' + restart: always + container_name: elasticsearch + hostname: elasticsearch + environment: + - cluster.name=elasticsearch + - bootstrap.memory_lock=true + - transport.host=localhost + - "ES_JAVA_OPTS=-Xms1G -Xmx2G" + ulimits: + memlock: + soft: -1 + hard: -1 + volumes: + - ./esdata:/usr/share/elasticsearch/data + expose: + - 9200 + networks: + - esnet + + kibana: + image: 'docker.elastic.co/kibana/kibana:7.0.0-alpha2' + restart: always + container_name: kibana + hostname: kibana + ports: + - "5601:5601" + depends_on: + - elasticsearch + volumes: + - ./kibana.yml:/usr/share/kibana/config/kibana.yml + networks: + - esnet + +networks: + esnet: \ No newline at end of file diff --git a/docker/docker-compose-kamailio.yml b/docker/docker-compose-kamailio.yml new file mode 100644 index 0000000..f78cc30 --- /dev/null +++ b/docker/docker-compose-kamailio.yml @@ -0,0 +1,24 @@ +version: '2' +services: + kamailio: + build: ./kamailio + restart: always + hostname: kamailio + container_name: kamailio + entrypoint: + - /bin/bash + - /etc/kamailio/entrypoint.sh + volumes: + - ./kamailio:/etc/kamailio + - ./kamailio/kamailio:/etc/default/kamailio + - ./kamailio/rtpproxy:/etc/default/rtpproxy + ports: + - "5060:5060/tcp" + - "5060:5060/udp" + - "5061:5061/tcp" + - "5061:5061/udp" + networks: + - net + +networks: + - net diff --git a/docker/docker-compose-liferay-7.1.1-ga2.yml b/docker/docker-compose-liferay-7.1.1-ga2.yml new file mode 100644 index 0000000..788c5c3 --- /dev/null +++ b/docker/docker-compose-liferay-7.1.1-ga2.yml @@ -0,0 +1,95 @@ +version: '3.6' + +services: + liferay: + image: esystemstech/liferay:7.1.1-ga2 + container_name: liferay + restart: always + environment: + - "DB_HOST=mysql" + - "DB_SCHEMA=liferay" + - "DB_USER=liferay" + - "DB_PASSWORD=xxx" + - "ELASTICSEARCH_CLUSTER_NAME=docker-cluster" + - "ELASTICSEARCH_HOST=elasticsearch" + - "ELASTICSEARCH_PORT=9300" + - "LIBREOFFICE_ENABLED=true" + - "LIBREOFFICE_CACHE=true" + - "LIBREOFFICE_HOST=libreoffice" + - "LIBREOFFICE_PORT=8100" + ports: + - 8080:8080 + networks: + - external + - services-only + volumes: + - liferay-data:/opt/liferay/home/data + - liferay-logs:/var/log/tomcat8 + - liferay-conversions:/var/lib/tomcat8/temp/liferay/document_conversion + tmpfs: + - /var/lib/tomcat8/temp/liferay:uid=7002,gid=7006,mode=1770 + depends_on: + - mysql + - elasticsearch + - libreoffice + elasticsearch: + image: esystemstech/elasticsearch:liferay-7.1.1-ga2-cc + container_name: elasticsearch + hostname: elasticsearch + restart: always + networks: + - services-only + volumes: + - elasticsearch-data:/usr/share/elasticsearch/data + ulimits: + nofile: + soft: 65536 + hard: 65536 + expose: + - 9200 + - 9300 + libreoffice: + image: esystemstech/libreoffice:liferay-7.1.1-ga2-cc + container_name: libreoffice + hostname: libreoffice + restart: always + networks: + - services-only + expose: + - 8100 + volumes: + - liferay-conversions:/var/lib/tomcat8/temp/liferay/document_conversion + + mysql: + image: mysql:5.7 + container_name: mysql + hostname: mysql + restart: always + command: ["mysqld", "--character-set-server=utf8", "--collation-server=utf8_general_ci", "--default-time-zone=+00:00","--explicit_defaults_for_timestamp", "--default-authentication-plugin=mysql_native_password"] + networks: + - services-only + expose: + - 3306 + environment: + - "MYSQL_ROOT_PASSWORD=yyy" + - "MYSQL_DATABASE=liferay" + - "MYSQL_USER=liferay" + - "MYSQL_PASSWORD=xxx" + volumes: + - mysql-data:/var/lib/mysql +volumes: + mysql-data: + liferay-data: + liferay-logs: + elasticsearch-data: + liferay-conversions: + driver_opts: + type: tmpfs + device: tmpfs + o: uid=7002,gid=7005,mode=2770 + +networks: + services-only: + internal: true + external: + internal: false \ No newline at end of file diff --git a/docker/docker-compose-rocketchat.yml b/docker/docker-compose-rocketchat.yml new file mode 100644 index 0000000..33d513f --- /dev/null +++ b/docker/docker-compose-rocketchat.yml @@ -0,0 +1,92 @@ + version: '2' + services: + db-rocketchat1: + image: mongo + restart: always + container_name: db-rocketchat1 + hostname: db-rocketchat1 + command: --smallfiles --keyFile /opt/keyfile --replSet "rs0" + volumes: + - ./mongo/data1:/data/db + - ./mongo/mongodb-keyfile:/opt/keyfile + networks: + mynet: + + db-rocketchat2: + image: mongo + restart: always + container_name: db-rocketchat2 + hostname: db-rocketchat2 + command: --smallfiles --keyFile /opt/keyfile --replSet "rs0" + volumes: + - ./mongo/data2:/data/db + - ./mongo/mongodb-keyfile:/opt/keyfile + networks: + mynet: + + rocketchat: + build: ./rocketchat + restart: always + container_name: rocketchat + hostname: rocketchat + entrypoint: + - /bin/bash + - /entrypoint.sh + environment: + - ROOT_URL=https://domain + - PORT=3000 + - MAIL_URL=smtp.domain + - Accounts_UseDNSDomainCheck=False + - NODE_ENV=production + - Accounts_AvatarStorePath=/home/rocketchat/uploads + - MONGO_URL=mongodb://rocket:password@db-rocketchat1:27017,db-rocketchat2:27017/rocketchat?authSource=admin&replicaSet=rs0&readPreference=nearest&w=majority + - MONGO_OPLOG_URL=mongodb://oploguser:password@db-rocketchat1:27017,db-rocketchat2:27017/local?authSource=admin&replicaSet=rs0 + - INSTANCE_IP=ipofthisinstance + volumes: + - ./rocketchat/uploads:/home/rocketchat/uploads + - ./rocketchat/hosts:/etc/hosts + links: + - db-rocketchat1:db-rocketchat1 + - db-rocketchat2:db-rocketchat2 + depends_on: + - db-rocketchat1 + - db-rocketchat2 + expose: + - 3000 + networks: + mynet: + + hubot: + build: ./hubot + restart: always + container_name: hubot + hostname: hubot + entrypoint: + - /usr/bin/sudo + - -u + - hubot + - /bin/bash + - /entrypoint.sh + volumes: + - ./hubot/external-scripts.json:/external-scripts.json + links: + - rocketchat:rocketchat + expose: + - 3001 + networks: + mynet: + + redis: + image: redis:alpine + hostname: redis-rocketchat + container_name: redis-rocketchat + restart: always + volumes: + - ./redis:/data + expose: + - 6379 + networks: + mynet: + + networks: + mynet: \ No newline at end of file diff --git a/js/Simple Node HTTP Server b/js/Simple Node HTTP Server new file mode 100644 index 0000000..a35508e --- /dev/null +++ b/js/Simple Node HTTP Server @@ -0,0 +1 @@ +try{require('http').createServer((req,res)=>res.end(require('fs').readFileSync(__dirname+req.url))).listen(3000)}catch(e){console.error(e)} \ No newline at end of file diff --git a/js/convert-ytdl-mp3.js b/js/convert-ytdl-mp3.js new file mode 100644 index 0000000..687540e --- /dev/null +++ b/js/convert-ytdl-mp3.js @@ -0,0 +1,10 @@ +const fs = require('fs'), + url = process.argv[2], + ytdl = require('ytdl-core'), + ffmpeg = require('fluent-ffmpeg'), + stream = new ffmpeg(ytdl(url, { filter: 'audioonly' })) + +stream.on('error', function (err) { + console.log(err) +}) +.format('mp3').pipe(fs.createWriteStream(__dirname + '/' + url.replace(/^.*v=/, '') + '.mp3')) diff --git a/powershell/instalar-docker-kubernetes-win2k22.ps1 b/powershell/instalar-docker-kubernetes-win2k22.ps1 new file mode 100644 index 0000000..ab5c414 --- /dev/null +++ b/powershell/instalar-docker-kubernetes-win2k22.ps1 @@ -0,0 +1,22 @@ +# Bajar la imagen https://www.microsoft.com/en-us/evalcenter/download-windows-server-2022 +# Instalar Windows Server 2022 + +# Instalar Docker licencia Apache en Windows +# Abrir y ejecutar los siguientes comandos en un PowerShell como Administrador + +#------------- Instalar Docker desde PowerShell en Windows Server ------------- +Install-PackageProvider -Name NuGet -Force +Install-Module PowerShellGet -AllowClobber -Force +Install-Module -Name DockerMsftProvider -Repository PSGallery -Force +# Set the TLS version used by the PowerShell client to TLS 1.2. +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; +Install-Package -Name docker -ProviderName DockerMsftProvider +Restart-Computer -Force +# Si no funciona al reiniciar tenemos que reiniciar el servicio +Get-Service docker | Restart-Service +#------------------------------------------------------------------------------ + +# Para instalar Kubernetes en Windows Server ejecutar en un PowerShell +# https://github.com/microsoft/SDN/blob/master/Kubernetes/windows/install.ps1 +$ScriptURL = https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/install.ps1 +iex (iwr $ScriptURL).Content \ No newline at end of file diff --git a/test/Python @Decorador b/test/Python @Decorador new file mode 100644 index 0000000..143e9c1 --- /dev/null +++ b/test/Python @Decorador @@ -0,0 +1,13 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +class decorador(object): + def __init__(self, func): + print "Welcome to" + func() + def __call__(self): + print "python :)" +@decorador +def luser(): + print "World of" +print "decorators at" +luser() \ No newline at end of file