Tuesday, February 4, 2014

bash

Comment = '#'
Shell   = '$'
Output  = '>'

## Print Working Directory
$ pwd


## Change Directory: to /directory
$ cd /directory
# Examples:
>/directory
# Change Directory, from: /directory to /
$ cd ..
>/
# Change Directory: previous directory
$ cd - 
# Change Directory: go to home
$ cd
# Or
$ cd ~
>~


## Display output one screen at a time
$ less file
$ more file


## Concatenate and print (display) the content of file(s)
$ cat file1
# Or
$ cat file1 file2
# Examples:
$ cat File1.txt File2.txt > union.txt
$ sort -u File1.txt File2.txt > unique_union.txt
# Put the contents of a file into a variable
$ my_variable=`cat File3.txt`


## Create a test file
$ echo "test" > test.txt


## Filename and Directory Completion
$ cd /opt/I[TAB]
> cd /opt/IBM
$ cd /opt/IBM[TAB][TAB]
>IBM/         IBMinvscout/


## List of Variablenames
$ $[TAB][TAB]


## Variablename Completion
$B[TAB]
>$BASH


## Print variable's value
$ echo $BASH_VERSION
> 4.2.45(1)-release


## Username's list
$ cd ~[TAB][TAB]


## Hostname's list
$ ssh @[TAB][TAB]


## Run a command script in the current shell
$ ./download-logs.sh


## Search the user's $path for a program file
$ which ssh
>/usr/bin/ssh


## Copy one or more files to another location
$ cp f1 f2


## Move or rename files or directories
$ mv old_name new_name


## TAR + GZIP
$ tar -czvf archive.tgz files/


## Create a symbolic link to a file or a directory
$ ln -s [OriginalSourceFile] [NewLinkFile]


## Change access permissions
# http://ss64.com/bash/chmod.html
$ chmod access file
# Examples:
$ chmod u+x script.sh
$ chmod a-x file
$ chmod go+rw file
# Read by owner
$ chmod 400 file
# Allow everyone to read, write, and execute file
$ chmod 777 file


## Change file owner and group
$ chown [user] [filename]
# Examples:
# Owner => root
$ chown root file
# Group => admin
$ chown :admin file
# Owner => root AND Group => admin
$ chown root:admin file


## Change group ownership
$ chgrp [group] [filename]
# Examples:
$ chgrp oracle /usr/database


## Change file timestamps
$ touch filename
# Exemples:
$ touch -d "2 hours ago" filename
$ find DIRECTORY -exec touch -d "2 hours ago" {} +
$ find /opt/phantomjs/tomcat/apache-tomcat-6.0.37/logs/ -type f -mtime +30 -exec rm -f {} \;


## Find a specific file
$ find . -type f -name log4j*
# Examples:
# Fin a file and change the modification date
$ find DIRECTORY -exec touch -d "2 hours ago" {} +


## Reload shell configurations
$ source ~/.profile
# Or
$ source ~/.bashrc


## Exceute last command starting by 'command'
$ !command


## Remote connection with SSH
$ ssh user@hostname
>password


## Copy a remote file
# Push:
$ scp location user@othermachine.com:destination
# Pull:
$ scp user@othermachine.com:location destination
# The '-r' parameter is used to copy an entire directory, or you may use * to match on multiple files/directories.


## Find a command from the history
$ history | grep command


## Maven
$ mvn clean package
## SVN
#Checkout
$ svn co https://sasvnd1.int.videotron.com/svn/...
# Update
$ svn up
## Delete a file
$ rm file
# Delete many files starting with the letter f
$ rm f*
# Delete a directory
$ rm -r directory


## Debug Apache/IHS configurations
httpd.exe -e debug -k start
# Restart Apache/IHS with new configurations
$ httpd.exe -k restart


## head & tail
# Print the first lines of a file (default: 10 lines)
$ head -100 file.log
# Print the last lines of a file (default: 10 lines)
$ tail -100 file.log
# Extract lines 40-50 from a file, first using head to get the first 50 lines then tail to get the last 10:
$ head -50 file.log | tail -10


## Load bash as default shell
$ vi .profile
# Add:
bash


## Add an alias in the bash
$ vi ~/.bashrc
# Add
alias ALIAS_NAME='command'
# Examples:
alias ll='ls -l'
alias tailf="tail -f SystemOut.log"


## Customize the shell prompt
$ export PS1="\n\u@\h \w\n$ "
# http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html


## Execute many commands in an "atomic" way
$ command1;command2
# Examples:
$ alias logs="cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs;ls"
$ rm app; ln -s app_AAAAMMDD app


## Configure a "daemon"
$ crontab crontab_file
# Print the current crontab
crontab -l 
# To debug the daemon, we need the mail because the deamon will tell us if a task had a problem
mail


## Open a file in edit mode (or create it with a ':wq' at the end)
vi file


## Create a shell script
$ echo "#!/bin/bash" > script.sh
$ vi script.sh
$ chmod u+x script.sh


## Process viewer
$ top
# Or
$ ps
# Examples:
$ ps -ef | grep tomcat

