Skip to content

Instantly share code, notes, and snippets.

@jmatsushita
jmatsushita / README
Last active November 8, 2024 16:52
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@aserhat
aserhat / 0 - setup
Last active November 2, 2024 19:27
QEMU and HVF
# Summary
A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux
I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc.
The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking.
# Installations
brew install qemu (For controlling Hypervisor Framework)
brew install cdrtools (For making cloud init iso's)
http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking)
@npearce
npearce / install-docker.md
Last active November 11, 2024 13:09
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@shettyg
shettyg / gist:455ff78605ea4c45febe7b5aa345c87d
Created May 14, 2018 17:33
Ubuntu cloud images and virt-manager
* How to create a Ubuntu VM on your local Ubuntu KVM from Ubuntu cloud images.
1. Get the ubuntu cloud image (.img file from)
mkdir temp; cd temp;
wget http://cloud-images.ubuntu.com/trusty/20140101.55/trusty-server-cloudimg-amd64-disk1.img
2. Create a file "seed"
@andy-dufour
andy-dufour / .kitchen.windows.yml
Created August 18, 2015 14:46
Windows opentable image kitchen yml
transport:
name: winrm
provisioner:
name: chef_zero
#require_chef_omnibus: 11.16.4
require_chef_omnibus: 12.4.0
# Obtained from https://www.chef.io/chef/metadata?p=windows&m=x86_64&pv=2012r2&v=12.4.0
chef_metadata_url: 'file:///c:/share/chef/metadata/windows_v12.4.0.txt'
client_rb:
@tyler-ball
tyler-ball / gist:f7c16e814265f34260e9
Last active March 14, 2016 23:15
Test Kitchen Shared Examples

Create the following folder structure in your cookbook:

test
└── integrationq
    ├── helpers
    │   ├── serverspec
    │   │   ├── shared_serverspec_tests
    │   │   │   └── shared_tests2.rb
    │   │   └── spec_helper.rb

Chef Server HA and DRBD Split Brain Recovery

The default recovery settings for DRBD on the Chef Server will take care of split brain scenarios most of the time. The following are steps that you can take to manually recover a split brain. Before following any of the steps read the entire document through completely.

Determine the cluster health

The Chef Server ships with helper commands to determine the current ha-status of the Server. DRBD ships with utilities to determine and control the state DRBD. First you'll want to check the DRBD status and ha-status of both backend nodes and determine which steps you'll need to take for remediation.

Determine the HA status

$: chef-server-ctl ha-status

@smford22
smford22 / workshop_notes.md
Last active August 29, 2015 14:14
DeveloperWeek SF 2015 - Build an Awesome Application with Chef

Use Chef to Deploy an Awesome Application

Local Development Setup

This section is for configuring your local workstation with the tools you need to write Chef code. You will need to install the following:

  1. ChefDK (Developers Kit) - Contains the most common tools you need to write Chef code.
  2. Vagrant -
  3. VirtualBox

A Quick Tour of A Chef Client Run Internals

Dan DeLeo appeared on the FoodFightShow some time ago to walk through "what a Chef run really does". I expanded on these remarks in my personal investigation.

/usr/bin/chef-client

  • bin/chef-client creates a new Chef::Application::Client (subclass of Chef::Application which sets up common things like loggers across chef-client, chef-solo, knife, etc.) then jump to:

  • lib/chef/client.rb

  • application classes create a new Chef::Client object, which calls initialize().

@afiune
afiune / Kitchen Driver: EC2 Windows support
Last active May 9, 2018 21:54
Making test-kitchen/kitchen-vagrant works with WindowsGuest using WinRM protocol [Progress]
salimafiune@afiunechef:~/github/tk-windows
$ kitchen list
Instance Driver Provisioner Last Action
default-windows-2008R2-SP1 Ec2Windows ChefZero Converged
salimafiune@afiunechef:~/github/tk-windows
$ kitchen destroy
-----> Starting Kitchen (v1.3.0)
-----> Destroying <default-windows-2008R2-SP1>...
EC2 instance <i-923c0ab9> destroyed.
Finished destroying <default-windows-2008R2-SP1> (0m2.43s).