Skip to content

Instantly share code, notes, and snippets.

View debu999's full-sized avatar

Debabrata Patnaik debu999

  • JP MORGAN CHASE N.A.
  • Bengaluru
  • 11:00 (UTC +05:30)
  • X @i_m_debu
View GitHub Profile
#!/bin/bash
echo "removing evaluation key..."
# in mac you can look at installed version and then delete the evaluation file. Big Sur OS Version.
rm -rfv ~/Library/Application\ Support/JetBrains/IntelliJIdea2021.1/eval
echo "resetting evalsprt in other.xml ... "
sed -i '' '/evlsprt/d' ~/Library/Application\ Support/JetBrains/IntelliJIdea2021.1/options/other.xml
defaults delete com.apple.java.util.prefs 2> /dev/null
@debu999
debu999 / Mac_intellij_reset_2021.2.sh
Last active January 16, 2022 03:41
Mac IntelliJ reset for 2021.3 and beyond
#!/bin/bash
echo "removing evaluation key..."
# in mac you can look at installed version and then delete the evaluation file. Big Sur OS Version.
rm -rfv ~/Library/Application\ Support/JetBrains/IntelliJIdea2021.2/eval
echo "resetting evalsprt in other.xml ... "
sed -i '' '/evlsprt/d' ~/Library/Application\ Support/JetBrains/IntelliJIdea2021.2/options/other.xml
defaults delete com.apple.java.util.prefs 2> /dev/null
@debu999
debu999 / docker_commands.ini
Last active February 18, 2022 14:54
Docker and Kubernetes handy commands
New Tutorial
Docker is a on OS-level virtualization software platform that enables developers and IT administrators to create, deploy and run applications
in a Docker Container with all their dependencies....
Docker Advantages: Rapid deployment / Quick and easy configuration / Better efficiency / Portability / Scalability / Security
Docker Image: Instruction Template to create containers. Dockerfile, Multi layered, usually starts with base layer.
COMMANDS
docker --version / docker version
docker run hello-world # to run a image with tag latest
@debu999
debu999 / git_commands.ini
Created November 3, 2021 03:56
Git Cheatsheet
$ git config --global user.name "Debabrata Patnaik"
$ git config --global user.email "[email protected]"
$ git config --global alias.co commit
//Run the following command inside the folder
$ git init
//Run the following command to create a new directory that is a git repo
$ git init DIRECTORY_PATH/DIRECTORY_NAME
$ git clone LINK
@debu999
debu999 / iterm Setup Mac.zsh
Created April 15, 2022 05:39
Iterm Setup Mac
Shell Setup
///////////
SSH keys
///////////
ssh-keygen -t rsa
ssh-add -K ~/.ssh/id_rsa
///////////
HOMWBREW
Stream -> .parallel()
ParallelStream -> sequential()
pool induced deadlock java fixed with fork join pool with work stealing
parallelstream uses java 7 forkjoinpool (Common ForkJoinPool)
forEachOrdered and forEach are 2 options. forEachOrdered is not sequentional. ForEachOrdered gurantees imposed order viz. if
list order then then it will work. But set cant have a ordering.
stream - > parallel -> map and filter runs in threads.
reduce have the option to have identity value for sum its 0 for multiply/div its 1.
@debu999
debu999 / code.md
Last active July 5, 2024 13:41
Reactive Programming - Java with Mutiny
  • Mutiny provides two main classes: Uni and Multi.2 Uni represents an asynchronous action or operation.
  • It can emit a single item or failure, if the represented action fails. Multi represents a stream of items.
  • It can convey multiple items, as well as a terminal failure or completion event
Uni<UserProfile> uni = users.getUserByName(name);
return uni
        .onItem().transform(user -> user.name)
        .onFailure().recoverWithItem("anonymous");
  • Multi can emit 0, 1, n, or an infinite number of items.
kubectl get networkpolicy deny-metadata -o yaml
kubectl explain networkpolicy.spec.egress
kubectl explain networkpolicy.spec.egress.to
kubectl explain networkpolicy.spec.egress.to.ipBlock

kubectl run busybox --image=busybox --rm -it /bin/sh
wget https://www.google.co.in
kubectl create namespace test
kubectl run busybox --image=busybox --rm -it -n test /bin/sh
@debu999
debu999 / httpie-graphql.sh
Last active January 3, 2023 10:34 — forked from 2color/httpie-graphql.sh
How to send a GraphQL request with HTTPie
http -f https://graphqlapiurl/graphql Authorization:"Bearer accessToken" query="query { Process(id=\"test\") { id title } }"
http -f https://graphqlapiurl/graphql Authorization:"Bearer accessToken" query="mutation { Process(id=\"test\", title=\"testtitle\") { id title } }"
@debu999
debu999 / idea
Created January 15, 2023 06:04 — forked from agoncal/idea
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`