Skip to content

Instantly share code, notes, and snippets.

View rimusz's full-sized avatar

Rimantas (Rimas) Mocevicius rimusz

View GitHub Profile
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@proppy
proppy / README.md
Last active August 1, 2016 13:32
isoc: yet another "standard" container format

isoc

isoc is yet another "standard" container format.

It brings together the best bits of Docker Image Specification 1.0 and App Container Specification 0.3.0+git into a comprehensive yet portable container archive format, at the cost of a "few" duplicated bytes.

Layout

An isoc image is a appc image embedded in a docker image, but also a docker image embedded in a appc image. Some people might describe it as an iso-contained container format.

$ actool cat-manifest --pretty-print kubelet-0.19.0.aci
{
"acKind": "ImageManifest",
"acVersion": "0.5.1",
"name": "kubelet",
"labels": [
{
"name": "version",
"value": "0.19.0"
},

Kubernetes on Rocket

API Service

/etc/systemd/system/kube-apiserver.service
[Unit]

Google Compute Engine NFS Container VM

This script creates a Container VM on Google Compute Engine running a NFS V4 server exposed on Port 2049 with the /exports directory mounted to a persistent disk. This means:

  • If the NFS VM Crashes, the persistent disk will still hold the NFS Files
  • The persistent disk can be snapshotted to backup NFS Files

To run:

@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Philmod
Philmod / cloudbuild.yaml
Created September 21, 2017 13:18
concurrent docker builds on Google Container Builder
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-f'
- 'Dockerfile.alpine'
- '-t'
- 'gcr.io/$PROJECT_ID/large-docker-alpine:latest'
- '.'
waitFor: ['-']
@ipedrazas
ipedrazas / deployment.go
Created June 25, 2018 12:51
From kubectl to GO lang type
// Generated by https://quicktype.io
type Deployment struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata DeploymentMetadata `json:"metadata"`
Spec DeploymentSpec `json:"spec"`
Status Status `json:"status"`
@alexellis
alexellis / job.yaml
Last active January 26, 2024 07:10
Use a Kubernetes Job and Kaniko to build an OpenFaaS function from Git
# Alex Ellis 2018
# Example from: https://blog.alexellis.io/quick-look-at-google-kaniko/
# Pre-steps:
# kubectl create secret generic docker-config --from-file $HOME/.docker/config.json
# Other potential optimizations (suggested by @errordeveloper)
# - Store "templates" in a permanent volume
# - Download source via "tar" instead of git clone
@mumoshu
mumoshu / helmify-kustomize
Last active April 15, 2024 10:49
Run `helmify-kustomize build $chart $env` in order to generate a local helm chart at `$chart/`, from kustomize overlay at `${chart}-kustomize/overlays/$env`
#!/usr/bin/env bash
cmd=$1
chart=$2
env=$3
dir=${chart}-kustomize
chart=${chart/.\//}
build() {