Skip to content

Instantly share code, notes, and snippets.

@cumet04
cumet04 / LICENSE
Last active April 11, 2023 14:31
rspec-daemonできるか?
MIT License
Copyright (c) 2023 inomoto
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:
@cumet04
cumet04 / dependencies.js
Last active August 7, 2021 06:25
package.jsonのdependenciesをjsで書けたら面白いかなという試み
const _deps = {}
const _devDeps = {}
function add(deps, devDeps) {
Object.assign(_deps, (deps || {}))
Object.assign(_devDeps, (devDeps || {}))
}
const devDeps = (targets) => add({}, targets)
add({
"react": "^17.0.2",
@cumet04
cumet04 / Dockerfile
Last active August 2, 2021 15:24
テキストファイル一つだけで頒布可能なアプリケーションを作るテスト
# syntax=docker/dockerfile:1.3-labs
# usage (for gh user):
# $ docker build -t usage .
# $ docker run -it -e ACCESS_TOKEN=$(cat ~/.config/gh/hosts.yml | grep token | tr -s ' ' | cut -d' ' -f 3) usage your-org-name
FROM ruby:3.0
RUN gem install octokit
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>app</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
</head>
@cumet04
cumet04 / aws-console-gnav.css
Created May 10, 2020 13:21
aws console global-nav override css
#awsgnav #nav-servicesMenu {
padding-left: 5px;
padding-right: 5px;
}
#nav-resourceGroupsMenu, #nav-helpMenu {
display: none !important;
}
#awsgnav #nav-home-link #nav-logo {
margin-left: 10px;
margin-right: 10px;
import boto3
ec2 = boto3.client("ec2")
ssm = boto3.client("ssm")
# refs https://qiita.com/cumet04/items/5888e037105e6ea5f6bc
def lambda_handler(event, context):
try:
targets = target_instances("cron", "true")
### system side setup ----------
execute "enable docker-ce repo" do
repo = "https://download.docker.com/linux/fedora/docker-ce.repo"
command "dnf config-manager --add-repo=#{repo}"
not_if "test -e /etc/yum.repos.d/docker-ce.repo"
end
%w(
awscli
@cumet04
cumet04 / cloudSettings
Last active April 30, 2020 20:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-29T15:04:09.105Z","extensionVersion":"v3.4.3"}
@cumet04
cumet04 / ec2-k3s-install-script.sh
Created August 17, 2019 14:57
k3s cloudinit script
#!/bin/bash
K3S_VERSION=v0.8.0
BIN_DIR=/usr/local/bin
# for master
#cat > /opt/k3s_env_put.sh << 'EOF'
##!/bin/bash
#
#ip=$(hostname | cut -d'.' -f1 | cut -d'-' -f2,3,4,5 | tr '-' '.')
@cumet04
cumet04 / ts_init.sh
Created February 3, 2019 03:56
init simple typescript project
#!/bin/bash
anyenv update
LATEST_NODE=$(nodenv install -l | grep '\ 10' | tail -n 1)
nodenv install $LATEST_NODE
nodenv local $LATEST_NODE
npm install -g yarn
yarn init
yarn add -D typescript prettier