sudo apt install openjdk-8-jdk-headless
#!/usr/bin/env python3 | |
# python3 update of https://gist.github.com/dergachev/7028596 | |
# Create a basic certificate using openssl: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# Or to set CN, SAN and/or create a cert signed by your own root CA: https://thegreycorner.com/pentesting_stuff/writeups/selfsignedcert.html | |
import http.server | |
import ssl | |
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler) |
# Note: You MUST have curl 7.47+ with http/2 support compiled in | |
curl -v \ | |
-d '{"aps":{"alert":"<message>","badge":42}}' \ | |
-H "apns-topic: <bundle id>" \ | |
-H "apns-priority: 10" \ | |
--http2 \ | |
--cert <certificate file> \ | |
https://api.development.push.apple.com/3/device/<device token> |
This is mainly for node.js but might apply to other environments. Unsure.
If you are running a AWS Lambda function that calls another AWS service and getting an error about invalid tokens or other access denied errors, do this:
The role assigned to your lambda function will need permission to perform the actions. Check IAM and make sure the role has all the permissions.
Copyright 2015 Matthew Brush | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
DDD é um conjunto de boas práticas de orientação a objetos e um padrão de modelagem de sistemas, uma metodologia para aplicação de conceitos e padrões no projeto.
DDD tende a ser uma idéia geral focando em entender primeiro o domínio.
Os problemas em questão, os objetos com os quais está trabalhando.
São construídos os modelos primeiro, ferramentas para manipulá-los em segundo lugar, e depois a lógica de negócios no topo para resolver os problemas de domínio por exigência de negócios.
Normalmente trabalha em mecanismos de persistência em seguida, e apresentação por último.
Isso vem em contrapartida com o uso comum do Data-Driven Design ou Projeto Orientado a Dados, que a maioria dos desenvolvedores usa sem mesmo ter consciência disso. Devemos em um primeiro momento esquecer de como os dados são persistidos e nos preocupar mais em como representar melhor as necessidades de negócio em classes e comportamentos.
// Place in app root, build project (e.g: 'npm start'), execute (e.g. 'node automigrate.js') | |
const {DbDataSource} = require('./dist/src/datasources/db.datasource.js'); | |
const {TodoRepository} = require('./dist/src/repositories/todo.repository.js'); | |
const {TodoListRepository} = require('./dist/src/repositories/todo-list.repository.js'); | |
const db = new DbDataSource(); | |
const repoTodo = new TodoRepository(db); | |
const repoTodoList = new TodoListRepository(db); |