Skip to content

Instantly share code, notes, and snippets.

View v5tech's full-sized avatar
🎯
Focusing

v5tech

🎯
Focusing
  • Xi'an China
  • 15:48 (UTC +08:00)
View GitHub Profile
FLOAT %{INT}\.[0-9]+
GC_TAG [^)]+
GC_TYPE [a-z-]+
GC_MEMORY_UNIT K|M|G
JVMGCLOG %{TIMESTAMP_ISO8601:logdate}: %{FLOAT}: \[GC( %{GC_TYPE})?( \(%{GC_TAG}\))* ?( %{INT:gc_memory_before:int}%{GC_MEMORY_UNIT:gc_memory_before_unit}->%{INT:gc_memory_after:int}%{GC_MEMORY_UNIT:gc_memory_after_unit}\(%{INT}%{GC_MEMORY_UNIT}\))?, %{FLOAT:gc_duration:float} secs\]
JVM_GC_STOPPED_TIME %{TIMESTAMP_ISO8601:logdate}: %{FLOAT}: Total time for which application threads were stopped: %{FLOAT:gc_app_stopped:float} seconds, Stopping threads took: %{FLOAT:gc_stopping_took:float} seconds
@pgstenberg
pgstenberg / logstash-local.conf
Created May 15, 2016 18:28
logstash configuration example for kafka consuming logs
input {
syslog {
type => "haproxy-access"
port => 5000
}
log4j {
mode => "server"
host => "0.0.0.0"
port => 3456
type => "zookeeper"
@vmwarecode
vmwarecode / snippet.js
Created July 14, 2016 04:14
Showing Web Console of a VM via vSphere HTML Console SDK
<html>
<head lang="en">
<meta charset="UTF-8">
<title>VM Web Console</title>
<!-- common js/css lib -->
<link href="css/wmks-all.css" rel="stylesheet" type="text/css" />
<link href="css/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="lib/jquery-1.8.3.min.js"></script>
<script src="lib/jquery-ui-1.8.16.min.js"></script>
@TomyJaya
TomyJaya / spring-data-rest-notes.md
Last active August 13, 2025 22:52
Spring Data REST - Useful notes

How To change baseUri:

in application.properties add:

spring.data.rest.basePath=/api
  • or -

in application.yml add:

@troyharvey
troyharvey / deployment.yml
Last active April 7, 2026 13:20
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@magnetikonline
magnetikonline / README.md
Last active November 24, 2024 15:55
Bash getopt long options with values usage example.

Bash getopt long options with values usage example

#!/bin/bash -e

ARGUMENT_LIST=(
  "arg-one"
  "arg-two"
  "arg-three"
)
@superseb
superseb / cleanup.sh
Last active November 26, 2025 14:21
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
# OUTDATED: please refer to the link below for the latest version:
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@danielepolencic
danielepolencic / README.md
Last active February 26, 2026 10:28
Create 3 nodes Kubernetes cluster locally with Vagrant

3 Virtual Machines Kubernetes cluster

Dependencies

You should install VirtualBox and Vagrant before you start.

Creating the cluster

You should create a Vagrantfile in an empty directory with the following content:

@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active April 10, 2026 15:21
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@luzihang123
luzihang123 / sensitive_pic.py
Created November 2, 2018 09:23
爬虫敏感图片的识别与过滤
from functools import reduce
from PIL import Image
import requests
# 计算pHash(只需要三行):
def phash(img):
img = img.resize((8, 8), Image.ANTIALIAS).convert('L')
avg = reduce(lambda x, y: x + y, img.getdata()) / 64.
return reduce(
lambda x, y: x | (y[1] << y[0]),