Skip to content

Instantly share code, notes, and snippets.

@jidckii
jidckii / haproxy.cfg
Created November 10, 2017 09:26
haproxy.cfg
global
daemon
maxconn 4096
log 172.17.0.1:514 local0
stats socket /var/run/haproxy.sock mode 600
defaults
log global
retries 7
option httplog
@jidckii
jidckii / install_go_pi.sh
Last active January 11, 2019 16:45 — forked from random-robbie/install_go_pi.sh
Install Go Lang on Raspberry Pi 3
#!/bin/sh
# For install
# curl -sSL raw_url | sh
GO_VERSION_DEFAULT=1.11.4
if [ -z "$GO_VERSION" ]; then
GO_VERSION=$GO_VERSION_DEFAULT
fi
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
client:
url: http://localhost:3100/api/prom/push
version: "3"
networks:
loki:
services:
promtail:
image: grafana/promtail:latest
restart: always
volumes:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
* * * * * $(docker ps -a --filter=label=io.yucca.task --format '- targets: ["{{.ID}}"]\n labels:\n container_name: "{{.Names}}"\n task_id: "{{.Label "io.yucca.task"}}"\n job: "containers"' > /opt/loki/promtail/promtail-targets.yaml)
@jidckii
jidckii / Display current git branch in bash prompt
Last active June 28, 2019 12:02
Display current git branch in bash prompt
# Display current git branch in bash prompt
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_blue=`tput setaf 4`
c_sgr0=`tput sgr0`
parse_git_branch ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
@jidckii
jidckii / DVRIP-Sonia Reference Codes.md
Created October 15, 2019 07:45 — forked from ekwoodrich/DVRIP-Sonia Reference Codes.md
Reference codes for the DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

DVRIP/Sonia Protocol

DVRIP/Sonia TCP protocol used by the Net Surveillance ActiveX plugin

1. Response Codes

Return code Definition
100 Success
101 Unknown error
102 Version not supported
103 Illegal request
@jidckii
jidckii / README.md
Last active May 10, 2020 03:52
Xiaomi YI Home Camera 720p
@jidckii
jidckii / graylog_rules.md
Last active August 10, 2021 12:40
Graylog rules

Fix problem graylog failed to parse field level of type long

Stage 0

rule "remove new line"
when
  has_field("message")
then
@jidckii
jidckii / SetupCustomGraylogMappings.md
Last active August 10, 2021 12:40
Setup Custom Graylog Mappings

Fix problem graylog failed to parse field level of type long

cat << EOF > graylog-custom-mapping.json
{
  "template": "graylog_*",
  "mappings" : {
    "properties" : {
 "level" : {