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
| FROM php:7.3.3-cli-alpine3.9 | |
| COPY . /usr/src/hello-world | |
| WORKDIR /usr/src/hello-world | |
| CMD [ "php", "./index.php" ] |
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
| <html> | |
| <head> | |
| <title>Prueba de PHP</title> | |
| </head> | |
| <body> | |
| <?php echo '<p>Hola Mundo</p>'; ?> | |
| </body> | |
| </html> |
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
| # Configuraciones globales | |
| global: | |
| scrape_interval: 15s # El intervalo de tiempo en el que se extraen las métricas. Default 1 minuto. | |
| evaluation_interval: 15s # El intervalo de tiempo en el que se evaluarán las métricas en busca de coincidencias, sólo si se tienen reglas configuradas. | |
| # Alertmanager - configuración de los objetivos a donde se mandan las alertas #cuando coincide una regla | |
| # (En este momento no tenemos ningún objetivo configurado) | |
| alerting: | |
| alertmanagers: | |
| - static_configs: |
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
| groups: | |
| - name: datetime | |
| rules: | |
| - record: daily_saving_time_belgium | |
| expr: | | |
| (vector(0) and (month() < 3 or month() > 10)) | |
| or | |
| (vector(1) and (month() > 3 and month() < 10)) | |
| or | |
| ( |
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
| var crypto = require('crypto'); | |
| function sha1( data ) { | |
| var generator = crypto.createHash('sha1'); | |
| generator.update( data ) | |
| return generator.digest('hex') | |
| } | |
| console.log( sha1('adrian') ) |
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
| var http = require('http'); | |
| var server = http.createServer(function(req, res) { | |
| // console.log(req); // debug dump the request | |
| // If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
| var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
| console.log("Authorization Header is: ", auth); |
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
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, ForeignKey, Integer, String, ForeignKeyConstraint | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker, relationship | |
| Model = declarative_base() | |
| class Parent(Model): | |
| __tablename__ = 'parent' | |
| id = Column(Integer, primary_key=True) |
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 sqlalchemy | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, Integer, String, ForeignKey | |
| from sqlalchemy.orm import sessionmaker, relationship, backref | |
| from sqlalchemy.ext.associationproxy import association_proxy | |
| import uuid | |
| engine = sqlalchemy.create_engine('sqlite:///:memory:') | |
| Base = declarative_base() | |
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
| - name: DO | |
| hosts: localhost | |
| vars: | |
| project_name: "PUT A NAME FOR YOUR PROJECT HERE" | |
| do_token: "PUT YOUR DIGITAL OCEAN API KEY HERE ==> https://cloud.digitalocean.com/settings/api/tokens" | |
| repository: "PUT YOUR REPOSITORY URL HERE" | |
| tasks: | |
| - name: LOCAL | Generate SSH key | |
| shell: ssh-keygen -b 2048 -t rsa -f ~/.ssh/{{project_name}} -q -N "" |
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 | |
| # | |
| # | |
| # | |
| # Start on runlevels 3, 4 and 5. Start late, kill early. | |
| # chkconfig: 345 95 05 | |
| # | |
| # | |
| #!/bin/bash |