Skip to content

Instantly share code, notes, and snippets.

View ashimjk's full-sized avatar

Ashim Khadka ashimjk

View GitHub Profile
@ashimjk
ashimjk / ForwardHeadersFeignInterceptor
Created February 22, 2022 08:55
Feign Forward Header Interceptor
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Primary;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
Download Linux AMD64 : https://github.com/helm/helm/releases/tag/v2.14.3
tar -zxvf helm-v2.14.3-linux-amd64.tar.gz
sudo mv linux-amd64/helm /usr/local/bin/helm
git submodule deinit <path_to_submodule>
git rm <path_to_submodule>
git commit-m "Removed submodule "
rm -rf .git/modules/<path_to_submodule>
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/0a17b8e50963de12e8ab3de22e53fccddbe8a226/Formula/kubernetes-helm.rb
or
brew extract https://raw.githubusercontent.com/Homebrew/homebrew-core/0a17b8e50963de12e8ab3de22e53fccddbe8a226/Formula/kubernetes-helm.rb
# Install Maven
brew install maven
# Above maven install openjdk 13 as a dependency
# If it needs to be overide then
brew uninstall --ignore-dependencies openjdk
# Following lines are only valid if you installed adoptedopenjdk
# See here - Install Open JDK in Mac (https://gist.github.com/ashimjk/e6c0cdb9ac19e21ece2e221ee22ac21b)
# For switch jdk, we can use jEnv (https://www.jenv.be/)
# This is for manual
# Export JAVA_HOME from .bash_profile
vim ~/.bash_profile
# In .bash_profile, add following code
export JAVA_HOME_8=$(/usr/libexec/java_home -v1.8)
export JAVA_HOME_11=$(/usr/libexec/java_home -v11)
# Note
# On Mac OSX, Java should installed in this folder; it is Mac’s standard.
/Library/Java/JavaVirtualMachines/
# Update repo
brew update
# Add adoptopenjdk/openjdk
brew tap adoptopenjdk/openjdk
@ashimjk
ashimjk / install.sh
Last active July 20, 2021 16:09
Default Installation
sudo apt install build-essential -y
sudo apt install git -y
sudo apt install curl -y
sudo apt install vim -y
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update
sudo apt install snapd -y
sudo snap install kubectl --classic
sudo snap install slack --classic