Publish to local Maven repository

plugins {
 id 'java-gradle-plugin'
 id 'maven-publish'
gradlew publishToMavenLocal -Pversion=wip

Add local Maven repository for plugins

in settings.gradle

pluginManagement {
 repositories {



Jobs are processes which are started by a shell.

  • CTRL+Z suspends the current foreground job.
  • bg executes job in background.
  • jobs lists background jobs.
  • fg brings job to foreground.
  • kill %2 kills background job with job number 2.

Monitor Processes

  • top or htop finds processes
  • ps aux | grep java finds java processes


Git clone including submodules

git clone --recursive [URL to Git repo]

Load submodules in already cloned repo

git submodule update --init --recursive

Pull all changes in the repo including changes in the submodules

git pull --recurse-submodules

Pull all changes for the submodules

git submodule update --remote


The comm utility reads file1 and file2, which should be sorted lexically, and produces three text columns as output: lines only in file1; lines only in file2; and lines in both files.

usage: comm [-123i] file1 file2

Options for comm command:

  1. -1 :Suppress first column, lines unique to first file.
  2. -2 :Suppress second column, llines unique to second file.
  3. -3 :Suppress third column, llines common to both files.
  4. -i :Case insensitive comparison of lines.
comm -23i file1.txt file2.txt > lines_unique_to_first_file.txt


ripgrep (rg)

Search with sort displaying only file names

$ rg -l '// TODO' --sort path

Search within Markdown files only

$ rg -t md '@format'

Search in files with path matching

$ rg -g 'parser-*.js' '// TODO'


Sync all files in a directory to another directory on the same machine

rsync -avzh /root/rpmpkgs /tmp/backups/

Sync all files in a directory to another machine

rsync -avz rpmpkgs/ [email protected]:/home/

Copy/Sync a Remote Directory to a Local Machine

rsync -avzh [email protected]:/home/tarunika/rpmpkgs /tmp/myrpms

Copy a File from a Remote Server to a Local Server with SSH

rsync -avzhe ssh [email protected]:/root/install.log /tmp/

Copy a File from a Local Server to a Remote Server with SSH

rsync -avzhe ssh backup.tar [email protected]:/backups/


How disable password authentication so you don’t have to type password

every time you want to install something

How to fix broken sudo - sudo: parse error in /etc/sudoers near line X

Use pkexec

pkexec vi /etc/sudoers/...

Running pkexec without a graphical agent fails even with falling back onto pkttyagent

running pkexec gives something like:

polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
Error executing command as another user: Not authorized


Note that to make it work, run pkttyagent in a different terminal binding to

the PID of the first terminal that is running pkexec.

In the first terminal run the following command to get its PID.

echo $$

In the second terminal run

pkttyagent --process PID_FROM_STEP_1

In the first terminal, do whatever you need to do with pkexec.


watch kubectl get pods -o wide
watch -d uptime
watch -n 5 df -h


Timeout issue with kubectl port-forward?

Keep the http-connection alive by polling:

while true ; do nc -vz 9817 ; sleep 120 ; done


Parsing and formatting XML

Format and read a large xml file with all the data on one line

xmllint --format largefile.xml  | less
xmllint --xpath //screenSizeInch largefile.xml


How to quickly setup a static file server.

Node / Npm

npm install http-server -g

To use it:

cd D:\Folder

Or, like this:

http-server D:\Folder


python -m SimpleHTTPServer


python3 -m http.server


create file web-server.go

package main

import (

func ping(w http.ResponseWriter, r *http.Request) {

func main() {
  http.Handle("/", http.FileServer(http.Dir("./public")))
  http.HandleFunc("/ping", ping)
  fmt.Printf("listening on port 8080\n");
  if err := http.ListenAndServe(":8080", nil); err != nil {


go run web-server.go


docker-compose up
docker-compose down
docker-compose logs -f
docker-compose logs -f [service] (service is not same as container, look in compose file for service names)


Go inside a running container

docker exec -it <containerIdOrName> bash (or /bin/bash or /bin/ash)

Look inside an image

docker run -it --entrypoint /bin/bash <imageid>

Stop and remove all docker containers and images

Stop all running containers

docker stop $(docker ps -aq)

Remove all containers

docker rm $(docker ps -aq)

Remove all images

docker rmi $(docker images -q)


docker [image,container,volume,..] prune -a


Dead simple wildcard DNS for any IP Address

Stop editing your etc/hosts file with custom hostname and IP address mappings. Dead simple wildcard DNS for any IP Address

  • maps to

  • maps to maps [.-] in “dot”, “dash” or “hexadecimal” notation to the corresponding :


Copy, Cut, Paste

yy - Yank (copy) the current line, including the newline character. 3yy - Yank (copy) three lines, starting from the line where the cursor is positioned.

dd - Delete (cut) the current line, including the newline character. 3dd - Delete (cut) three lines, starting from the line where the cursor is positioned.

p - Paste

How to map save to Ctrl+s

Why? To avoid freezing the terminal by mistake.

in .vimrc

noremap <silent> <C-S>          :update<CR>
vnoremap <silent> <C-S>         <C-C>:update<CR>
inoremap <silent> <C-S>         <C-O>:update<CR>

in .bashrc or .zshrc

stty -ixon

When VIM is frozen, don’t accept input, and you can’t close it?

Probably you did Ctrl+S by mistake - it freezes your terminal, type Ctrl+Q to get it going again.



Fullscreen toggle with Ctrl + Command + F Move between desktops and/or fullscreens Ctrl + -> Ctrl + <- How to force an app to quit on your Mac Option + Command + Esc Or choose Force Quit from the Apple () menu in the upper-left corner of your screen. How to take a screenshot on your Mac Shift + Command + 3 -> the whole screen Shift + Command + 4 -> a portion of the screen Shift + Command + 4 + Space -> a window in the screen Function-Delete to forward delete Fn + Delete -> deletes the character to right of the cursor Control + D -> deletes the character to right of the cursor Command + Delete -> deletes whole word Option + Delete -> deletes whole word Lock screen Shift + Command + Q Open new tab (in browser, iterm, …) Command + T Switch to next/previous tab (in browser, iterm, …) Ctrl + Tab, Ctrl + Shift + Tab Command + 1, Command + 2 -> Switch to tab 1 and then tab 2 (works for the first 8 tabs) [Read More]



Problem booting ubuntu

[ 3.516984] bcma: Unsupported SPROM revision: 11 [ 3.517071] bcma: bus0: No SPROM available

  • add nomodset to boot params (between quiet and splash)

Problem installing GRUB2 (grub-efi-amd64-signed failed installation /target/)

  • you need to ensure that a partition of the ‘EFI system partition’ type is mounted at /boot/efi
  • disable secure boot in UEFI BIOS

*** Problem = no wireless

dmesg shows Broadcom 4352 WLAN found ERROR: FOUND UNSUPPORTED PHY

sudo update && sudo apt-get install bcmwl-kernel-source

*** install NVIDIA drivers

ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

Window manager shortcuts

Alt+F7 for maximizing windows (both vertically and horizontally) Alt+Space for the window operations menu

grab and move key

Alt + left mouse button


HTTPS uses an encryption protocol to encrypt communications. The protocol is called Transport Layer Security (TLS), although formerly it was known as Secure Sockets Layer (SSL). This protocol secures communications by using what’s known as an asymmetric public key infrastructure. The two are tightly linked and TLS is really just the more modern, secure version of SSL. While SSL is still the dominant term on the Internet, most people really mean TLS when they say SSL, because both public versions of SSL are not secure and have long since been deprecated. How to debug “General OpenSslEngine problem - unable to find valid certification path to requested target” This indicates that you are unable to establish a trusted SSL connection over SSL. This issue might arise if you are using a self-signed certificate or a certificate that’s been issued by an internal certificate authority, or if your clients (e.g., browser, Java) are outdated. Possible reasons: Something that happened in your Java framework installation directory has messed up its list of trusted providers. This can even be a simple version upgrade gone wrong. [Read More]


Find all .jpg files in the /home and sub-directories

find /home -name *.jpg

Find an empty file within the current directory

find . -type f -empty

Find all .db files (ignoring text case) modified in the last 7 days by a user named exampleuser

find /home -user exampleuser -mtime -7 -iname ".db"

Find and Process Files

find . -name "*.txt" -exec chmod o+r '{}' \;

Find and Delete Files

find . -name "*.bak" -delete

Find and Process files in folder

find * -name pom.xml -maxdepth 1 -execdir pwd \; -execdir grep "testcontainers" pom.xml \;
linux  shell