See also:
http://ss64.com/bash/

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


  1. Downdload from the official website : cntlm.sourceforge.net
  2. Unzip to the destination folder, we will call it CNTLM_HOME, ex.: C:\dev\Cntlm
  3. 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)
  4. Add to the PATH this new variable CNTLM_HOME (if you don't know how, click here)
  5. Take a backup of the original configuration file %CNTLM_HOME%\cntlm.ini => cntlm.ini.default
  6. Remplace the content of the file in %CNTLM_HOME%\cntlm.ini by...
    # Cntlm Authentication Proxy Configuration
    Username testuser
    Domain 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 used
    NoProxy 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 default
    Listen 3128

    Auth       NTLMv2
    PassNTLMv2 
  7. Replace by your own personal informations:
    Username testuser
    Domain corp-uk
    Proxy proxy-name:8080
  8. 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            NTLMv2
    PassNTLMv2      AA1A11AAA11AAAA1AA11A1AAAA11A11A
    ------------------------------------------------
    Notice: If you get an HTTP code 302, it's fine too.
  9. Copy the value of PassNTLMv2 from the output AA1A11AAA11AAAA1AA11A1AAAA11A11A to the file cntlm.ini, on the same line as PassNTLMv2 
  10. In commande line:
    > cntlm -f -c C:\dev\Cntlm\cntlm.ini
    cntlm: 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/"

Adding a folder to the PATH (Windows)

The PATH variable in Windows is the list of the folders you can have directly access to their files in command line.  They are separated by a semicolon (;) and actually you can have to PATH variables, one for the user and an other for the system, but in the end they are merged.


  1. Press [Windows] + [Pause] keys
  2. Click on the "Advanced" tab
  3. Click on the "Environment Variables" button
  4. Choose the scope's level : "User variables for xyz" or "System variables" and select the PATH variable
  5. Click on "Edit" button
  6. In the value's field, go to the end of the current value and add a semicolon if there's not already one, then add the path to the folder you want to add, ex.: "%SystemRoot%\system32;C:\dev\Java\jdk1.7.0_51\bin".  If you want to use an other environment variable's value, simply specify the name of the value surrounded by the percent character (%), ex.: "%SystemRoot%\system32;%JAVA_HOME%\bin" would have the same result if the JAVA_HOME variable contain the value "C:\dev\Java\jdk1.7.0_51".
  7. Click on the "OK" button
  8. Click on the "OK" button
  9. Click on the "OK" button

The path "C:\dev\Java\jdk1.7.0_51\bin" is now declared in the PATH.

Creating an environment variable (Windows)

An environment variable is a variable you can have access from anywhere in the Operating System, for example in command line:
> echo %USERNAME%
elenigen

Some are already available in Windows, like USERNAME, USERPROFILE, PATH, etc.  Some can be created by the user.  You can even choose the scope of the variable, by creating it in the user or system's level.

  1. Press [Windows] + [Pause] keys
  2. Click on the "Advanced" tab
  3. Click on the "Environment Variables" button
  4. Choose the scope's level : "User variables for xyz" or "System variables"
  5. Click on the "New" button
  6. Enter variable's name and value.
  7. Click on the "OK" button
  8. Click on the "OK" button
  9. Click on the "OK" button
The new variable has been created!  The tricky part now is, all current command line windows which were already opened before the creation of this new variable, they don't have access to it, so you need to close and reopen the command line.

See also:
ss64.com/nt/syntax-variables.html

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:
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.
  1. Download from the official website: www.analog.cx/download.html
  2. Unzip to the destination folder, we will call it ANALOG_HOME, ex.: C:\dev\analog-6.0
  3. Create a directory for the log files in input, ex.: %ANALOG_HOME%\input (used by the parameter "LOGFILE")
  4. Create a folder for the report, ex.: %ANALOG_HOME%\reports\default (used by the parameter "OUTFILE")
  5. Copy images from the original directory to the report directory %ANALOG_HOME%\images => %ANALOG_HOME%\reports\default\images
  6. 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

Links

Technologies

angularjs.org
nodejs.org
www.java.com
lucene.apache.org/solr
cassandra.apache.org

Small Projects (github, google code, sourceforge,...)

github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
twitter.github.io/typeahead.js


Products ($)

puppetlabs.com
www.jetbrains.com/idea
c9.io
travis-ci.com
JRebel

Tools

yeoman.io | gruntjs.com | bower.io
guardgem.org
phantomjs.org
pivotal.github.io/jasmine
code.google.com/p/mockito
jenkins-ci.org
subversion.apache.org | stefanstools.sourceforge.net/CommitMonitor.html
puppetlabs.com/puppet/what-is-puppet
www.ansible.com
www.md5summer.org
www.rapidee.com
atom.io
www.docker.com
www.vagrantup.com
www.virtualbox.org
couchdb.apache.org
grafana.org
collectd.org
StatsD
Reveal.js (hosting: slides.com)
JVisualVM
JConsole
JStat
JStatsD


Libraries

angular-ui.github.io
code.google.com/p/guava-libraries
www.ehcache.org
www.memcached.org


Tutorials

tutsplus.com
www.mkyong.com
try.github.io


Articles

www.infoq.com
www.theserverside.com
www.dzone.com
www.javaworld.com


Sharing Examples

plnkr.co
jsfiddle.net
codepen.io


Project Starter

html5boilerplate.com
getbootstrap.com
bootswatch.com
fontawesome.io/cheatsheet
github.com/angular/angular-seed


Documentation

Google Java Style

S.O.L.I.D

Single Responsability Principle 
Open ext Close mod Principle 
Liskov substitution principle 
Interface segregation Principle 
Dependency Inversion Principle 



Single responsibility principle 
A class should have only a single responsibility. 

Open/closed principle 
“software entities … should be open for extension, but closed for modification”. 

Liskov substitution principle 
“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program”. See also design by contract. 


Interface segregation principle 
“many client-specific interfaces are better than one general-purpose interface.” 

Dependency inversion principle 
One should “Depend upon Abstractions. Do not depend upon concretions.” Dependency injection is one method of following this principle.

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