Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts
Monday, December 22, 2014
Configure IntelliJ
Remove some files from the projet view
File -> Settings -> File Types :
Ignore files and folders
...;.surefire-*;*.iml;.idea;.gitignore
Plugins
CheckStyle-IDEA
String Manipulation
Copy on steroids - http://plugins.jetbrains.com/plugin/7198
Markdown
Lombok
Sunday, November 2, 2014
HTML report for unit tests
# Run tests and generate .xml reports
mvn clean test
# Convert .xml reports into .html report, but without the CSS or images
mvn surefire-report:report-only
# Put the CSS and images where they need to be without the rest of the
# time-consuming stuff
mvn site -DgenerateReports=false
Go to target/site/surefire-report.html for the report.
mvn clean test
# Convert .xml reports into .html report, but without the CSS or images
mvn surefire-report:report-only
# Put the CSS and images where they need to be without the rest of the
# time-consuming stuff
mvn site -DgenerateReports=false
Go to target/site/surefire-report.html for the report.
Wednesday, June 25, 2014
Windows - Track and kill the right process
If you try to delete a file/folder and Windows stop you, because there's alread an other process which lock it, then you can use Process Explorer to track and kill that process.
- Download & Install Process Exploerer
- Find -> Find Handle or DLL ...
- Insert the path of the file in "Handle or DLL substring:"
- Click the "Search" button
Wednesday, May 14, 2014
Tuesday, May 13, 2014
SVN - Credentials for corporate proxy
There a simple way to add the credentials to the svn client:
%appdata%\Subversion\servers
http-proxy-host=proxy-corpo
http-proxy-port=80
http-proxy-username=username
http-proxy-password=password
%appdata%\Subversion\servers
http-proxy-host=proxy-corpo
http-proxy-port=80
http-proxy-username=username
http-proxy-password=password
Friday, April 18, 2014
Maven - Start a new java project
mvn archetyp:generate
Group, ArtefactId, Version
mvn eclipse:eclipse
Then in Eclipse, you can import the Project:
Or you can create the Maven project directly in Eclipse:
File > New > Other... > Maven > Maven Project > Next > Next :
Group, ArtefactId, Version
Group, ArtefactId, Version
mvn eclipse:eclipse
Then in Eclipse, you can import the Project:
File > Import > Maven > Existing Maven Projects > Next > Browse to the Root Directory > Select the pom.xml > Finish
Or you can create the Maven project directly in Eclipse:
File > New > Other... > Maven > Maven Project > Next > Next :
Group, ArtefactId, Version
Sunday, April 13, 2014
XSLT - Processing tool
To process files:
xsltproc stylesheet.xslt file.xml
Friday, April 11, 2014
dos2unix
To convert all the files :
find . -type f -print0 | xargs -0 dos2unix
To convert all the files except those in the « .svn » directories :
find . -type f -not -iwholename '*.svn*' -print0 | xargs -0 dos2unix
Cygwin - Install (Windows)
www.cygwin.com
Add modules:
- dos2unix (Utils \ dos2unix)
- xsltproc (Libs \ libxslt)
- wget (Web \ wget)
- curl (Net \ curl)
- nc (Net \ nc)
- git (Devel \ git)
- svn (Devel \ subversion)
- ssh (Net \ openssh)
- scp (Net \ openssh)
- openssl (Net \ openssl)
Monday, March 17, 2014
Find path
Linux/UNIX/Mac OS X:
$ which java
Windows XP
for %i in (java.exe) do @echo. %~$PATH:i
Windows since 2003
where java
$ which java
Windows XP
for %i in (java.exe) do @echo. %~$PATH:i
Windows since 2003
where java
Tuesday, February 4, 2014
Configure crontab (UNIX/Linux)
If you are about to modify a crontab, it's better to keep a backup:
In command line:
> crontab -l > /home/usr/crontab_[Modification date : YYYY_MM_DD_hh_mm]_bk
To modify the crontab, you first need to create a copy of the actual configuration:
> crontab -l > /home/usr/crontab_current.txt
# .------------------- minute (0 - 59)
# | .--------------- hour (0 - 23)
# | | .----------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan, feb, mar, apr ...
# | | | | .--- day of week (0 - 6, Sunday = 0) OR sun, mon, tue, wed, thu, fri, sat
# | | | | |
# * * * * * command to be executed
# Operators : * = all
# , = and
# - = to
#
# Everyday of the week: 3:40, 7:40, 12:40, 16:40 and 22:40
40 3,7,12,16,22 * * * /application/script/run_refresh.sh param1 param2 > /dev/null
When the modification is over,
> crontab /home/usr/crontab_current.txt
If you are modifying the file in Windows, don't forget to convert the EOL:
> dos2unix /home/usr/crontab_current.txt /home/usr/crontab_current.txt
If you want to periodicaly delete log files, you can add this to the crontab:
> find /opt/logs -name "*.log" -type f -mtime +1 -delete
Commit Monitor - Install (Windows)
Commit Monitor is doing monitoring on the SVN server, so you can be notified when others are committing new modifications.
http://stefanstools.sourceforge.net/CommitMonitor.html
Cntlm - Install (Windows)
Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy
- Downdload from the official website : cntlm.sourceforge.net
- Unzip to the destination folder, we will call it CNTLM_HOME, ex.: C:\dev\Cntlm
- Create an environment variable (if you don't know how, click here)Name: CNTLM_HOME
Value: C:\dev\Cntlm (it's only an example, choose your destination's folder) - Add to the PATH this new variable CNTLM_HOME (if you don't know how, click here)
- Take a backup of the original configuration file %CNTLM_HOME%\cntlm.ini => cntlm.ini.default
- Remplace the content of the file in %CNTLM_HOME%\cntlm.ini by...# Cntlm Authentication Proxy ConfigurationUsername testuserDomain corp-uk# List of parent proxies to use. More proxies can be defined# one per line in format <proxy_ip>:<proxy_port>Proxy proxy-name:8080# List addresses you do not want to pass to parent proxies# * and ? wildcards can be usedNoProxy localhost, 127.0.0.*, 10.*, 192.168.*# Specify the port cntlm will listen on# You can bind cntlm to specific interface by specifying# the appropriate IP address also in format <local_ip>:<local_port># Cntlm listens on 127.0.0.1:3128 by defaultListen 3128Auth NTLMv2PassNTLMv2
- Replace by your own personal informations:Username testuserDomain corp-ukProxy proxy-name:8080
- In commande line type this command and enter your password :>cntlm -I -M http://test.com -c C:\dev\Cntlm\cntlm.ini[PASSWORD]Password:Config profile 1/4... OK (HTTP code: 200)----------------------------[ Profile 0 ]------Auth NTLMv2PassNTLMv2 AA1A11AAA11AAAA1AA11A1AAAA11A11A------------------------------------------------Notice: If you get an HTTP code 302, it's fine too.
- Copy the value of PassNTLMv2 from the output AA1A11AAA11AAAA1AA11A1AAAA11A11A to the file cntlm.ini, on the same line as PassNTLMv2
- In commande line:> cntlm -f -c C:\dev\Cntlm\cntlm.inicntlm: PID 15264: Cntlm ready, staying in the foreground
Node.js configure proxy (HTTP/HTTPS)
For example, if you are behind a corporate proxy , you can configure the credentials to pass through: In command line:
>npm config set proxy http://[username]:[passwprd]@ proxy-name:8080
>npm config set https-proxy http://[username]:[passwprd]@ proxy-name:8080
>npm config set registry "http://registry.npmjs.org/"
>npm config set proxy http://[username]:[passwprd]@
>npm config set https-proxy http://[username]:[passwprd]@
>npm config set registry "http://registry.npmjs.org/"
Analog - Filter
It's possible to extract the Apache logs and analyse only one part of it to generate the report:
FROM 140130:0000
TO 140130:2359
Exclude some files or files type:
For more details:
www.analog.cx/docs/custom.html
FROM 140130:0000
TO 140130:2359
Exclude some files or files type:
FILEEXCLUDE /test.html
FILEEXCLUDE /*.css
For more details:
www.analog.cx/docs/custom.html
Analog - Install (Windows)
Analog is a free weblog analysis computer program.
- Download from the official website: www.analog.cx/download.html
- Unzip to the destination folder, we will call it ANALOG_HOME, ex.: C:\dev\analog-6.0
- Create a directory for the log files in input, ex.: %ANALOG_HOME%\input (used by the parameter "LOGFILE")
- Create a folder for the report, ex.: %ANALOG_HOME%\reports\default (used by the parameter "OUTFILE")
- Copy images from the original directory to the report directory %ANALOG_HOME%\images => %ANALOG_HOME%\reports\default\images
- Replace the content of the file %ANALOG_HOME%\analog.cfg with this...
# Configuration file for analog 6.0
# See http://www.analog.cx/
#
# Here are a couple of configuration commands to get you started. Add any more
# you like from the Readme.
#
# Lines starting with # are comments.
#
# There is a much more extensive configuration file in examples/big.cfg
# The full list of these COLS commands is :
# YEARCOLS, QUARTERLYCOLS, MONTHCOLS, WEEKCOLS, DAYREPCOLS, DAYSUMCOLS, HOURREPCOLS,
# HOURSUMCOLS, WEEKHOURCOLS, QUARTERREPCOLS, QUARTERSUMCOLS, FIVEREPCOLS and FIVESUMCOLS.
# There is also a TIMECOLS command, which specifies that all the time reports are to have
# the specified columns.
#
# R Number of requests
# r Percentage of the requests
# P Number of page requests
# p Percentage of the page requests
# B Number of bytes transferred
# b Percentage of the bytes
#LANGUAGE FRENCH
FROM 120129:0000
TO 120129:2359
# If you need a LOGFORMAT command (most people don't -- try it without first!),
# it must go here, above the LOGFILE commands.
APACHELOGFORMAT (%h %l %T %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\")
LOGFILE C:\dev\analog-6.0\input\sawebext*
OUTFILE C:\dev\analog-6.0\reports\default\report.html
HOSTNAME "localhost"
#
# You probably don't need to change anything below this until you are
# experienced.
#
ERRFILE errors.txt
# REQINCLUDE pages
REQLINKINCLUDE pages
REFLINKINCLUDE *
REDIRREFLINKINCLUDE *
FAILREFLINKINCLUDE *
SUBBROW */*
SUBTYPE *.gz,*.Z
# OSCHARTEXPAND Windows
# Add whichever of these types of pages you have on your server, or others.
# PAGEINCLUDE *.shtml
# PAGEINCLUDE *.asp
# PAGEINCLUDE *.jsp
# PAGEINCLUDE *.cfm
# PAGEINCLUDE *.pl
# PAGEINCLUDE *.php
# More SEARCHENGINE commands can be found at
# http://www.analog.cx/helpers/#conffiles
SEARCHENGINE http://*google.*/* q,as_q,as_epq,as_oq
SEARCHENGINE http://*altavista.*/* q
SEARCHENGINE http://*yahoo.*/* p
SEARCHENGINE http://*lycos.*/* query,wfq
SEARCHENGINE http://*aol.*/* query
SEARCHENGINE http://*excite.*/* search
SEARCHENGINE http://*go2net.*/* general
SEARCHENGINE http://*metacrawler.*/* general
SEARCHENGINE http://*msn.*/* q,MT
SEARCHENGINE http://*netscape.*/* search
SEARCHENGINE http://*looksmart.*/* key
SEARCHENGINE http://*webcrawler.*/* qkw,search,searchText
SEARCHENGINE http://*overture.*/* Keywords
SEARCHENGINE http://*teoma.*/* q
SEARCHENGINE http://*infospace.*/* qkw
SEARCHENGINE http://*alltheweb.*/* q
SEARCHENGINE http://*dogpile.*/* q
SEARCHENGINE http://*ask.*/* q,ask
SEARCHENGINE http://*alltheweb.*/* query
SEARCHENGINE http://*northernlight.*/* qr
SEARCHENGINE http://*nlsearch.*/* qr
SEARCHENGINE http://*dmoz.*/* search
SEARCHENGINE http://*/netfind* query
SEARCHENGINE http://*/pursuit query
ROBOTINCLUDE REGEXPI:robot
ROBOTINCLUDE REGEXPI:spider
ROBOTINCLUDE REGEXPI:crawler
ROBOTINCLUDE Googlebot*
ROBOTINCLUDE msnbot*
ROBOTINCLUDE Infoseek*
ROBOTINCLUDE Scooter*
ROBOTINCLUDE *Slurp*
ROBOTINCLUDE *Validator*
ROBOTINCLUDE Ultraseek*
TYPEALIAS .html ".html [Hypertext Markup Language]"
TYPEALIAS .htm ".htm [Hypertext Markup Language]"
TYPEALIAS .shtml ".shtml [Server-parsed HTML]"
TYPEALIAS .ps ".ps [PostScript]"
TYPEALIAS .gz ".gz [Gzip compressed files]"
TYPEALIAS .tar.gz ".tar.gz [Compressed archives]"
TYPEALIAS .jpg ".jpg [JPEG graphics]"
TYPEALIAS .jpeg ".jpeg [JPEG graphics]"
TYPEALIAS .gif ".gif [GIF graphics]"
TYPEALIAS .png ".png [PNG graphics]"
TYPEALIAS .txt ".txt [Plain text]"
TYPEALIAS .cgi ".cgi [CGI scripts]"
TYPEALIAS .pl ".pl [Perl scripts]"
TYPEALIAS .css ".css [Cascading Style Sheets]"
TYPEALIAS .class ".class [Java class files]"
TYPEALIAS .pdf ".pdf [Adobe Portable Document Format]"
TYPEALIAS .zip ".zip [Zip archives]"
TYPEALIAS .hqx ".hqx [Macintosh BinHex files]"
TYPEALIAS .exe ".exe [Executables]"
TYPEALIAS .wav ".wav [WAV sound files]"
TYPEALIAS .avi ".avi [AVI movies]"
TYPEALIAS .arc ".arc [Compressed archives]"
TYPEALIAS .mid ".mid [MIDI sound files]"
TYPEALIAS .mp3 ".mp3 [MP3 sound files]"
TYPEALIAS .doc ".doc [Microsoft Word document]"
TYPEALIAS .rtf ".rtf [Rich Text Format]"
TYPEALIAS .mov ".mov [Quick Time movie]"
TYPEALIAS .mpg ".mpg [MPEG movie]"
TYPEALIAS .mpeg ".mpeg [MPEG movie]"
TYPEALIAS .asp ".asp [Active Server Pages]"
TYPEALIAS .jsp ".jsp [Java Server Pages]"
TYPEALIAS .cfm ".cfm [Cold Fusion]"
TYPEALIAS .php ".php [PHP]"
TYPEALIAS .js ".js [JavaScript code]"
TYPEALIAS .do ".do [Java code]"
TYPEALIAS .action ".action [Java code]"
# General Summary: This report contains overall statistics.
GENERAL ON
# Yearly Report
YEARLY OFF
#YEARGRAPH R
# Quarterly Report
QUARTERLY OFF
#QUARTERLYGRAPH R
# Monthly Report
MONTHLY OFF
#MONTHGRAPH R
# Weekly Report
WEEKLY OFF
#WEEKGRAPH R
# Daily Report: This report lists the activity in each day.
DAILYREP ON
DAYREPCOLS RrB
#DAYREPGRAPH R
# Daily Summary
DAILYSUM OFF
#DAYSUMCOLS RrB
#DAYSUMGRAPH R
# Hourly Report: This report lists the activity in each hour.
HOURLYREP ON
HOURREPCOLS RrB
#HOURREPGRAPH R
# Hourly Summary
HOURLYSUM OFF
#HOURSUMCOLS RrB
#HOURSUMGRAPH R
# Hour of the Week Summary
WEEKHOUR OFF
#WEEKHOURCOLS RrB
#WEEKHOURGRAPH R
# Quarter-Hour Report: This report lists the activity in each quarter-hour period.
QUARTERREP ON
QUARTERREPCOLS RrB
#QUARTERREPGRAPH R
# Quarter-Hour Summary
QUARTERSUM OFF
#QUARTERSUMCOLS RrB
#QUARTERSUMGRAPH R
# Five-Minute Report: This report lists the activity in each five-minute period.
FIVEREP ON
FIVEREPCOLS RrB
#FIVEREPGRAPH R
# Five-Minute Summary
FIVESUM OFF
#FIVESUMGRAPH R
# Host Report
HOST OFF
#HOSTFLOOR 20r
# Host Redirection Report
REDIRHOST OFF
#REDIRHOSTFLOOR 20r
# Host Failure Report: This report lists the computers which encountered failed requests.
FAILHOST OFF
#FAILHOSTFLOOR 20r
# Organisation Report
ORGANISATION OFF
#ORGFLOOR 20r
# Domain Report
DOMAIN OFF
#DOMFLOOR 20r
# Request Report: This report lists the files on the site.
REQUEST ON
# Include in the Request Report all files with at least 1 request
REQFLOOR 1r
# Directory Report
DIRECTORY OFF
#DIRFLOOR 20r
# File Type Report
FILETYPE OFF
#TYPEFLOOR 20r
# File Size Report
SIZE OFF
# Processing Time Report: This report lists the times taken to process successful requests.
PROCTIME ON
# Redirection Report
REDIR OFF
#REDIRFLOOR 20r
# Failure Report: This report lists the files that caused failures, for example files not found.
FAILURE ON
FAILFLOOR 1r
# Referrer Report: This report lists the referrers (where people followed links from, or pages which included this site's images).
REFERRER ON
REFFLOOR 500r
# Referring Site Report
REFSITE ON
REFSITEFLOOR 1r
# Search Query Report
SEARCHQUERY ON
SEARCHQUERYFLOOR 3r
# Search Word Report
SEARCHWORD OFF
#SEARCHWORDFLOOR 20r
# Internal Search Query Report
INTSEARCHQUERY OFF
#INTSEARCHQUERYFLOOR 20r
# Internal Search Word Report
INTSEARCHWORD OFF
#INTSEARCHWORDFLOOR 20r
# Redirected Referrer Report: This report lists the referrers that caused redirected requests.
REDIRREF OFF
#REDIRREFFLOOR 20r
# Failed Referrer Report: This report lists the referrers containing broken links to the site.
FAILREF OFF
#FAILREFFLOOR 20r
# Browser Report: This report lists the browsers used by visitors.
BROWSERREP OFF
#BROWREPFLOOR 1r
# Browser Summary: This report lists the vendors of visitors' browsers.
BROWSERSUM OFF
#BROWSUMFLOOR 20r
# Operating System Report
OSREP OFF
#OSFLOOR 20r
# Virtual Host Report
VHOST OFF
#VHOSTFLOOR 20r
# Virtual Host Redirection Report
REDIRVHOST OFF
#REDIRVHOSTFLOOR 20r
# Virtual Host Failure Report
FAILVHOST OFF
#FAILVHOSTFLOOR 20r
# User Report
USER OFF
#USERFLOOR 20r
# User Redirection Report
REDIRUSER OFF
#REDIRUSERFLOOR 20r
# User Failure Report
FAILUSER OFF
#FAILUSERFLOOR 20r
# Status Code Report: This report lists the HTTP status codes of all requests.
STATUS ON
#STATUSFLOOR 20r
ALLGRAPH R
TIMECOLS Rr
BARSTYLE b
FILEEXCLUDE /test.html
FILEEXCLUDE /*.js
FILEEXCLUDE /*.jpg
FILEEXCLUDE /*.jpeg
FILEEXCLUDE /*.png
FILEEXCLUDE /*.css
FILEEXCLUDE /*.png
FILEEXCLUDE /*.xml
FILEEXCLUDE /*.gif
FILEEXCLUDE /*.ico
FILEEXCLUDE /*.mp3
FILEEXCLUDE /*.pdf
FILEEXCLUDE /*.swf
FILEEXCLUDE /*.txt
Monday, February 3, 2014
Port already in use (Windows)
If you have difficulty to start a server on Windows, verify first that the port of the server is still free (ex.: 80).
In command line:
> netstat -aon | find /i "listening"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 13036
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 740
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 13036
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING 488
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 784
TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 1116
TCP 0.0.0.0:5631 0.0.0.0:0 LISTENING 1188
TCP 0.0.0.0:8008 0.0.0.0:0 LISTENING 1380
TCP 127.0.0.1:1075 0.0.0.0:0 LISTENING 4980
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING 1468
TCP 172.26.156.30:139 0.0.0.0:0 LISTENING 4
TCP 172.26.156.30:52028 0.0.0.0:0 LISTENING 1116
And then, you just need to find what is this process for:
> tasklist | find /i "13036"
httpd.exe 13036 Console 0 1,024 K
In command line:
> netstat -aon | find /i "listening"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 13036
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 740
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 13036
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING 488
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 784
TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 1116
TCP 0.0.0.0:5631 0.0.0.0:0 LISTENING 1188
TCP 0.0.0.0:8008 0.0.0.0:0 LISTENING 1380
TCP 127.0.0.1:1075 0.0.0.0:0 LISTENING 4980
TCP 127.0.0.1:5152 0.0.0.0:0 LISTENING 1468
TCP 172.26.156.30:139 0.0.0.0:0 LISTENING 4
TCP 172.26.156.30:52028 0.0.0.0:0 LISTENING 1116
And then, you just need to find what is this process for:
> tasklist | find /i "13036"
httpd.exe 13036 Console 0 1,024 K
Subscribe to:
Posts (Atom)