Tuesday, 17 January 2017
Thursday, 12 January 2017
Creating maven repository from Gradle dependencies (upload on local artifactory)
1)
Take back-up of $USER_HOME/.m2/repository folder and perform 'gradle install'
>> gradle install
2)
‘gradle install’ will build file
‘build/poms/pom-default.xml’
Note: Skip the gradle install step, if you already have 'pom' file.
Note: Skip the gradle install step, if you already have 'pom' file.
3)
To download the all the dependencies with the
following Maven command using ‘pom-default.xml’.
(Internet proxy settings must be
correctly set in $USER_HOME/.m2/settings.xml )
>> mvn
dependency:copy-dependencies -Dmdep.copyPom=true
-Dmdep.useRepositoryLayout=true -Dmdep.addParentPoms=true
Note: Need maven-dependency-plugin:2.9 or above for “addParentPoms”
to work.
4)
The entire dependency files will be downloaded in
$USER_HOME/.m2/repository, which can be directly uploaded into the artifactory.
Monday, 9 January 2017
Parameter substitution in Linux shell
Following the table of parameter substitution in shell based on if parameter is set / empty (‘null’) / or unset:
+--------------------+----------------------+-----------------+-----------------+
| | Set | Empty('null') | Unset |
+--------------------+----------------------+-----------------+-----------------+
| ${parameter:-word} | substitute parameter | substitute word
| substitute word |
| ${parameter-word} | substitute parameter | substitute
null | substitute word |
| ${parameter:=word} | substitute parameter |
assign word |
assign word |
| ${parameter=word} | substitute parameter | substitute
null | assign word |
| ${parameter:?word} | substitute parameter | error,
exit | error, exit |
| ${parameter?word} | substitute parameter | substitute
null | error, exit |
| ${parameter:+word} |
substitute word | substitute null |
substitute null |
| ${parameter+word} | substitute word |
substitute word | substitute null |
+--------------------+----------------------+-----------------+-----------------+
${parameter-substitute_value} --> Use substitute
only if parameter is 'not set'
${parameter:-substitute_value}
--> Use substitute when parameter is 'not set' and also when parameter is set but empty ('null')
Thursday, 8 December 2016
Adding environment from external/workspace file into the Jenkins pipeline
// Reading workspace inside pipeline script file using 'readProperties or readFile',
def props = readProperties file: 'tempFiles/env.properties'
props.each { name, val ->
println "Exporting to Jenkins
environment: " + name + "=" + val
env."$name" = "$val"
}
Wednesday, 31 August 2016
Steganography - hiding data within JPG file
The data file must be a ZIP file ('data.zip') and image.jpeg is a image file.
# The data file must
be a ZIP file ('data.zip') and 'image.jpeg' is a image file.
>> cat
image.jpeg data.zip > test.jpg
To see the content
of jpg having image + data file
>> unzip -t
test.jpg
To extract content
from jpg having image + data file
>> unzip
test.jpg
Wednesday, 28 October 2015
Defrag MYSQL database
Over a period of time, "mysql" tables usually get fragmented. It
degrades the performance of "mysql-server" significantly.
You may also find it worth your while to defragment your database tables regularly if you are using VARCHAR fields: these variable-length columns are particularly prone to fragmentation.
To defragment tables manually from command-line using mysqlcheck
You may also find it worth your while to defragment your database tables regularly if you are using VARCHAR fields: these variable-length columns are particularly prone to fragmentation.
Run the following command by replacing USER & PASS
values:
mysqlcheck -Aos -u <user> -p <password>
Parallelise your build using make
If you're running a multiprocessor system (SMP)
with a moderate amount of RAM, you can usually see significant benefits by
performing a parallel make when building code. Compared to doing serial builds
when running make (as is the default), a parallel build is a vast improvement.
To tell make to allow more than one child at a time while building, use the -j
switch:
make -j4; make -j4 modules
Subscribe to:
Posts (Atom)
Total Pageviews
Labels
- artifactory publishing (1)
- assembly programming (1)
- BiPredicate (1)
- clone file ownership (1)
- clone file permission (1)
- clone file permissions (1)
- clone ownership (1)
- clone permission (1)
- clone permissions (1)
- Data binding (1)
- data structure (1)
- Function Pointer (1)
- Gradle dependencies (1)
- gradle dependencies to artifactory (1)
- Gradle publish (1)
- hello (1)
- Java native (1)
- JFROG publishing (1)
- JNI (1)
- LAMDA (1)
- Linux performance tools (1)
- Linux shell script (1)
- mavel local (1)
- maven local repo from Gradle (1)
- maven repository (1)
- MavenPublication (1)
- memory profiling (1)
- microprocessor (1)
- Parameter Substitution (1)
- POM with dependencies (1)
- recursion (1)
- recursion on large data set (1)
- recursion stack-overflow (1)
- recursion with large data (1)
- running Valgrind for JNI (1)
- stack-overflow (1)
- Tail Call Optimization (1)
- TCO (1)
- Valgrind (1)
- X-Server audit (1)
- X-Server log level (1)