Details:

  • java 1.7.0_25
  • grails 2.4.5
  • vaadin plugin 7.5.2

Create Grails app in ItelliJ IDEA 14 as in this manual –
https://vaadin.com/wiki/-/wiki/Main/Vaadin+on+Grails+-+Create+project+in+IntelliJ+IDEA
But use only 1. and 2. points.

After 2. point use next suggestions:

add to BuildConfig.groovy:
to dependencies – runtime ‘org.hibernate:hibernate-validator:5.1.1.Final’
to plugings – compile “:vaadin:7.5.2”
click Apply Grails changes to IDEA project structure

run – grails vaadin-quickstart

Next couple steps:

Screenshot 2015-08-26 23.25.28

Screenshot 2015-08-26 23.29.08

press “+” and select Grails:

Screenshot 2015-08-26 23.30.51

Screenshot 2015-08-26 23.30.51(2)

Screenshot 2015-08-26 23.30.52

select “your app” in Module:

Screenshot 2015-08-26 23.30.52(2)

change name on “your app name”:

Screenshot 2015-08-26 23.30.52(3)

result:

Screenshot 2015-08-26 23.30.52(4)

Thats all.

def someMap = [
           'phones':['iPhone','Galaxy','Nexus'],
           'laptops':['HP','MacBook','Samsung'],
           'tablets':['Galaxy Tab','iPad','Asus'],
           ]

someMap.eachWithIndex{ k, v, index -> println "${k}:${v} - ${index}" }


Result:
phones:[iPhone, Galaxy, Nexus] – 0
laptops:[HP, MacBook, Samsung] – 1
tablets:[Galaxy Tab, iPad, Asus] – 2

def map = [a:"cc", b: "dd"]
println "map - " + map
println "map.keySet() - " + map.keySet()
println "map.values() - " + map.values()
println "map.entrySet() - " + map.entrySet()
println "map.entrySet().key - " + map.entrySet().key
println "map.entrySet().value - " + map.entrySet().value


Result:
map – [a:cc, b:dd]
map.keySet() – [a, b]
map.values() – [cc, dd]
map.entrySet() – [a=cc, b=dd]
map.entrySet().key – [a, b]
map.entrySet().value – [cc, dd]


apt-get install pptpd 

nano /etc/pptpd.conf 
localip 10.0.0.1 
remoteip 10.0.0.100-200 

nano /etc/ppp/chap-secrets 
username pptpd password * 

nano /etc/ppp/pptpd-options 
ms-dns 8.8.8.8 
ms-dns 8.8.4.4

service pptpd restart

check:
netstat -alpn | grep :1723

nano /etc/sysctl.conf
net.ipv4.ip_forward = 1

sysctl -p

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables -I INPUT -s 10.0.0.0/8 -i ppp0 -j ACCEPT
iptables --append FORWARD --in-interface eth0 -j ACCEPT

# ======================== ufw ===================

ufw allow 22 
ufw allow 1723 

nano /etc/ufw/before.rules 
# NAT table rules 
*nat 
:POSTROUTING ACCEPT [0:0] 
# Allow forward traffic to eth0 
-A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE 
# Process the NAT table rules 
COMMIT 

# before the line # drop INVALID packets ... add: 
-A ufw-before-input -p 47 -j ACCEPT 

ufw disable 
ufw enable