Skip to content

Instantly share code, notes, and snippets.

@m-mizutani
m-mizutani / logger.go
Created February 11, 2023 02:10
reconfigurable slog logger
package utils
import (
"io"
"os"
"sync"
"github.com/m-mizutani/goerr"
"golang.org/x/exp/slog"
)
@m-mizutani
m-mizutani / zenv.fish
Created July 9, 2022 02:09
zenv で secret の補完をするやつ
complete -c zenv -n '__fish_use_subcommand' -xa '(zenv secret list)' -d 'Secret'
@m-mizutani
m-mizutani / main.go
Created May 22, 2022 01:19
構造化エラーハンドリングのサンプル
package main
import (
"errors"
"github.com/m-mizutani/goerr"
"github.com/rs/zerolog/log"
)
type Request struct {
@m-mizutani
m-mizutani / masayoshi-mizutani-bio.md
Last active July 23, 2020 11:58
Masayoshi Mizutani

Masayoshi Mizutani

mizutani-photo

Overview

Masayoshi Mizutani is a security engineer. In university, he was studying and researching about network-based intrusion detection system and malware analysis. After graduation, he worked for various projects, e.g. SIEM (Security Information & Event Manager) integration, SOC (Security Operation Centor) Analyst, building visualization system of security data and so on.

Interests

~/t/a $ cat parse.js
request = require('request')
request.get('https://ctftime.org/api/v1/events/?limit=100&start=1422019499&finish=1423029499', (err, data) => {
const jdata = JSON.parse(data.body);
console.log(jdata);
});
~/t/a $ node parse.js
[ { organizers: [ [Object] ],
onsite: false,
@m-mizutani
m-mizutani / deploy.py
Created January 5, 2018 11:17
deploy
#!/usr/bin/env python
import argparse
import zipfile
import boto3
import tempfile
import os
import yaml
import json
import stat
@m-mizutani
m-mizutani / keybase.md
Created October 23, 2017 14:17
keybase.md

Keybase proof

I hereby claim:

  • I am m-mizutani on github.
  • I am mizutani (https://keybase.io/mizutani) on keybase.
  • I have a public key whose fingerprint is E2EC 916C 576D CE86 167A 947D D276 BB13 AAAF 34EC

To claim this, I am signing this object:

@m-mizutani
m-mizutani / setup_ubuntu_xenial.sh
Last active September 8, 2017 07:15
setup script of ubuntu16.04 dev env (fish + emacs + tmux for c++, python and ruby)
#!/bin/bash
sudo apt update
sudo apt -o Dpkg::Options::='--force-confold' --force-yes -y dist-upgrade
sudo apt install -y emacs24-nox fish tmux git python-pip lv build-essential cmake \
libssl-dev libreadline-dev zlib1g-dev libbz2-dev libbz2-1.0 libsqlite3-0 libsqlite3-dev
sudo apt install -y libmsgpack3 libmsgpack-dev libpcap-dev
# setup ruby 2.4.1
git clone https://github.com/rbenv/rbenv.git $HOME/.rbenv
@m-mizutani
m-mizutani / python-tips.py
Created September 4, 2017 03:46
python tips
#!/usr/bin/env python
import datetime
import argparse
from tqdm import tqdm
def log(*args):
msg = ' '.join(map(str, [datetime.datetime.now(), '>'] + list(args)))
print(msg)
with open('log.txt', 'at') as fd: fd.write(msg + '\n')
local function keyCode(key, modifiers)
modifiers = modifiers or {}
return function()
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
hs.timer.usleep(1000)
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
end
end
local function remapKey(modifiers, key, keyCode)