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
https://apn-checklists.s3.amazonaws.com/foundational/partner-hosted/partner-hosted/CVLHEC5X7.html#prerequisites
server:
http_listen_port: 9080
grpc_listen_port: 0
clients:
- url: "http://10.36.19.72:3100/loki/api/v1/push"
positions:
filename: /opt/promtail/positions.yaml
[Unit]
Description=ROT13 demo service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=centos
#!/usr/bin/env bash
set -e
# Setup
if command -v docker-compose &> /dev/null
then
dccmd='docker-compose'
else
dccmd='docker compose'
fi
#!/usr/bin/env bash
set -e
cat << "EOF"
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
Recording Rule Example 1
================================
# Aggregating up requests per second that has a path label:
- record: instance_path:requests:rate5m
expr: rate(requests_total{job="myjob"}[5m])
- record: path:requests:rate5m
expr: sum without (instance)(instance_path:requests:rate5m{job="myjob"})
Recording Rule Example 2
@kenichi-shibata
kenichi-shibata / GITHUB_LAST_PAGE.sh
Created March 1, 2022 11:04
get last page of github list repos
# https://www.middlewareinventory.com/blog/github-list-all-repositories-using-rest-api/
# get last page of github list repos
set -euo pipefail
export ORG= "" your orgname
export BASEURL="https://api.github.com/orgs/$ORG/repos"
export USERNAME="" # your username
export TOKEN="" # your github token
@kenichi-shibata
kenichi-shibata / QEMU_ON_M1.md
Created January 26, 2022 09:31 — forked from citruz/QEMU_ON_M1.md
Create Ubuntu and Windows VMs with QEMU on Apple Silicon

Running Linux and Windows on M1 with QEMU

30.11.2020: Updated with the new patchseries and instructions for Windows

02.12.2020: Added tweaks

08.12.2020: Updated with patchseries v4

31.01.2020: Updated with patchseries v6

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

@kenichi-shibata
kenichi-shibata / better-nodejs-require-paths.md
Created November 22, 2021 10:49 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions