Skip to content

Instantly share code, notes, and snippets.

@skuppa
skuppa / LinuxTips.md
Last active January 4, 2016 04:48
Kill the process listening on port 8080

To kill the process using port

kill `netstat -nlp | grep 8080 | awk '{print $7}' | cut -d/ -f1`

To get public ip address using command line

curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
@skuppa
skuppa / LinuxEnvironmentLoading.md
Last active August 29, 2015 13:55
Envrionment loading for linux/debian/ubunt/linuxmint

Tips on envrionment loading for linux/debian/ubunt/linuxmint

  1. .bashrc will be loaded when login from unity, desktop UI or F7..F12
  2. .bash_profile willbe loaded when login from command prompt, F1..F6, login from ssh
  3. .profile will be loaded when login from UI console, which will source .bashrc
  4. Enabled longin as shell in the terminal to load the .bash_profilel

source

@skuppa
skuppa / HerokuTips.md
Last active July 16, 2017 08:35
heroku Tips

Tips to work with heroku

Adding key to heroku

It is required so you can push code heroku's git server and deploy

# Make sure the keys are available
ssh-add -l

# Add keys to heroku
heroku keys:add
@skuppa
skuppa / GitTips.md
Last active August 29, 2015 13:56
Git Tips

Remove staged file after updating the .gitignore

$ echo 'out/' >> .gitignore
$ git rm -r --cached out/

Shelve Changes using Branch

If file is not committed locally

@skuppa
skuppa / PostgresTips.md
Last active March 28, 2016 19:53
Postgres Tips

JDBC Driver

Name Value
artifact postgresql:postgresql:8.4-702.jdbc3
driver org.postgresql.Driver
JDBC url jdbc:postgresql://localhost:5432/testdb

Connecting Heroku Postgres

Use ssl to true and sslfactory as NonValidatingFactory

@skuppa
skuppa / esxi_cli_reference.md
Created February 17, 2014 20:55
ESXi commandline reference

Managing ESXi requires one needs to have vSphere ESXi Cli tool to be installed. But, ESXi server itself has commands to manage the guest OS.

  • Login to console
ssh root@esxihost
  • Get all guest vms
# vim-cmd vmsvc/getallvms
@skuppa
skuppa / spring_mvc_tips.md
Created February 24, 2014 15:52
Spring MVC Tips

When Bad Request happens, most of the problem is in the data serialization and de-serialization. To get the detailed stack trace add the following in the log4j configuration or similar for logback.

    <logger name="org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod">
        <level value="trace"/>
    </logger>
@skuppa
skuppa / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@skuppa
skuppa / spring_boot.md
Last active August 29, 2015 14:16
Spring Boot Hints

Spring boot property loading order

Spring Boot looks for properties using a specific order:

  1. Command line arguments
  2. Java System properties (System.getProperties())
  3. OS environment variables
  4. JNDI attributes from java:comp/env
  5. A RandomValuePropertySource that only has properties in random.*
  6. Application properties outside of your packaged jar (application.properties including YAML and profile variants)
  7. Application properties packaged inside your jar (application.properties including YAML and profile variants)
@skuppa
skuppa / gist:ffbd47a4d8a9cbaf7544
Last active August 29, 2015 14:17
Docker Tips

Images

Delete untagged docker images

docker rmi $(docker images -q --filter "dangling=true")

Logs

Read the docker log

docker logs -f