Skip to content

Instantly share code, notes, and snippets.

@nrjdalal
nrjdalal / QEMU-Silicon-Mac-Virtualization.md
Last active February 1, 2024 05:31
Create Virtual Machines using QEMU on Silicon based Apple Macs

Install QEMU on Silicon based Apple Macs (June 2021)

Option 1 - Automatically

zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nrjdalal/silicon-virtualizer/master/install-qemu.sh)"

Option 2 - Manually

  • Install Xcode command line tools

xcode-select --install
FROM centos:7
RUN yum install -y -q git gcc make bzip2 openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
RUN git clone -q https://github.com/rbenv/rbenv.git /usr/local/rbenv
RUN git clone -q https://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build
ENV RBENV_ROOT "/usr/local/rbenv"
ENV RUBY_VERSION 2.4.1
RUN /usr/local/rbenv/bin/rbenv install $RUBY_VERSION
RUN /usr/local/rbenv/bin/rbenv global $RUBY_VERSION
RUN /usr/local/rbenv/shims/gem i bundler --no-document
## db/_dev.yml.liquid
type: mysql
host: 127.0.0.1
user: user
password: password
database: embulk_test
## query/_query.yml.liquid
query: |
select * from {{ target_table }}
@nownabe
nownabe / .commit_template
Created July 5, 2016 06:54
Emojiで楽しく綺麗なコミットを手に入れる
# ==== Emojis ====
# 🐛 :bug: バグ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 🎉 :tada: 盛大に祝うべき大きな機能追加
# ♻️ :recycle: リファクタリング
# 🚿 :shower: 不要な機能・使われなくなった機能の削除
# 💚 :green_heart: テストやCIの修正・改善
@tawateer
tawateer / add_dns_record.py
Last active February 10, 2016 06:05
基于私钥删除 DNS 记录
#!/bin/env python
#-*- coding: utf-8 -*-
""" 此脚本作为参考:
根据私钥增加 DNS 正向和反向记录.
"""
import os
@buty4649
buty4649 / dstat_disk_latency.py
Created November 10, 2014 11:33
dstatでディスクレイテンシ取るやつ
class dstat_plugin(dstat):
def __init__(self):
self.nick = ('latency',)
self.type = 'd'
self.width = 4
self.scale = 34
self.diskfilter = re.compile('^(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)$')
self.open('/proc/diskstats')
self.cols = 1
@hfm
hfm / how-to-librarian-puppet.md
Last active March 22, 2018 13:19
librarian-puppetの使い方

Puppet ForgeにあるPuppet modulesを管理するためのツール.

クイックスタート

準備(librarian-puppetのインストール,ひな形の生成)

gemからインストールし,initでPuppetfileのひな形を生成する

@awaxa
awaxa / common.yaml
Created July 18, 2014 18:47
using an array of hashes from hiera in a template with puppet
---
sockets:
- id: 'one'
address: '127.0.0.1'
port: '8001'
- id: 'two'
address: '127.0.0.2'
port: '8002'
@yasushiyy
yasushiyy / vagrant_coreos_docker.md
Last active January 28, 2019 11:35
Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0
@DracoBlue
DracoBlue / bash_exec.pp
Last active July 11, 2017 18:47
Small snippet to define a bash-exec type for puppet, which launches the exec with `--login` to provide a login shell (full PATH and sourced bash files).
define bash_exec (
$command = $name,
$user,
$creates = undef,
$cwd = undef,
$environment = undef,
$group = undef,
$logoutput = undef,
$onlyif = undef,
$path = undef,