Skip to content

Instantly share code, notes, and snippets.

View tomoyk's full-sized avatar
🐳
Containerize

Tomoyuki KOYAMA tomoyk

🐳
Containerize
View GitHub Profile
input {
file {
path => "/var/log/nginx/access.*.log"
start_position => "access_pos"
sincedb_path => "/var/log/nginx/access.pos"
add_field => { "log_filename" => "%{path}" }
}
file {
path => "/var/log/nginx/error.*.log"
items:
- colors:
name: 3024 (dark)
author: Chris Kempson
primary:
background: "#090300"
foreground: "#a5a2a2"
cursor:
text: "#090300"
cursor: "#a5a2a2"

タイトルとURLをMarkdown形式でコピー

v1

javascript:a=prompt('mdlink','['+document.title+']('+document.location.href+')');a.preventDefault;

v2

import re
match_pattern = (
# '[2022-05-12T00:57:09.548Z]'
r"\[(?P<DateTime>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)]"
r' "(?P<Method>\w+)' # 'GET'
r" (?P<Path>[^ ]+)" # '/author'
r' (?P<Protocol>[^ ]+)"' # 'HTTP/1.1'
r" (?P<Status>\d{,3})" # '200'
@tomoyk
tomoyk / checker.sh
Created August 19, 2022 10:39
HTTP Monitoring Script
#!/bin/bash -eu
target_url="http://192.168.5.x/"
timeout_sec=3
logfile="logs/check.log"
mkdir logs || true
touch $logfile
while :
do
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-deployment
spec:
selector:
matchLabels:
app: mysql
template:
metadata:
from locust import HttpUser, task
import os.path
import glob
import uuid
class StartUser(HttpUser):
@task
def on_start(self):
[user]
name = tomoyk
email = [email protected]
[color]
ui = true
[alias]
st = status
df = diff
co = commit
br = branch