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
Generate ssl key: | |
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr | |
find files recursively: | |
find . -name "*.bak" -type f -delete | |
But use it with precaution. Run first: | |
find . -name "*.bak" -type f | |
---------- |
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
$ sudo apt-get install git | |
-------------- | |
1. /etc/gitconfig file: Contains values for every user on the system and | |
all their repositories. If you pass the option --system to git config, it | |
reads and writes from this file specifically. | |
2. ~/.gitconfig or ~/.config/git/config file: Specific to your user. | |
You can make Git read and write to this file specifically by passing the -- | |
global option. | |
3. config file in the Git directory (that is, .git/config) of whatever repos- | |
itory you’re currently using: Specific to that single repository. |
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
https://github.com/wsargent/docker-cheat-sheet | |
# find PID if a container: | |
docker inspect --format '{{ .State.Pid }}' CONTAINER_ID | |
# Get the latest Docker package | |
$ wget -qO- https://get.docker.com/ | sh | |
# lists dockers images | |
$ sudo docker images |
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
heap dump: | |
jmap -dump:format=b,file=heap.bin <pid> | |
thread dump: | |
jstack -l JAVA_PID > jstack.out | |
----------------- | |
# java links: | |
https://www.reucon.com/cdn/java/ | |
http://ghaffarian.net/downloads/Java/JDK/ |
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
#define profile and build upon it: | |
<modules> | |
<module>module1</module> | |
<module>module2</module> | |
... | |
</modules> | |
... | |
<profiles> | |
<profile> | |
<id>ci</id> |
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
# loops: | |
#!/bin/bash | |
for i in 1 2 3 4 5 | |
do | |
echo "Welcome $i times" | |
done | |
#!/bin/bash | |
for i in {1..5} | |
do |
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
# verify config file | |
$ logstash -f first-pipeline.conf --configtest | |
# run logstash with config file | |
$ logstash -f first-pipeline.conf | |
# pipleline example: | |
$ for (( ; ; )) do nc localhost 3333 < tomcat_logs/localhost_access_log.2015-08-20.txt ; | |
sleep 1;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
http://www.baeldung.com/spring-boot-application-configuration | |
http://jmelo.lyncode.com/spring-boot-maven-plugin-without-referencing-parent/ | |
http://www.leveluplunch.com/blog/2014/04/16/spring-boot-swagger-springmvc-configuration/ |
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
sqlplus / as sysdba |
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
http://stackoverflow.com/questions/27848548/play-framework-2-3-x-bytechunks-mp3-streaming-has-no-playback-is-not-scrollabl | |
With(MP3Headers.class) | |
public static Result test() { | |
final int begin, end; | |
final boolean isRangeReq; | |
response().setHeader("Accept-Ranges", "bytes"); | |
if (request().hasHeader("RANGE")) { | |
isRangeReq = true; | |
String[] range = request().getHeader("RANGE").split("=")[1].split("-"); |
OlderNewer