http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
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
service: my-api-gateway | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
region: sa-east-1 | |
stage: v1 | |
deploymentBucket: ${env:DEPLOYMENT_BUCKET} | |
iamRoleStatements: | |
- Effect: Allow |
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
# This is a simplified version of what we're using in production for drinksoma.com | |
namespace :mosql do | |
task :run => :environment do | |
conf_path = Rails.root.join('config', 'collections.yml') | |
cmd = "mosql -c #{conf_path} --sql #{ENV['MOSQL_POSTGRES_URI']} --mongo #{ENV['MOSQL_MONGO_URI']}" | |
IO.popen(cmd) do |child| | |
trap('TERM') { Process.kill 'INT', child.pid } | |
$stdout.sync = true |
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
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
nssm.exe install SERVICE_NAME "C:\path\to\exe\or\bat\file.ext" "argument1 argument2"
Collection on all things HTTPS. Includes settings for TLS on nginx (which desperately need an update!).
See https://www.nginx.com/resources/wiki/start/topics/tutorials/install/#official-debian-ubuntu-packages on how to install the lastest version of nginx.
Most settings are sourced from https://bettercrypto.org/static/applied-crypto-hardening.pdf#subsection.2.1.3, https://danpalmer.me/blog/ssl-labs-grade-a, https://gist.github.com/plentz/6737338 and https://scotthelme.co.uk/
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
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
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
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
NewerOlder