This file contains 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
# for every directory run multiple commands | |
find . -maxdepth 1 -type d -exec sh -c "cd {} && mvn clean && cd -" \; | |
#when disk is out of space identify directory which occupies most space | |
df -h | |
du -s * | sort -r -n | head -n 10 |
This file contains 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
package org.kkarad.metrics; | |
import org.HdrHistogram.Histogram; | |
import gnu.trove.map.hash.TObjectLongHashMap; | |
public class Metrics { | |
private static final Histogram histogram = new Histogram(3600000000000L, 3); | |
private static TObjectLongHashMap<String> map = new TObjectLongHashMap<String>(1000, 0.5f, -1); |
This file contains 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
#Taken from: http://www.binarytides.com/linux-commands-hardware-info/ | |
#kernel and distro | |
cat /etc/*release | |
cat /proc/version | |
#cpu | |
cat /proc/cpuinfo | |
#memory |
This file contains 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
#!/bin/bash | |
#set -x | |
# Prints the date difference of "start" and "end" date in milliseconds | |
function datediff { | |
startsec=$(date -d "$1" +%s) | |
while [[ $startsec = 0* ]]; do startsec=${startsec#0}; done | |
endsec=$(date -d "$2" +%s) | |
while [[ $endsec = 0* ]]; do endsec=${endsec#0}; done |
This file contains 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
kostas@localhost ~$ cat fix.log | |
2014-03-20 10:30:20,123 123456.123456789 MassQuote | |
2014-03-20 10:30:20,133 123456.123456789 MassQuoteAcknowledgement | |
2014-03-20 10:31:20,234 123456.123456789 MassQuote | |
2014-03-20 10:31:20,240 123456.123456789 MassQuoteAcknowledgement | |
kostas@localhost ~$ cat fix.log | awk '!(NR%2){printf("%s %s %s %s\n",p,$1,$2,$3)}{p=$1" "$2}' | |
2014-03-20 10:30:20,123 2014-03-20 10:30:20,133 123456.123456789 | |
2014-03-20 10:31:20,234 2014-03-20 10:31:20,240 123456.123456789 |
This file contains 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
tail -f fix.log | tr '\1' '|' | grep "whatever" |
This file contains 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 interface Identifiable<T> { | |
T getId(); | |
} |
This file contains 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
package ork.kkarad.examples; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Import; | |
import org.springframework.context.support.GenericApplicationContext; | |
import org.springframework.mock.env.MockPropertySource; |
This file contains 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 Foo { | |
public static void main(String[] args) { | |
System.out.println(sun.net.InetAddressCachePolicy.get()); | |
} | |
} |
This file contains 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 PanelViewer { | |
public static void main(String[] args) { | |
JFrame frame = new JFrame("Gui Test"); | |
frame.getContentPane().setLayout(new FlowLayout()); | |
//frame.add(new PerspectivePanel()); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.pack(); |
NewerOlder