Skip to content

Instantly share code, notes, and snippets.

View sureshmelvinsigera's full-sized avatar

Suresh Melvin Sigera sureshmelvinsigera

View GitHub Profile

Step by Step guide to install Jenkins on Amazon Linux.

1

Prerequisites:

Minimum hardware requirements:

  • 256 MB of RAM Enough for doing proof of concept (POC).
  • 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container) Recommended hardware configuration for a small team:
  • 4 GB+ of RAM.
  • 50 GB+ of drive space. Software requirements:

Best Practices to build Java Container

  1. Use explicit and deterministic Docker base image tags
  2. Install only what you need in production in the Java container image
  3. Find and fix security vulnerabilities in your Java Docker image
  4. Use multi-stage builds
  5. Don’t run Java apps as root
  6. Properly handle events to safely terminate a Java application
  7. Gracefully tear down Java applications
  8. Use .dockerignore
@sureshmelvinsigera
sureshmelvinsigera / jwtRS256.sh
Created October 24, 2023 14:48 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@sureshmelvinsigera
sureshmelvinsigera / CKAD_Notes.txt
Created August 15, 2023 20:29 — forked from iamavnish/CKAD_Notes.txt
CKAD Cheatsheet
# Good Links
http://www.yamllint.com/
https://youtu.be/02AA5JRFn5w
#########################################
minikube
#########################################
minikube start
minikube status
minikube stop
@sureshmelvinsigera
sureshmelvinsigera / Beautiful Soup_Test.ipynb
Created January 11, 2023 15:15 — forked from mrsockless/Beautiful Soup_Test.ipynb
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## Create a function called mult that has two parameters, the first is required and should be an integer, the second is an optional parameter that can either be a number or a string but whose default is 6. The function should return the first parameter multiplied by the second.
def mult(a,b=6):
return a*b
@sureshmelvinsigera
sureshmelvinsigera / complex-python-lambdas.py
Created November 18, 2022 15:44 — forked from RHDZMOTA/complex-python-lambdas.py
An updated version of George Lydakis python script on lambda functions: http://ldkge.com/complex-python-lambdas.html
_ = (
lambda: [
_
# Imports
for sys in [__import__('sys')]
for math in [__import__('math')]
# Helper functions
for sub in [lambda *vals: None]
for fun in [lambda *vals: vals[-1]]
@sureshmelvinsigera
sureshmelvinsigera / python_tests_dir_structure.md
Created November 17, 2022 16:21 — forked from tasdikrahman/python_tests_dir_structure.md
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@sureshmelvinsigera
sureshmelvinsigera / config.py
Created November 7, 2022 18:06 — forked from ZacharyMcGuire/config.py
Using a database configuration file to connect to PostgreSQL using SQLAlchemy python library.
# config.py
# returns a dictionary based on the provided section in the provided .ini file (defaults to database.ini and postgresql)
from configparser import ConfigParser
def config(filename='database.ini', section='postgresql'):
# create a parser
parser = ConfigParser()
# read config file
parser.read(filename)