Skip to content

Instantly share code, notes, and snippets.

@gangaaloori
gangaaloori / docker_commands.sh
Last active August 29, 2015 14:24
List of basic Docker commands
# Add labels to images
LABEL com.example.version="0.0.1-beta" com.example.release-date="2015-02-12"
# View the labels
docker inspect 4fa6e0f0c678
# Query labels
# List all running containers that have a `com.example.is-beta` label
docker ps --filter "label=com.example.is-beta"
docker images --filter "label=vendor=acme"
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop
@gangaaloori
gangaaloori / gradle_commands
Created May 19, 2014 09:53
Gradle commands
# Gradle build with HTTP proxy
gradle -Dhttp.proxyHost=10.23.12.100 -Dhttp.proxyPort=8080
@gangaaloori
gangaaloori / maven_commands.sh
Created November 28, 2013 09:12
Useful maven commands
#Running a single/multiple Test classes
mvn -Dtest=CircleTest
mvn -Dtest=Ci*leTest
mvn -Dtest=SquareTest,Ci*leTest
#Running a set of methods in a Single Test Class
mvn -Dtest=CircleTest#testArea
mvn -Dtest=CircleTest#test*
mvn -Dtest=CircleTest#testArea+testVolume
@gangaaloori
gangaaloori / tcpdump_output
Created November 22, 2013 17:52
tcpdump output to troubleshoot logstash issue
[root@sdev-4 chainsaw-bundle]# sudo tcpdump -nni any 'port 12555'
tcpdump: WARNING: Promiscuous mode not supported on the "any" device
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 96 bytes
17:46:11.338098 IP 127.0.0.1.39946 > 127.0.0.1.12555: P 2746833910:2746834251(341) ack 2753601842 win 257 <nop,nop,timestamp 1503592234 1501911360>
17:46:11.338465 IP 127.0.0.1.12555 > 127.0.0.1.39946: R 2753601842:2753601842(0) win 0
17:46:41.346222 IP 127.0.0.1.43726 > 127.0.0.1.12555: S 442773549:442773549(0) win 32792 <mss 16396,sackOK,timestamp 1503622244 0,nop,wscale 7>
17:46:41.346268 IP 127.0.0.1.12555 > 127.0.0.1.43726: R 0:0(0) ack 442773550 win 0
17:47:11.353072 IP 127.0.0.1.43729 > 127.0.0.1.12555: S 465865732:465865732(0) win 32792 <mss 16396,sackOK,timestamp 1503652250 0,nop,wscale 7>
17:47:11.353121 IP 127.0.0.1.12555 > 127.0.0.1.43729: R 0:0(0) ack 465865733 win 0
@gangaaloori
gangaaloori / logstash-log4j.conf
Created November 22, 2013 17:38
Logstash Log4j input conf file
input {
log4j {
type => "cordys_servicecontainer"
host => "localhost"
port => 12555
mode => "server"
codec => rubydebug
}
}
@gangaaloori
gangaaloori / sql_queries_practice.sql
Created October 28, 2013 06:27
Contains some important queries that I practiced upon
--display employees details along with thier managers details
select e1.empno, e1.ename, e1.job, e2.ename as manager, e2.job as manager_job, e1.sal from emp e1 left join emp e2 on e1.mgr=e2.empno;
--display employees details along with their manager details(manager name, job, dept name), dept details
select e1.empno, e1.ename, e1.job, e1.sal, d1.dname, e2.ename as manager, e2.job as manager_job, d2.dname as manager_dept
from emp e1 left join emp e2 on e1.mgr=e2.empno
inner join dept d1 on e1.deptno=d1.deptno
inner join dept d2 on e2.deptno=d2.deptno
order by e1.empno
@gangaaloori
gangaaloori / linux_important_files
Created October 9, 2013 11:30
Important files on Linux system
/etc/passwd : encrypted password for system users in Linux (relates to /etc/shadow)
/etc/crontab : scheduled shell scripts for automatically
/etc/fstab : mount point on Linux
/etc/initd/ : service startup location
/etc/grubconf : GRUB bootloader configuration
/etc/inittab : Run level mode configuration
/etc/issue : Login banner message
/etc/profile : Bash shell in default
/etc/sysconfig/network-scripts/ : network configuration
/etc/X11 : X-window configuration
@gangaaloori
gangaaloori / top_command_examples.sh
Created October 7, 2013 13:32
Top command examples
# To sort the output of top command, press shift+o(uppercase O) and then press the field letter. For example press n to sort the output based on memory utilization %
# To highlight running process in Top output, press 'z'
# To show absolute path of processes, press 'c'
# Kill running process with argument 'k'
# Press (Shift+W) to save the running top command results under /root/.toprc.
# Use top command with 'u' option will display specific User process details.
top -u cordysBop