Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| # COVID-19 by US County | |
| Arizona (13): | |
| Maricopa: 2 | |
| Pinal: 2 | |
| [unknown]: 9 | |
| California (426): | |
| Alameda: 2 | |
| Contra Costa: 9 | |
| Fresno: 1 |
| package mgoutil | |
| import ( | |
| "context" | |
| "github.com/mongodb/mongo-go-driver/bson" | |
| "github.com/mongodb/mongo-go-driver/mongo" | |
| "github.com/pkg/errors" | |
| ) |
| <template> | |
| <div class="inline-block" v-html="require('icon-' + this.icon + '.svg')"></div> | |
| </template> | |
| <style module> | |
| .svg { | |
| fill: currentColor; | |
| height: 1em; | |
| margin-top: -4px; | |
| vertical-align: middle; |
| #!/bin/bash | |
| # | |
| # credit: foked from https://gist.github.com/emiller/6769886 emiller/git-mv-with-history | |
| # | |
| # git-mv-with-history -- move/rename file or folder, with history. | |
| # | |
| # Moving a file in git doesn't track history, so the purpose of this | |
| # utility is best explained from the kernel wiki: | |
| # | |
| # Git has a rename command git mv, but that is just for convenience. |
Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.
Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.
| # New repository | |
| mkdir <repo> && cd <repo> | |
| git init | |
| git remote add –f <name> <url> | |
| git config core.sparsecheckout true | |
| echo some/dir/ >> .git/info/sparse-checkout | |
| echo another/sub/tree >> .git/info/sparse-checkout | |
| git pull <remote> <branch> | |
| # Existing repository |
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.
| git merge --no-commit && git checkout other-branch -- . && git commit | |
| ### https://twitter.com/adymitruk/status/69479850846593024 | |
| # We needed this once after some intense debugging on the staging branch. We knew | |
| # staging was correct and wanted to merge staging -> production and be sure that | |
| # prod branch never "won" any conflicts |
| CREATE TABLE IF NOT EXISTS `country` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `iso` char(2) NOT NULL, | |
| `name` varchar(80) NOT NULL, | |
| `nicename` varchar(80) NOT NULL, | |
| `iso3` char(3) DEFAULT NULL, | |
| `numcode` smallint(6) DEFAULT NULL, | |
| `phonecode` int(5) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; |