This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo usermod -aG docker ${USER} // add current user to docker group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| gateway: | |
| image: "gcr.io/theloud-165302/mobile-frontend-gateway" | |
| ports: | |
| - "5000:5000" | |
| volumes: | |
| - .:/code | |
| keycloack: | |
| image: "jboss/keycloak-postgres" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add user to the sudoers | |
| // in ubunut | |
| usermod -aG sudo username | |
| // centos | |
| usermod -aG wheel username |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT pg_terminate_backend(pg_stat_activity.pid) | |
| FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = 'TARGET_DB' | |
| AND pid <> pg_backend_pid(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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....') |
NewerOlder