Skip to content

Instantly share code, notes, and snippets.

Mathias Lafeldt mlafeldt

Block or report user

Report or block mlafeldt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mlafeldt
mlafeldt / nginx.yaml
Created Apr 12, 2019
HPA based on CPU
View nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: ae-ops-testing
labels:
app: nginx
spec:
# replicas: 1
selector:
@mlafeldt
mlafeldt / main.go
Created Mar 1, 2019
Lambda handlertrace example
View main.go
func main() {
lambda.StartHandler(middleware(handler))
}
type handlerFunc func(ctx context.Context, payload []byte) ([]byte, error)
func (h handlerFunc) Invoke(ctx context.Context, input []byte) ([]byte, error) {
log.Printf("[DEBUG] input = %s", string(input))
output, err := h(ctx, input)
log.Printf("[DEBUG] output = %s", string(output))
@mlafeldt
mlafeldt / spec.yaml
Created Oct 26, 2018
K8s JSON Logger Container
View spec.yaml
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: test
name: test
spec:
replicas: 1
@mlafeldt
mlafeldt / epsagon.yaml
Created Oct 8, 2018
CloudFormation stack for Epsagon to provide monitoring
View epsagon.yaml
Description: CloudFormation stack for Epsagon to provide monitoring.
Resources:
EpsagonRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
View fibonacci.go
package main
import "fmt"
func main() {
c := make(chan int)
quit := make(chan int)
go func() {
for i := 0; i < 10; i++ {
@mlafeldt
mlafeldt / README.md
Last active Apr 19, 2019
AWS Resources recommend by https://acloud.guru/
View README.md
  • AWS Documentation
  • AWS Service FAQs
  • AWS Whitepapers
    • Read early and study later
      • Architecting for the Cloud: AWS Best Practices
      • AWS Security Best Practices
    • Read before exam
      • Overview of Amazon Web Services
      • Overview of Security Processes
      • AWS Storage Services Overview
View sns.go
package main
import (
"encoding/json"
"log"
"github.com/apex/go-apex"
"github.com/apex/go-apex/sns"
)
@mlafeldt
mlafeldt / main.rb
Created Feb 14, 2017
Scientist example
View main.rb
require "scientist"
class MyExperiment
include Scientist::Experiment
attr_accessor :name
def initialize(name)
@name = name
end
@mlafeldt
mlafeldt / Dockerfile
Last active Jan 25, 2017
Push freshness metric to Prometheus Pushgateway
View Dockerfile
FROM alpine
RUN apk add --update bash curl ca-certificates
ADD freshness.sh /usr/bin/freshness
ENTRYPOINT ["/usr/bin/freshness"]
@mlafeldt
mlafeldt / byword.md
Created Jan 16, 2017
Byword Dropbox conflicts
View byword.md

Hi,

For a couple of months, I've been observing the following strange behavior in Byword:

I'm storing my documents to a folder that is backed by Dropbox. When saving a Markdown file with Cmd+S, I often get the following error:

The document “example.md” could not be saved. The file has been changed by another application.

This happens almost every time I have Dropbox enabled. In addition to this annoying message, my documents folder will contain lots of "conflicted copy" files, which I have to remove manually on a regular basis.

You can’t perform that action at this time.