Skip to content

Instantly share code, notes, and snippets.

View dacci's full-sized avatar

Shinya Tsuda dacci

View GitHub Profile
@dacci
dacci / CloudWatch_Alarms_for_CIS_AWS_Foundations.cfn.yaml
Created November 30, 2019 01:37
CloudFormation template to create activity alarms specified in CIS AWS Foundations.
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Activity alarm template for CIS AWS Foundations'
Parameters:
LogGroupName:
Type: String
Default: CloudTrail/DefaultLogGroup
Description: 'Enter CloudWatch Logs log group name. Default is CloudTrail/DefaultLogGroup'
TopicName:
@dacci
dacci / itunes_eqpreset.ps1
Created November 30, 2019 02:13
Scripts to create equalizer presets "Perfect" and "Eargasm Explosion" in iTunes.
$ITunes = New-Object -ComObject iTunes.Application
$Preset = $ITunes.EQPresets.ItemByName("Perfect")
if (-not $Preset) {
$Preset = $ITunes.CreateEQPreset("Perfect")
$Preset.Band1 = 3
$Preset.Band2 = 6
$Preset.Band3 = 9
$Preset.Band4 = 7
$Preset.Band5 = 6
@dacci
dacci / buildspec.yml
Created March 14, 2020 06:00
AWS CodeBuild build spec for CloudFormation template project.
version: 0.2
phases:
install:
runtime-versions:
python: 3.8
commands:
- pip install cfn-lint
- cfn-lint -I -u
pre_build:
@dacci
dacci / IAMSelfManageCredentials.policy.json
Created March 27, 2020 06:29
Allows an IAM user to manage their own credentials.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:ListVirtualMFADevices",
"iam:GetAccountSummary"
@dacci
dacci / AwsLambdaAppender.java
Last active June 28, 2020 10:45
Logback appender for AWS Lambda
package org.dacci;
import com.amazonaws.services.lambda.runtime.LambdaLogger;
import com.amazonaws.services.lambda.runtime.LambdaRuntime;
import com.amazonaws.services.lambda.runtime.LambdaRuntimeInternal;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.UnsynchronizedAppenderBase;
import ch.qos.logback.core.encoder.Encoder;
@dacci
dacci / .eslintrc.yml
Last active February 28, 2021 09:49
TypeScript project template for AWS Lambda
---
env:
es2020: true
jest/globals: true
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.json
plugins:
- jest
- '@typescript-eslint'
@dacci
dacci / index.js
Created November 23, 2020 16:16
Spring Initializr all dependencies
'use strict';
const fs = require('fs');
const axios = require('axios').default;
const client = axios.create({
baseURL: 'https://start.spring.io',
});
(async () => {
@dacci
dacci / brew-deps.sh
Last active September 25, 2021 16:07
homebrew formula dependency graph
#!/bin/bash
echo digraph homebrew '{'
while read formula; do
while read dependent; do
echo " \"$dependent\" -> \"$formula\""
done < <(brew uses $formula --installed)
done < <(brew list --formulae)
@dacci
dacci / .eslintrc.yml
Last active February 26, 2022 03:12
AWS CDK TypeScript application.
---
env:
es2020: true
jest/globals: true
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.json
plugins:
- jest
- '@typescript-eslint'
@dacci
dacci / Dockerfile
Created May 8, 2021 16:55
CentOS 8 with systemd enabled
FROM centos:8
CMD ["/sbin/init"]
STOPSIGNAL SIGRTMIN+3
RUN systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service systemd-udev-trigger.service systemd-udevd.service systemd-random-seed.service systemd-machine-id-commit.service kdump.service
RUN dnf -y install procps-ng && dnf clean all