Skip to content

Instantly share code, notes, and snippets.

View kenichi-shibata's full-sized avatar
🇯🇵
working

Kenichi Shibata kenichi-shibata

🇯🇵
working
View GitHub Profile
@tomgp
tomgp / expand.js
Last active March 21, 2018 13:11
uses of reduce
var arr = [
{count:20, type:'a'},
{count:19, type:'b'},
{count:8, type:'c'},
{count:34, type:'d'}
];
var expanded = arr.reduce(function(value, d){
var l = new Array( Number(d.count) )
for(var i=0;i<d.count;i++){
@addoull
addoull / onedark.vim
Created September 28, 2016 14:02
Change cterm colors to get a better color shceme
" Vim Color File
" Name: onedark.vim
" Maintainer: https://github.com/joshdick/onedark.vim/
" License: The MIT License (MIT)
" Based On: https://github.com/MaxSt/FlatColor/
" A companion [vim-airline](https://github.com/bling/vim-airline) theme is available at: https://github.com/joshdick/airline-onedark.vim
" +-----------------+
" | Color Reference |
@jonathanbeber
jonathanbeber / debug-deployment.yaml
Last active August 13, 2021 10:03
SMI traffic split with Linkerd2. Resources used on https://jonathanbeber.github.io/post/smi-traffic-split/
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: debug
name: debug
spec:
replicas: 1
selector:
matchLabels:

Bootstrap

Init:

gotk bootstrap github \
  --owner=gitopsrun \
  --repository=fleet-infra \
  --branch=main \
  --team=dev \
@kenichi-shibata
kenichi-shibata / checking_shasums.md
Created December 4, 2021 23:40 — forked from aklap/checking_shasums.md
How to check a file's shasum

##How to check file integrity with shasum


For verifying the integrity (but not authenticity of data, i.e., who authored it or the origin of the file) of a file, it is necessary to run a checksum function on the file which will output a value and compare it to a previously stored checksum value; if it matches we can be relatively confident that the file hasn't been tampered with or altered.

You might be asked to verify a file's sha1sum or sha2sum–all this means is calculating and verifying the cryptographic sha1 or sha2 hash value or digest included in the file.

###Various commands and methods for verifying shasum 1 or 2:


Organic:
In terminal run:

@0
0 / cols.txt
Created April 30, 2013 01:41
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99
@prod3v3loper
prod3v3loper / README.md
Last active June 12, 2022 05:55
ApacheBench AB Benchmark Testing

Apache Benchmark AB

Test your website and find out how it reacts if Surf 100 users at the same time and load your webpage with 10 requests each.

Information

-n requests

Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.

@rkuzsma
rkuzsma / gist:b9a0e342c56479f5e58d654b1341f01e
Last active September 19, 2022 17:16
Example Kubernetes yaml to pull a private DockerHub image
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
kubectl create secret docker-registry myregistrykey \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
@suhailpatel
suhailpatel / oreilly-live-events.py
Created December 27, 2022 17:58
A CLI to interact with the O'Reilly Live Events site
#!/usr/bin/python3
import cmd, json, sys, traceback
from collections import defaultdict
from dataclasses import dataclass
from typing import List, Dict
import requests
# This is part of Suhail's talk on the Infrastructure and Ops Superstream
# track for O'Reilly
@haircut
haircut / Install PIP to user site on macOS.md
Created August 29, 2017 21:50
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note