Skip to content

Instantly share code, notes, and snippets.

View visvv's full-sized avatar

Vishnu V V visvv

View GitHub Profile
df -h * [Shows the disc usage]
df -sh * [Shows the dosc usage sorted]
du -sh dir_path/ [Shows the summary of folder size]
du -ah [Shows all files&folders in human readable format]
du -h note.txt [Shows the disc size of the file.]
du -a /etc/ | sort -n -r | head -n 10 [Show top 10 directories eating disc space]
iostat -h sda 1 [Display all IO stat of sda in every 1 second with huma readable format]
df -h [Shows the disc usage]
du -sh dir_path/ [Shows the summary of folder size]
du -ah [Shows all files&folders in human readable format]
du -h note.txt [Shows the disc size of the file.]
du -a /etc/ | sort -n -r | head -n 10 [Show top 10 directories eating disc space]
sudo usermod -aG docker ${USER} // add current user to docker group
@visvv
visvv / Stack.java
Created December 1, 2018 10:57
Simple stack implementation in java
public class Stack<T>{
private Node<T> head;
public void push(T data){
if(this.head == null){
this.head = new Node<>(data);
}else{
Node<T> node = new Node<>(data);
node.next = this.head;
@visvv
visvv / BFSDFS.java
Created November 6, 2017 14:20 — forked from gennad/BFSDFS.java
Breadth-first search and depth-first search Java implementation
Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();
version: '2'
services:
gateway:
image: "gcr.io/theloud-165302/mobile-frontend-gateway"
ports:
- "5000:5000"
volumes:
- .:/code
keycloack:
image: "jboss/keycloak-postgres"
Add user to the sudoers
// in ubunut
usermod -aG sudo username
// centos
usermod -aG wheel username
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'TARGET_DB'
AND pid <> pg_backend_pid();
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 1 # tells deployment to run 1 pods matching the template
template: # create pods using pod definition in this template
metadata:
# unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is
# generated from the deployment name
import java.util.logging.*;
def logger = Logger.getLogger("sample_logger");
def fileHandler = new FileHandler("sample_logger.log", true);
// custome formatter to log only the message.
fileHandler.setFormatter( { record -> record.message });
logger.addHandler(fileHandler)
logger.info('hi there....')