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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx | |
spec: | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: |
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
using Common; | |
using CountryPull; | |
using Dapr.Client; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
await Host.CreateDefaultBuilder(args).ConfigureServices((context, services) => | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Exchange.WebServices.Data; | |
using static Microsoft.Exchange.WebServices.Data.SearchFilter; | |
namespace Inboxer | |
{ | |
class MainClass | |
{ |
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
if let library = try? ITLibrary(apiVersion: "1") { | |
print(library.applicationVersion) | |
for artist in library.allMediaItems | |
.filter({ $0.mediaKind == ITLibMediaItemMediaKind.kindSong }) | |
.group(by: { $0.artist?.name }){ | |
print(artist.key) | |
for album in artist.value.group(by: { $0.album.title }) { | |
print(" \(album.key) (\(album.value.first!.year))") | |
} | |
} |
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
public extension Sequence { | |
func group<U: Hashable>(by key: (Iterator.Element) -> U?) -> [U:[Iterator.Element]] { | |
var categories: [U: [Iterator.Element]] = [:] | |
for element in self { | |
let key = key(element) | |
if case nil = categories[key!]?.append(element) { | |
categories[key!] = [element] | |
} | |
} | |
return categories |
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
curl -s http://nginx.org/keys/nginx_signing.key > /tmp/nginx.key | |
sudo apt-key add /tmp/nginx.key | |
rm /tmp/nginx.key | |
sudo apt-add-repository "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | |
sudo apt-add-repository "deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" | |
sudo apt-get update | |
sudo apt-get install nginx letsencrypt -y | |
sudo letsencrypt certonly --standalone -d "$DOMAIN" --email "$EMAIL" --agree-tos |
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
## | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
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
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
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
[Unit] | |
Description=Docker Application Container Engine | |
Documentation=https://docs.docker.com | |
After=network.target docker.socket | |
Requires=docker.socket | |
[Service] | |
Type=notify | |
# the default is not to use systemd for cgroups because the delegate issues still | |
# exists and systemd currently does not support the cgroup feature set required |
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
openssl req -x509 -newkey rsa:4096 -keyout certificate.key -out certificate.crt -days 365 [-nodes] |
NewerOlder