Skip to content

Instantly share code, notes, and snippets.

View hussfelt's full-sized avatar
:shipit:
All in - no fold.

Henrik Hussfelt hussfelt

:shipit:
All in - no fold.
View GitHub Profile
@hussfelt
hussfelt / README.md
Created October 15, 2018 19:53
Use Terraform and Lambda to automatically purge old IAM user passwords and access keys

Purge IAM secrets

This terraform module and lambda will remove passwords and secrets that have been unused for too long.

Usage

Put the files in a module folder, for example modules/purge-iam-secrets Use module like this within your terraform plan:

@hussfelt
hussfelt / README.md
Last active April 2, 2024 21:25
AWS and Terraform: Simplest redirect possible for redirecting traffic from one domain to another

AWS and Terraform site redirect

Using example.com as the input domain, this module will:

  • Create a Route53 zone for example.com
  • Create a bucket named example.com
  • Create a bucket named www.example.com
  • Create a Route53 A record example.com for the static website bucket of example.com
  • Create a Route53 A record www.example.com for the static website bucket of www.example.com
@hussfelt
hussfelt / README.md
Last active July 23, 2020 18:13
How to configure ECS EC2 instances to authenticate to JFrog Artifactory Docker Registry

How to configure ECS EC2 instances to authenticate to JFrog Artifactory Docker Registry

The JFrog documentation is lacking on how to do this in a proper way, expecting to use the normal procedures for logging into docker and not in an automated way. This gets even worse if you try and configure your task to authenticate to a private registry - which does not seem to be possible.

The solution is to adjust your user-data, preferably storing your config and key in Secrets Manager.

Putting the config into Secret Manager:

aws secretsmanager update-secret --secret-id artifactory --region us-west-1 --secret-string '{"https://companyname-repo-virtual.jfrog.io": {"auth": "AUTHKEY_FROM_SETMEUP","email": "EMAIL_FROM_SETMEUP"}}'

Keybase proof

I hereby claim:

  • I am hussfelt on github.
  • I am hussfelt (https://keybase.io/hussfelt) on keybase.
  • I have a public key ASACMdnwf32QEUF_xGwRo3zNswIMoUAoyBPuzZm0jGAwsAo

To claim this, I am signing this object:

@hussfelt
hussfelt / example_serializer.js
Created August 17, 2015 18:48
Implementation of the new rest-serializer converting data to JSONApi 2.0
import DS from 'ember-data';
import rest_serializer from 'app/mixins/serializers/rest';
export default DS.RESTSerializer.extend(rest_serializer, {
/**
* [normalizeSingleResponse description]
* @param {[type]} store [description]
* @param {[type]} primaryModelClass [description]
* @param {[type]} payload [description]
@hussfelt
hussfelt / gist:6f4d33a68206c30a9d18
Last active August 29, 2015 14:26 — forked from Dhaulagiri/gist:cf5787663d9f93e99d05
Ember Data 2.0 JSONAPISerializer
import DS from 'ember-data';
import Ember from 'ember';
export default DS.JSONAPISerializer.extend({
normalizeArrayResponse: function(store, primaryModelClass, payload, id, requestType) {
var data = {},
extracted = [],
root = 'data',
type = Ember.String.pluralize(primaryModelClass.modelName);
@hussfelt
hussfelt / gist:911c58fd668ba422b688
Last active December 10, 2023 12:46 — forked from kjunggithub/gist:8330157
git hubflow cheaetsheet

Git HubFlow Cheat Sheet

Preparing the repository

Create the repository on GitHub/Bitbucket. Once created, clone the created repository to your local machine using:

git clone git@github.com:username/repository.git

CD into the repository folder and run the init command to enable to hub flow tools:

cd repo_name
@hussfelt
hussfelt / README.md
Last active October 13, 2022 07:03
Dashing widget to display an iframe with specified src

dashing-iframe

IFrame plugin for dashing

Description

Dashing widget to display an iframe with specified src

Installation

Create the folder iframe in the /widgets/ directory. Put the files iframe.coffee, iframe.html and iframe.scss in that folder.

@hussfelt
hussfelt / README.md
Last active August 29, 2015 14:15 — forked from masha256/README.md

Description

A Dashing widget to show a Google Visualizations Gauge on a dashboard.

Installation

Copy the google_gauge.coffee, google_gauge.html and google_gauge.scss file to into /widgets/google_gauge directory.

Add the following to the dashboard layout file:

Keybase proof

I hereby claim:

  • I am hussfelt on github.
  • I am hussfelt (https://keybase.io/hussfelt) on keybase.
  • I have a public key whose fingerprint is 91F4 D3C0 B19E 314F 9030 58C8 A5B9 D303 A6A9 4D1A

To claim this, I am signing this object: