Skip to content

Instantly share code, notes, and snippets.

View AshishThakur's full-sized avatar
🎯
Focusing

Ashish Thakur AshishThakur

🎯
Focusing
  • Singapore
  • 21:26 (UTC +08:00)
View GitHub Profile
pipeline {
agent any
stages {
stage ('Checkout') {
steps {
script {
git credentialsId: 'github-creds', url: 'https://github.com/AshishThakur/java.git'
}
}
}
FROM jenkins/jenkins:lts-jdk11
# if we want to install via apt
USER root
RUN apt-get update \
&& apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release \
software-properties-common \
const k8s = require('@kubernetes/client-node');
const axios = require('axios').default;
const request = require('request');
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const opts = {};
kc.applyToRequest(opts);
axios.get(`${kc.getCurrentCluster().server}/apis/kpack.io/v1alpha1/images`).then(function (response) {
// handle success
console.log(response);
const k8s = require('@kubernetes/client-node');
const request = require('request');
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const opts = {};
kc.applyToRequest(opts);
request.get(`${kc.getCurrentCluster().server}/apis/kpack.io/v1alpha1/images`, opts,
*apach2 + php-fpm profiling*
ps -ylC apache2 --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
ps -ylC php-fpm --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'
from sqlalchemy import engine
from sqlalchemy import event
class DbStats():
def __init__(self):
self.clear()
def clear(self):
self.total_queries = 0
self.total_time = 0