Skip to content

Instantly share code, notes, and snippets.

View rasheedamir's full-sized avatar

Rasheed Amir rasheedamir

View GitHub Profile
@rasheedamir
rasheedamir / tiltfiles-collection.md
Last active January 20, 2024 14:56
tiltfiles-collection
# note that helm tempates are converted into yaml and a kubectl apply is run on the yaml object, ie `helm ls` will not show anything

# TODO move these to config files
settings = {
  "start_kind": True,
  "preload_images_for_kind": True,
  "deploy_metallb": True,
  "deploy_ambassador_api": False,
  "deploy_ambassador_edge_gateway": False,
@rasheedamir
rasheedamir / Log Management.md
Last active May 31, 2023 09:19
Log Management: elastic-search, logstash & kibana (ELK)!

The Log!

Setup a Log Management Solution with the ELK Stack

Logstash is an open source tool for collecting, parsing, and storing logs for future use. Kibana 3 is a web interface that can be used to search and view the logs that Logstash has indexed. Both of these tools are based on Elasticsearch. Elasticsearch, Logstash, and Kibana, when used together is known as an ELK stack.

@rasheedamir
rasheedamir / Install & Configure SonarQube.md
Last active May 29, 2023 15:58
Install & Configure SonarQube

Create Amazon EC2 Instance

  • Ensure that inbound MySQL port 3306 is opened
  • chmod 700 "keypair-name.pem"

Install MySQL

To install MySQL, run the following command from a terminal prompt:

  • sudo apt-get install mysql-server

I started like this!

apiVersion: v2
name: falco
description: A Helm chart of falco for Kubernetes
dependencies:
  - name: falco
    version: 3.1.0
    repository: https://falcosecurity.github.io/charts
@rasheedamir
rasheedamir / nexus3-error-logs.md
Created December 18, 2022 21:58
nexus3 error logs
2022-12-18 21:50:17,253+0000 INFO [qtp360473902-6441] *UNKNOWN org.github.flytreeleft.nexus3.keycloak.plugin.KeycloakAuthenticatingRealm - doGetAuthenticationInfo: Convert username helm-user to lower case
2022-12-18 21:50:17,261+0000 INFO [qtp360473902-6441] *UNKNOWN org.github.flytreeleft.nexus3.keycloak.plugin.KeycloakAuthenticatingRealm - doGetAuthenticationInfo failed: Unexpected response from server: 401 / Unauthorized
org.github.flytreeleft.nexus3.keycloak.plugin.internal.http.HttpResponseException: Unexpected response from server: 401 / Unauthorized
at org.github.flytreeleft.nexus3.keycloak.plugin.internal.http.HttpMethod.execute(HttpMethod.java:65)
at org.github.flytreeleft.nexus3.keycloak.plugin.internal.http.HttpMethodResponse$2.execute(HttpMethodResponse.java:37)
at org.github.flytreeleft.nexus3.keycloak.plugin.internal.KeycloakAdminClient.obtainAccessToken(KeycloakAdminClient.java:97)
at org.github.flytreeleft.nexus3.keycloak.plugin.internal.NexusKeycloakClient.authenticate(NexusKeycloakClient
@rasheedamir
rasheedamir / DDD, CQRS & ES.md
Last active January 25, 2022 12:09
DDD, CQRS & ES!

To implement command processing we need the following pieces:

  • Commands which request that something should happen, i.e. some state change
  • Events which indicate that something has happened
  • Aggregates that handles Commands and generates Events based on the current state
  • Event store which stores all events that has happened
  • Application services that receives Commands and routes it to the appropriate aggregate

https://github.com/rasheedamir/event-sourcing-in-practice

Prepare for the 'Bare Metal' environment on vSphere

  1. Copy the rhcos-X.X.X-x86_64-installer.x86_64.iso & Red Hat Enterprise Linux 8 iso to an ESXi datastore
  2. Create a new Port Group called 'OCP' under Networking
  3. Create 3 Control Plane virtual machines with minimum settings:
    • Name: ocp-cp-# (Example ocp-cp-1)
    • 8vcpu
    • 32GB RAM
    • 120GB HDD
  • NIC connected to the OCP network
@rasheedamir
rasheedamir / App.java
Created August 23, 2017 05:35 — forked from thomasdarimont/App.java
Example for using the keycloak Spring Security Adapter (2.4.0.Final) with a Bearer-only Spring Boot App deployed in JBoss EAP
package de.tdlabs.examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
@SpringBootApplication
public class App extends SpringBootServletInitializer {
@rasheedamir
rasheedamir / Software Load Balancers.md
Last active July 10, 2020 08:01
Software Load Balancers - Apache vs HAProxy or Nginx

Why use frontend server (Apache or HAProxy or Nginx)?

Scalability - You can load balance multiple instances of your application behind front end server. This will allow you to handle more volume, and increase stability in the event one of your instances goes down.

Security - Apache, Tomcat, and Glassfish all support SSL, but if you decide to use Apache, most likely thats where you should configure it. If you want additional protection against attacks (DoS, XSS, SQL injection, etc.) you can install the mod_security web application firewall.

Additional Features - Apache has a bunch of nice modules available for URL rewriting, interfacing with other programming languages, authentication, and a ton of other stuff.

Clustering - By using Apache HTTP as a front end you can let Apache HTTP act as a front door to your content to multiple Apache Tomcat instances. If one of your Apache Tomcats fails, Apache HTTP ignores it and your Sysadmin can sleep through the nigh

@rasheedamir
rasheedamir / troubleshooting.md
Last active March 10, 2020 09:21
troubleshooting collection
FILE # 1

#!groovy

String GIT_VERSION

node {

  def buildEnv