This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*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"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent any | |
stages { | |
stage ('Checkout') { | |
steps { | |
script { | |
git credentialsId: 'github-creds', url: 'https://github.com/AshishThakur/java.git' | |
} | |
} | |
} |