Skip to content

Instantly share code, notes, and snippets.

View rajivreddy's full-sized avatar
💻
Focusing

Rajiv Reddy rajivreddy

💻
Focusing
  • Work From Home
View GitHub Profile
@rajivreddy
rajivreddy / Large-app-how-to.md
Created September 16, 2019 09:07 — forked from cuibonobo/Large-app-how-to.md
How to structure a large application in Flask. Taken from the Flask wiki: https://github.com/mitsuhiko/flask/wiki/Large-app-how-to

Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator


This document is an attempt to describe the first step of a large project structure with flask and some basic modules:

  • SQLAlchemy
  • WTForms

Please feel free to fix and add your own tips.

@rajivreddy
rajivreddy / notifySlack.groovy
Created December 15, 2019 09:48 — forked from dschaaff/notifySlack.groovy
jenkins pipeline library for slack notifications with nice formatting
#!/usr/bin/env groovy
/**
* notify slack and set message based on build status
*/
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.model.Actionable;
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1592541972337",
"Action": [
"ses:SendBounce",
"ses:SendBulkTemplatedEmail",
"ses:SendCustomVerificationEmail",
"ses:SendEmail",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1592541972337",
"Action": [
"ses:SendBounce",
"ses:SendBulkTemplatedEmail",
"ses:SendCustomVerificationEmail",
"ses:SendEmail",
@rajivreddy
rajivreddy / nginx-tuning.md
Created August 26, 2020 08:40 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
@rajivreddy
rajivreddy / Jenkinsfile
Created April 29, 2021 09:57 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com'
}
stages {
stage('Build with unit testing') {
@rajivreddy
rajivreddy / github.sh
Created May 4, 2021 02:31 — forked from StevenACoffman/github.sh
Jenkins Scripts For Build Status to Github Pull Request
#!/bin/bash
#Jenkins provides:
#GIT_COMMIT like ce9a3c1404e8c91be604088670e93434c4253f03
#GIT_BRANCH like origin/master
#BUILD_URL like http://jenkins.test.cirrostratus.org/job/Article_View_c20n_Full_Non_Destructive_Full_Suite/1334/
# per https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin
# The jenkins pull request builder plugin (if configured) will provide these:
#ghprbPullId

Useful Commands

Get kubectl version

kubectl version

Get cluster info: