Skip to content

Instantly share code, notes, and snippets.

View bells17's full-sized avatar

bells17 bells17

View GitHub Profile
@bells17
bells17 / .gitconfig
Last active January 21, 2023 07:53
.gitconfig
[user]
name = bells17
email = bells171@gmail.com
[include]
path = .gitconfig.local
[commit]
gpgsign = true # gpg keyで署名していないなら外す
[init]
defaultBranch = main
[core]
$ kind create cluster
$ docker exec -it kind-control-plane bash
# apt-get update -y
# apt-get install -y curl jq python3 python3-pip python3-setuptools
# pip3 --no-cache-dir install yq
# cat /etc/kubernetes/admin.conf | yq -r .users[0].user.\"client-certificate-data\" | base64 -d > /tmp/cacert.pem
# cat /etc/kubernetes/admin.conf | yq -r .users[0].user.\"client-key-data\" | base64 -d > /tmp/key.pem
# curl -k --cert /tmp/cacert.pem --key /tmp/key.pem https://$(kubectl get node kind-control-plane -o jsonpath="{.status.addresses[0].address}"):10250/metrics/resource
@bells17
bells17 / commands.txt
Last active January 15, 2020 02:46
containerd-k8s
# containerd
cat > /etc/modules-load.d/containerd.conf <<EOF
overlay
br_netfilter
EOF
modprobe overlay
modprobe br_netfilter
# Setup required sysctl params, these persist across reboots.
@bells17
bells17 / main.go
Last active February 4, 2020 11:22
fetch pod & node
package main
import (
"bytes"
"flag"
"fmt"
"html/template"
"os"
"path/filepath"
@bells17
bells17 / cmd.md
Last active September 25, 2019 06:37

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#container-v1-core にある

ports

List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Cannot be updated.

の確認

@bells17
bells17 / argo-sample.txt
Created June 17, 2019 09:26
argo-sample.txt
# install argo cli
$ brew install argoproj/tap/argo
# install argo workflows to kuberenets
$ kubectl create ns argo
$ kubectl apply -n argo -f https://raw.githubusercontent.com/argoproj/argo/v2.2.1/manifests/install.yaml
# hello world
$ argo submit --watch https://raw.githubusercontent.com/argoproj/argo/master/examples/hello-world.yaml
@bells17
bells17 / lint.pm
Created March 18, 2017 15:20
Perl::Lint sample
use Perl::Lint;
use Data::Dumper;
$Data::Dumper::Terse = 1;
my $linter = Perl::Lint->new;
my $violations = $linter->lint([@ARGV]);
print Dumper $violations;
@bells17
bells17 / file0.txt
Last active March 16, 2016 16:55
Mongo Shell 徹底入門 基礎編 ref: http://qiita.com/bells17/items/8c1930f3cd9589f976a9
> db.users.findOne({_id: ObjectId("56e97630e62ae590e0d545a3")})
{
"_id" : ObjectId("56e97630e62ae590e0d545a3"),
"name" : "sample-user",
"password" : "password",
"created_at" : ISODate("2016-03-16T15:05:10.925Z"),
"updated_at" : ISODate("2016-03-16T15:05:10.925Z")
}
@bells17
bells17 / file0.txt
Created July 17, 2015 05:57
mongooseでSchema定義してないpropertyに値をセットする ref: http://qiita.com/bells17/items/cafe8f0b3e285e9e8ab4
var somethingSchema = new Schema({
field: String
});
var Something = mongoose.model('Something', somethingSchema);
var something = new Something();
something.not_defined_field = 'Not defined field value';
something('not_defined_field'); // -> undefined
something.not_defined_field; // -> undefined
@bells17
bells17 / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console