Skip to content

Instantly share code, notes, and snippets.

View makotom's full-sized avatar
👋
Huomiseen. Bye.

Makoto Mizukami makotom

👋
Huomiseen. Bye.
View GitHub Profile
@makotom
makotom / ps-alt.sh
Last active March 29, 2020 09:44
It's insane.
#!/bin/bash
bash -c "bash -c \"bash -c \\\"bash -c \\\\\\\":; ps xf\\\\\\\"\\\"\""
@makotom
makotom / dump-nomad.sh
Created February 26, 2020 08:24
Dump Nomad stdio
#!/bin/bash
set -eu
set -o pipefail
# Setting-up local variable
outputDir=nomad-logs-$(date +%s)
# Creating output directory
mkdir $outputDir
#!/bin/bash
set -exu
export http_proxy=""
export https_proxy=""
export no_proxy=""
export aws_instance_metadata_url="http://169.254.169.254"
export DEBIAN_FRONTEND=noninteractive
UNAME="$(uname -r)"
@makotom
makotom / upgrade-nomad-client-ubuntu.sh
Created February 17, 2020 03:34
Upgrade Nomad clients for CircleCI 2.19
#!/usr/bin/env bash
set -exu
NOMAD_VERSION="0.9.3"
DOCKER_VERSION="18.09.9"
UNAME="$(uname -r)"
export DEBIAN_FRONTEND=noninteractive
is_xenial(){
@makotom
makotom / get-bootcamp.sh
Last active February 10, 2020 23:46
Get Windows drivers for Mac
#!/bin/bash
SUCATALOG="https://swscan.apple.com/content/catalogs/others/index-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog"
MODEL_ID="MacBookPro9,1" # MBP 15-inch Mid 2012, for example
curl -sJL $SUCATALOG | grep -e 'BootCampESD\.pkg' -e '\.dist' | while read line
do
if [[ $line == *BootCampESD.pkg* ]]
then
pkgUrl=$(echo $line | sed -e 's/\s*<\/\{0,1\}string>\s*//g')
@makotom
makotom / with-session-token.diff
Created February 10, 2020 05:52
Setup circleci/enterprise-setup to work with MFA
diff --git a/circleci.tf b/circleci.tf
index 6bbb296..f8c304a 100644
--- a/circleci.tf
+++ b/circleci.tf
@@ -45,6 +45,7 @@ data "template_file" "output" {
provider "aws" {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
+ token = var.aws_session_token
region = var.aws_region
@makotom
makotom / 20200122-minmax-depth.html
Created January 28, 2020 02:59
Correct usage of min/max-width
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>min/max width</title>
<style>
@media (min-width: 800px) {
#min-width {
display: block;
background-color: #0af;
@makotom
makotom / master-visa.md
Last active December 18, 2019 03:58
Mastercard は海外に強いという説は本当か

Mastercard は海外に強いという説は本当か

tl;dr

  • 確かに有意にレートのよい通貨があるが, 逆に有意に不利な通貨もある. 一般に Mastercard のレートがよいとは言い切れない.
  • 有利度の期待値が 0.1 % のオーダー. あまり気にする価値はなさそうだ.

背景

クレジットカード オタクの界隈では, Mastercard のレートがよいということがよく言われる (日本語でぐぐるとわかる).

<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>Manipulating child window</title>
<a href="#">Click this to open <code>example.com</code> in a new window</a>
<form action="https://example.com/" target="tc-20191203-3-child"></form><!-- Navigation will occur with this form -->
<script>
document.querySelector('a[href="#"]').addEventListener('click', (evt) => {
@makotom
makotom / tc-20191203-2.html
Last active December 3, 2019 12:39
Pages will not be loaded in child windows in Firefox Preview build #13031728 and #13371033
<!doctype html>
<html lang="en">
<meta charset="UTF-8">
<title>Manipulating child window</title>
<a href="https://example.com/" target="tc-20191203-2-child">Click this hyperlink to open <code>example.com</code> in a new window</a>
<script>
{
let flipFlop = false;