Skip to content

Instantly share code, notes, and snippets.

View rahogata's full-sized avatar

Shivakumar K R rahogata

View GitHub Profile
@rahogata
rahogata / PalindromeCheck.java
Last active July 20, 2023 19:12
Palindrome problem solution using checksum for large string.
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.nio.charset.StandardCharsets;
import java.math.BigInteger;
public class PalindromeCheck {
@rahogata
rahogata / application-sibling.yaml
Created April 5, 2023 11:43
Create application.yaml for unit tests, avoiding copy of main application.yaml.
service.doc:
dest-directory: file:./service-files
temp-dir: file:./service-files/service-temp-dir
service.storage.location: ./ssfiles
@rahogata
rahogata / build.gradle
Last active April 17, 2024 02:41
Exclude node_modules in eclipse project through gradle build tool.
eclipse {
project {
resourceFilter {
appliesTo = 'FOLDERS'
type = 'EXCLUDE_ALL'
recursive = false
matcher {
id = 'org.eclipse.ui.ide.multiFilter'
arguments = '1.0-name-matches-false-false-node_modules'
}
@rahogata
rahogata / git-configs.txt
Created March 21, 2021 07:21
Git configuration files
# ~/.gitconfig
# Simple git configuration with global ignore file.
[user]
name = rahogata.*
email = rahogata.*@**.com
useConfigOnly = true
[core]
excludesfile = /home/rahogata/.gitignore_global
editor = vi
[push]
@rahogata
rahogata / .vimrc
Created March 17, 2021 10:36
Vim configuration file.
syntax enable
set number
set tabstop=4
set smartindent
set shiftwidth=4
set expandtab
set backspace=indent,eol,start
au BufNewFile,BufRead Jenkinsfile setf groovy
/**
*
*/
package com.rahogata.demowebapp;
import java.lang.reflect.Field;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
package com.rahogata.demowebapp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@rahogata
rahogata / postfix_setup
Last active August 19, 2017 06:11
Install Postfix and minimal setup (not completely automated).
#!/bin/sh
# Name: postfix_setup
# Description: Install and minimal configure postfix.
# Args: $1 -> FQDN
# Pre-requisites:
# Add FQDN as host name in /etc/hosts with format Eg: mail.domain.com
# where mail is your host name and domain.com is your domain name.
# If required change /etc/hostname and reboot.
# Eg. /etc/hosts
# 127.0.1.1 mail.domain.com mail
@rahogata
rahogata / tomcat7installer.sh
Last active July 15, 2017 15:31
Install old tomcat7 package in newer ubuntu release 16.04
#!/bin/sh
# Name: tomcat7installer
# Description: This script will install tomcat7 of ubuntu 14 release in 16.04.
# Tomcat ship with or installed in ubuntu 16.04 is incompatible with Java 7,
# so installing old tomcat version will solve this issue that is achievable through this script.
# remove tomcat if already installed.
echo "Removing existing tomcat7..."
sudo service tomcat7 stop >/dev/null 2>&1
@rahogata
rahogata / propertyfileeditor.sh
Last active June 9, 2023 05:06
Shell script to edit properties file interactively, add, update, delete, listing properties supported.
#!/bin/sh
# Name: propertyeditor
# Desc: add,update,delete, list properties interactively
# Args: $1 -> property file to edit.
PATH=/bin:/usr/bin:/usr/local/bin
DEFAULTFILE="$HOME/rahogata.properties"
# ignore signals during file operations