Skip to content

Instantly share code, notes, and snippets.

View fumiyas's full-sized avatar
💭
> 突然の死 <

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
$ cat build.sh
container=$(buildah from alpine)
mnt=$(buildah mount $container)
set -ex; mkdir -p $mnt/work; touch $mnt/work/foo
container2=$(buildah from alpine)
mnt2=$(buildah mount $container2)
set -ex;mkdir -p $mnt2/work
cp $mnt/work/foo $mnt2/work/
@JM1
JM1 / Ansible_Roles_with_OS-specific_Defaults.md
Last active May 30, 2024 12:02
Ansible Roles with OS-specific defaults

Ansible Roles with OS-specific Defaults

This Ansible guide discusses several approaches on how to set different role default variables based / depending on the host operating system aka ansible_distribution / ansible_facts.distribution or other variables. For example, a role variable image_uri should point to the latest cloud image for the host. For CentOS 8 or Red Hat Enterprise Linux (RHEL) 8 the default value should be:

@kawaz
kawaz / parallel.js
Last active May 28, 2020 04:31
Promiseの配列を {ok:true, value} か {ok:false, err} の配列にする関数。Promise.all とか Promise.race だとどれか一つのPromiseがrejectとかされた時点で全部中断されちゃうのが使いにくい時があるので。→ ES2020に入ってくる Promise.allSettled() がほぼ同じ感じの関数になるので今後はそっちを使う事を推奨。
parallel = promises => Promise.all(promises.map(p=>new Promise(done=>{try{p.then(value=>done({ok:true,value})).catch(err=>done({ok:false,err}))}catch(err){done({ok:false,err})}})))
#!/usr/bin/env bash
CIPHERS='ALL:eNULL'
DELAY=${2:-0.1}
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]}
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}')
echo Using $(openssl version).
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites )
@kangtastic
kangtastic / md4.py
Last active June 12, 2024 23:48
An implementation of the MD4 hash algorithm in pure Python 3.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2019 James Seo <james@equiv.tech> (github.com/kangtastic).
#
# This file is released under the WTFPL, version 2 (wtfpl.net).
#
# md4.py: An implementation of the MD4 hash algorithm in pure Python 3.
#
# Description: Zounds! Yet another rendition of pseudocode from RFC1320!
@ymmt2005
ymmt2005 / neco_skills.md
Last active September 24, 2023 10:59
Neco プロジェクトのスキルシート

Neco プロジェクトのスキルチェックシート

Neco は大量の物理サーバーを効率的に管理・運用することを目的とした開発プロジェクトです。 Kubernetes を中心に高度な自律運用の実現を目指しています。

本文書はプロジェクトに参加しているメンバーが身に着けている要素技術を並べたものです。

応募時点ですべてを身に着けている必要はまったくありません。 社内にはチュートリアル資料が多数用意されていますので、必要に応じて学べます。

@kawaz
kawaz / plaubook-install-docker.yml
Created September 21, 2018 02:23
Dockerを入れるプレイブック。docker-compose とか最新バージョンを取れるようにした。
- hosts: all
become: yes
tags: docker
tasks:
- name: docker install
block:
- name: install docker
yum: name=docker
- name: enable service (upstart)
service: name=docker state=started enabled=yes
@dimaryaz
dimaryaz / dropbox_ext4.c
Created August 15, 2018 07:28
Dropbox ext4 hack
/*
* dropbox_ext4.c
*
* Compile like this:
* gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c
*
* Run Dropbox like this:
* LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd
*/
@mattn
mattn / ipset.bat
Created March 9, 2018 04:18
IPを切替えるバッチ(sudo for Windows 必須)
@echo off
setlocal enabledelayedexpansion
set ifname="ローカル エリア接続"
set count=0
if "%1" equ "" (
for /F "tokens=1,2,3,4,5 delims=," %%i in (%~dp0ipset.csv) do (
set "n=00!count!"
echo !n:~-2! %%i %%j