Skip to content

Instantly share code, notes, and snippets.

View mmizutani's full-sized avatar

Minoru Mizutani mmizutani

  • Tokyo
  • 07:00 (UTC +09:00)
View GitHub Profile
@ciaranmcnulty
ciaranmcnulty / notes.md
Last active March 25, 2024 06:36
Notes on using Docker on ARM Macs (November 2021)

Docker for Mac

On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker) might require Rosetta.

Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)

Pulling and running with Docker

Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli image has the following digests:

@AzureMarker
AzureMarker / multiple_interfaces.rs
Created September 28, 2021 01:37
A proof-of-concept for accessing the same shaku component through multiple interfaces.
use shaku::{module, Component, HasComponent, Interface, Module, ModuleBuildContext};
use std::sync::Arc;
trait Fizz: Interface {
fn fizz(&self);
}
trait Buzz: Interface {
fn buzz(&self);
}
@davidfowl
davidfowl / .NET6Migration.md
Last active April 11, 2024 02:02
.NET 6 ASP.NET Core Migration
@yuki777
yuki777 / sssh
Last active June 30, 2023 06:00
aws ecs login script version 1
sssh is currently being maintained at pj8/sssh
https://github.com/pj8/sssh
@JohnLaTwC
JohnLaTwC / template_injection.yara
Created May 8, 2020 17:16
Word OXML Template Injection
rule gen_injected_template_Word
{
meta:
description = "Detects injected templates in DOCX"
author = "John Lambert @JohnLaTwC"
date = "2020-05-03"
hash1 = "a3eca35d14b0e020444186a5faaba5997994a47af08580521f808b1bb83d6063"
hash2 = "a275dfa95393148bb9e0ddf5346f9fedcc9c87fa2ec3ce1ec875843664c37c89"
hash3 = "ed4835e5fd10bbd2be04c5ea9eb2b8e750aff2ef235de6e0f18d369469f69c83"
file_protocol_hash1 = "ac6c1df3895af63b864bb33bf30cb31059e247443ddb8f23517849362ec94f08 (settings.xml.rels)"
@TylerRick
TylerRick / detailed_hash_diff.rb
Last active July 22, 2022 18:25 — forked from fabriciofreitag/detailed_hash_diff.rb
Custom RSPec matcher for detailed hash compasion and diff
require 'facets/hash/recurse'
# Usage:
# expect(actual).to match_hash(expected)
#
RSpec::Matchers.define :match_hash do |expected|
match do |actual|
# Sort hashes before comparing so that the diff only shows actual changes between keys and
# values.
actual = actual.recurse {|h| h.sort_by {|k,v| k.to_s }.to_h }
version_info: "0"
resources:
- "@type": type.googleapis.com/envoy.api.v2.Cluster
name: targetCluster
connect_timeout: 0.25s
lb_policy: ROUND_ROBIN
type: EDS
eds_cluster_config:
service_name: localservices
eds_config:
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@kenmori
kenmori / TypeScriptPractice.md
Last active May 1, 2024 06:02
TypeScript 練習問題集
@minamijoyo
minamijoyo / hoge.rb
Last active May 1, 2024 01:30
Using GitHubPrivateRepositoryReleaseDownloadStrategy removed in brew v2
require "formula"
require_relative "lib/private_strategy"
class Hoge < Formula
homepage "https://github.com/yourcompany/hoge"
url "https://github.com/yourcompany/hoge/releases/download/v0.1.0/hoge_v0.1.0_darwin_amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
sha256 "6de411ff3e4b1658a413dd6181fcXXXXXXXXXXXXXXXXXXXX"
head "https://github.com/yourcompany/hoge.git"
version "0.1.0"