Skip to content

Instantly share code, notes, and snippets.

View goelprateek's full-sized avatar

prateek goel goelprateek

  • Lentra ai vt ltd
  • pune
View GitHub Profile
@goelprateek
goelprateek / AuthorizationServerConfiguration
Created January 8, 2025 12:58 — forked from akuma8/AuthorizationServerConfiguration
Example of Password Grant Type implementation for Spring Authorization Server: https://github.com/spring-projects/spring-authorization-server
/**
* @author Attoumane AHAMADI
*/
@Configuration(proxyBeanMethods = false)
public class AuthorizationServerConfiguration {
@Bean
@Order(Ordered.HIGHEST_PRECEDENCE)
public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http,
UserDetailsService userDetailsService,
@goelprateek
goelprateek / ca.md
Created August 13, 2019 19:15 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@goelprateek
goelprateek / supervisor.md
Last active August 3, 2019 13:58
Supervisor for Monitoring the Service

$ sudo apt-get install supervisor

After that, you can check if the supervisor daemon is running, you can do the following $ sudo supervisorctl supervisor>

If you see the prompt, that means it is installed and running successfully. Otherwise, you can start the service by yourself: $ sudo service supervisor start

@goelprateek
goelprateek / generate-ssh-key.sh
Created April 28, 2019 12:48 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@goelprateek
goelprateek / fix.sh
Created April 24, 2019 15:59 — forked from TheBeachMaster/fix.sh
Fix Docker WARNING: bridge-nf-call-iptables is disabled on Centos
$ sudo sysctl net.bridge.bridge-nf-call-iptables=1
$ sudo sysctl net.bridge.bridge-nf-call-ip6tables=1
@goelprateek
goelprateek / delete-from-v2-docker-registry.md
Created December 6, 2018 08:36 — forked from jaytaylor/delete-from-v2-docker-registry.md
One liner for deleting images from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
@goelprateek
goelprateek / bash
Created July 30, 2018 05:39 — forked from jonashackt/bash
Remote debugging Spring Boot
### java -jar
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=y -jar target/cxf-boot-simple-0.0.1-SNAPSHOT.jar
### Maven
Debug Spring Boot app with Maven:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8001"
@goelprateek
goelprateek / nginx-tuning.md
Created February 13, 2018 12:46 — 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.

cd /opt
wget http://apache-mirror.rbc.ru/pub/apache/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz
tar xvzf kafka_2.11-0.10.1.0.tgz
ln -s kafka_2.11-0.10.1.0/ kafka
vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
@goelprateek
goelprateek / ubuntu_agnoster_install.md
Created January 17, 2018 16:40 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH