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
@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
@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:

Bootstrap

Init:

gotk bootstrap github \
  --owner=gitopsrun \
  --repository=fleet-infra \
  --branch=main \
  --team=dev \
@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:
@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.

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@erhangundogan
erhangundogan / index.js
Created December 5, 2017 13:43
AWS Lambda HTTP basic auth
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
@amarao
amarao / blame-praise.py
Last active September 23, 2024 02:22
Example of argparse with subparsers for python
#!/usr/bin/env python
import argparse
def main(command_line=None):
parser = argparse.ArgumentParser('Blame Praise app')
parser.add_argument(
'--debug',
action='store_true',
help='Print debug info'
@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

@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 |