# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
This file contains 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 main | |
import ( | |
"log" | |
"time" | |
"golang.org/x/net/context" | |
"google.golang.org/grpc" | |
pb "github.com/jzelinskie/grpc/simple" |
This file contains 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
#!/usr/bin/python | |
import ftplib | |
session = ftplib.FTP('example.com','username','password') | |
file = open('cup.mp4','rb') # file to send | |
session.storbinary('STOR '+'cup.mp4', file) # send the file | |
file.close() # close file and FTP | |
session.quit() |
This file contains 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 main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
func main() { | |
wait := make(chan bool) |
This file contains 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 main | |
import ( | |
"crypto/md5" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"os" | |
"path/filepath" |
This file contains 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
# see https://github.com/cmaessen/docker-php-sendmail for more information | |
FROM php:fpm | |
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/* | |
RUN docker-php-ext-install mysql mysqli | |
RUN echo "hostname=localhost.localdomain" > /etc/ssmtp/ssmtp.conf | |
RUN echo "[email protected]" >> /etc/ssmtp/ssmtp.conf |
- Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
export SECRETNAME=acmeorg
This file contains 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 = { | |
'handlers': { | |
'logstash': { | |
'level': 'DEBUG', | |
'class': 'logstash.LogstashHandler', | |
'host': 'localhost', | |
'port': 5000, # Default port of logstash | |
'version': 1, # Version of logstash event schema. Default value: 0 (for backward compatibility of the library) | |
'message_type': 'logstash', # 'type' field in logstash message. Default value: 'logstash'. | |
'fqdn': False, # Fully qualified domain name. Default value: false. |