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
language: none | |
build: | |
pre_ci: | |
- gradle clean build | |
- docker build -t builder:tip . | |
pre_ci_boot: | |
- image_name: builder | |
image_tag: tip |
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
# show line number | |
cat --number logs/catalina.out | |
# grep with two pattern and | |
cat --number logs/catalina.out | grep -e 'pattern1.*pattern2' -e 'pattern2.*pattern1' | |
# cat by number | |
awk 'NR >= 57890000 && NR <= 57890010' logs/catalina.out | |
## docker daemon log.... | |
# https://docs.docker.com/config/daemon/ | |
journalctl -u docker.service -n 1000 | |
journalctl -u docker.service -f |
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
/** | |
* reference https://stackoverflow.com/questions/18273184/how-to-set-webappdirname-in-gradle | |
* http://samchu.logdown.com/posts/243171-using-gradle-management-project-kit | |
* | |
*/ | |
group 'com.mars' | |
version '1.0-SNAPSHOT' | |
apply plugin: 'war' | |
apply plugin: 'idea' |
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
//http://stackoverflow.com/questions/13075390/hibernate-subquery-detachedcriteria | |
DetachedCriteria exampleSubquery = DetachedCriteria.forClass(MyPersistedObject.class) | |
.setProjection(Property.forName("id")) | |
// plus any other criteria... | |
; | |
Criteria criteria = getSession().createCriteria(ARelatedPersistedObject.class) | |
.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY) | |
.add(Subqueries.propertyIn("myPersistedObjectId", exampleSubquery))); | |
// For multiple subqueries, you can use a boolean operator like Restrictions.or(): |
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
if [ -z "${projectPathName}" ]; then | |
echo "ERROR: projectPathName IS NULL , Failed to START. Please recheck the variables" | |
exit 1 # terminate and indicate error | |
fi | |
echo "restarting $projectPathName ......." | |
projectPath="/home/webapp/$projectPathName" | |
echo "projectPath = $projectPath" | |
sudo sh -c 'echo 1 >/proc/sys/vm/drop_caches' | |
sudo sh -c 'echo 2 >/proc/sys/vm/drop_caches' | |
echo $projectPath |
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
-Xms2g | |
-Xmx8g | |
-XX:ReservedCodeCacheSize=512m | |
-XX:+UseG1GC | |
-XX:SoftRefLRUPolicyMSPerMB=2000 | |
-ea | |
-Dsun.io.useCanonCaches=false | |
-Djava.net.preferIPv4Stack=true | |
-XX:+HeapDumpOnOutOfMemoryError | |
-XX:-OmitStackTraceInFastThrow |
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
PORT_RANGE = Array(10000..10010) | |
#.concat(Array(17000..17010)).concat(Array(18000..18010)).concat(Array(19000..19010)) | |
#.concat(Array(17100..17110)).concat(Array(18100..18110)).concat(Array(19100..19110)) | |
#.push(17050).push(18050).push(19050) |
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
-Xms2g | |
-Xmx8g | |
-XX:ReservedCodeCacheSize=512m | |
-XX:+UseG1GC | |
-XX:SoftRefLRUPolicyMSPerMB=200 | |
-ea | |
-Dsun.io.useCanonCaches=false | |
-Djava.net.preferIPv4Stack=true | |
-XX:+HeapDumpOnOutOfMemoryError | |
-XX:-OmitStackTraceInFastThrow |
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
docker run -d -p 10001:80 \ | |
-v /home/vagrant/docker-workshop/icinga2_home/constants.conf:/etc/icinga2/constants.conf \ | |
-v /home/vagrant/docker-workshop/icinga2_home/zones.conf:/etc/icinga2/zones.conf \ | |
-v /home/vagrant/docker-workshop//icinga2_home/hosts.conf:/etc/icinga2/conf.d/hosts.conf \ | |
icinga/icinga2 | |
docker run -it -p 10000:9090 \ | |
-v /home/vagrant/docker-workshop/prometheus_home/prometheus.yml:/etc/prometheus/prometheus.yml \ | |
prom/prometheus -config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 |
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
/** | |
* This file defines global constants which can be used in | |
* the other configuration files. | |
*/ | |
/* The directory which contains the plugins from the Monitoring Plugins project. */ | |
const PluginDir = "/usr/lib64/nagios/plugins" | |
/* The directory which contains the Manubulon plugins. | |
* Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details. |