Skip to content

Instantly share code, notes, and snippets.

View shashanthk's full-sized avatar

Shashanth shashanthk

  • Mangaluru, Karnataka, India
View GitHub Profile
@shashanthk
shashanthk / tmux_shortcut.md
Created September 4, 2024 17:33
tmux shortcuts

Table of common tmux shortcuts and commands:

Action Shortcut/Command
Start a new session tmux or tmux new -s session_name
Detach from session Ctrl-b, then d
List sessions tmux ls
Attach to a session tmux attach -t session_name
Kill a session tmux kill-session -t session_name
Split window horizontally Ctrl-b, then %
@shashanthk
shashanthk / Dockerfile.springboot
Created July 27, 2024 11:50
Building Docker image using Spring Boot code
## JDK
FROM eclipse-temurin:21-alpine AS builder
## install maven CLI
RUN apk add --no-cache maven
## container directory
WORKDIR /app
## copy the pom.xml and download the dependencies
@shashanthk
shashanthk / Dockerfile.springboot
Created July 27, 2024 11:31
Simple Docker file for Spring Boot project
## JDK
FROM eclipse-temurin:21-alpine
## container direcotry
WORKDIR /app
## copy build file from host to container
COPY target/jar-file-name.jar /app
## expose service port
@shashanthk
shashanthk / pentaho.domain.ini
Last active July 12, 2024 06:18
Pentaho server auth without exposing username and password via Nginx
upstream pentaho-server {
server <PENTAHO_SERVER_IP>:<PENTAHO_PORT>;
}
server {
## default listen port
listen 80;
## domain name
@shashanthk
shashanthk / generate_error_files.sh
Created June 29, 2024 11:10
HTTP standard error page generator
#!/bin/bash
# HTTP standard error code and its message
declare -A http_status_list=(
[400]="Bad Request"
[401]="Unauthorized"
[402]="Payment Required"
[403]="Forbidden"
[404]="Not Found"
[405]="Method Not Allowed"
@shashanthk
shashanthk / pg_backup_script.sh
Last active July 24, 2023 05:23
Simple shell script to take Postgres database backup and compress it to .gz format
#!/bin/sh
# Dump DBs
dir="/path/to/backup/"
date=`date +"%Y_%m_%d_%H_%M_%S"`
filename="database_name_${date}.sql"
cd $dir
echo "\nBackup in progress...\n"
@shashanthk
shashanthk / vs_code_settings_linux.json
Created January 4, 2021 17:07
My VS Code settings (LinuxMint)
{
"workbench.startupEditor": "newUntitledFile",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.fontFamily": "'Source Code Pro',monospace",
"editor.lineHeight": 24,
"git.branchSortOrder": "alphabetically",
"git.showProgress": true,
"editor.matchBrackets": "always",
"workbench.list.openMode": "doubleClick",
@shashanthk
shashanthk / README
Created October 8, 2016 10:52 — forked from MarsVard/README
android drawable to imitate google cards.
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file.
set the background of a view to card,
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view
``` xml
<View
android:layout_width="fill_parent"