quote

sabato, giugno 20, 2015

Ubuntu - Grouping Windows taskbar

Bottom Left - Right click - Properties


giovedì, giugno 18, 2015

Avoiding CORS issues with chromium

Install 'Chromium Web Browser' in ubuntu through Ubuntu Software Center.
From any location type:

$ chromium-browser --disable-web-security &

This avoid limitations of browsers with CORS.

venerdì, giugno 05, 2015

Firefox SSL issue

Questo riepilogo non è disponibile. Fai clic qui per visualizzare il post.

venerdì, maggio 29, 2015

"Venture" Meet Suport Organizations Zurich - May 28th 2015

Here some notes, in random order, taken from the event which took place yesterday at the ETH in Zurich, subject: support for startups in Switzerland.
Question is, with all these private and government agencies,  from what to start with your idea of startup, assuming you have already it?  I feel a bit confused.

giovedì, aprile 23, 2015

Linux/Unix useful commands

  • ls | wc -l (number of files in a folder)
  • $ find . -iname 'Courses.json' -> find in the current folder and subfolders the file 'Courses.json'
  • $ grep MemTotal /proc/meminfo
  • $find . -type f -name '*.DS_Store*' -delete

mercoledì, aprile 01, 2015

git useful commands

################ git commands  ################

$ git config --global user.name "Enrico Giurin"
$ git init --> creates local repo  /users/enrico/store/.git
$ git add xxx
$ git commit -m ".." .
$ git status
$ git add --all .

branch: master
$ git add --all
creates snapshot
$ git log
##############################

$ git diff
$ git reset
$ git reset --hard - undo local changes since that revision
$ git checkout --   (blow way all changes since last commit)
$ git commit -a -m "xxx"  add & commit
$ git reset --soft HEAD               undo last commit
$ git commit --amend -m "..."         changed the last commit
$ git reset --hard HEAD^   undo last commit and all changes
$ git reset --hard HEAD^^  undo last 2 commits and all changes
$ git push
$ git pull
- origin: name of the remote repository
$ git remote add origin https.//github.com/egch/xxx
$ git remote -v
$ git push -u origin master  (origin: remote / master: local)
##############################

$ git clone
$ git clone yourName
$ git remote -v
$ git branch   (cat)
$ git checkout cat
$ git checkout master
$ git merge cat
$ git branch -d cat (removing branch cat)
$ git checkout -b admin (switch and create a new branch)
--> go back to master
$ git checkout master
(fix something in the master and now we merge the admin)
$ git merge admin
vi editor
git log ( a message log related to the merge)
##############################

$ git pull  (fetch)

$ git push
$ git commit -a -m "merged"(after merge)

<<<<< my version
>>>>> their version

##############################
$ git checkout -b shopping_cart
$ git push origin shopping_cart
$ git push
[jane] $ git pull
$ git branch
$ git branch -r (remote branches)
$ git checkout shopping_cart
$ git remote show origin
$ git push origin :shopping_cart (to delete the remote branch)
$ git branch -d shopping_cart (trying to delete local branch)
$ git branch -D shopping_cart (force to delete local branch)
$ git remote prune origin (to cleanup delete remote branches)
$ git tag (list all tags)
$ git checkout v0.0.1  (checkout code at commit)
$ git tag -a v0.0.3 -m "version" (to create a new tag)
$ git push --tags (to push the tags)

########################################
$ git log
$ git config --global color.ui true
$ git log --pretty=oneline
$ gitl log --pretty=format: "%h %ad- %s [%an]"
(ad=author date, an=author name,h=SSH hash, s=subject,d=ref names)
$ git log --online -p
$ git log --online --stat
$ git log --online --graph
$ git log --since=2000-02-02 --until=2003-10-10
$ git diff
$ git diff HEAD~5  (5 commits ago)
$ git diff master bird
$ git diff --since=1.month.ago --until=2.minutes.ago
$ git blame list.html --date short
.git/info/exlude : to esclude some files from commit
pattern: logs/*.log
.gitignore  (logs/*.log)
$ git rm README.txt
$ git rm --cached mylog.log
$ git config --global core.editor notepad++
ALIASES
$ git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"
$ git myLog

giovedì, marzo 26, 2015

Windows 32-64 bit

http://windows.microsoft.com/en-us/windows7/find-out-32-or-64-bit
Vista: Click the Start button , right-click Computer, and then click Properties.

mercoledì, dicembre 17, 2014

martedì, novembre 25, 2014

Create a simple maven project


$ mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart 

It works in interactive mode, so you will be asked to type groupId, atifactId and so on.
Here how to create a webapp template from the maven archetype plugin in not interactive mode.
$ mvn archetype:generate -DgroupId=org.enricogiurin.poc -DartifactId=maven-usage -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
Resources:
https://maven.apache.org/archetype/maven-archetype-bundles/maven-archetype-quickstart/
http://www.mkyong.com/maven/how-to-create-a-web-application-project-with-maven/
http://maven.apache.org/guides/mini/guide-building-for-different-environments.html
http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html

To make compatible with java 8, add this:


<plugin>    
<groupId>org.apache.maven.plugins</groupId>    
<artifactId>maven-compiler-plugin</artifactId>    
<version>2.3.2</version>
<configuration>
<source>1.8</source>        
<target>1.8</target>    
</configuration>
</plugin>

lunedì, novembre 25, 2013

Soup with vegetables

Here a simple recipe to prepare a tasty soup with vegetables. Before starting make sure you have the following ingredients: 2 potatoes without peel, 3 carrots, 10 green beans with the ends cut, 1 pepper, 300ml tomato sauce, salt, oil of olive, 1 onion without peel.
So, let's start!
  • Cut the potatoes, carrots, green beans, pepper, onion in small pieces, not so small though.
  • Put these ingredients in a pot and fill it with the water.
  • Light the fire and wait till the water in the pot start to boil.
  • Once it's boiling reduce the level of firing to minimum and let it boil for other 60 minutes; really this is important, the level of firing should be very low, you should observe the level of water just boiling a bit.
  • Add the potatoes in the pot.
  • Add two spoons of oil of olive and a bit of salt.
  • Let it boil, always with low fire, for about 25 minutes.
  • Add the tomato sauce and half of dado knorr
  • Let it boil for the last 5 minutes.
Finally serve it hot in a dish with some slices of bread.
I learned how to prepare it today in the soup session with my friend Cristian, I hope to have not forgotten some steps so I won't consider myself responsible of the success of the soup ;-)

giovedì, novembre 21, 2013

Building Reactive Apps @ Jug Lausanne

Yesterday I've participated at the meeting @ JUG Lausanne, where there was a presentation with the title "Building Reactive Apps" kept by James Ward.
In the room there were about 40 persons and the speech was kept in English.
After having talked about the reactive manifesto , the speaker shortly introduced the principles of reactive programming
Has followed a demo of how to build a reactive application with the play framework, where he showed the usage of Future classes. Other topics were related websocket, actors in AKKA, scala and so on.
I think I'll give a try to these new technologies.

venerdì, settembre 13, 2013

NoClassDefFoundError in Jboss with maven EJB plugin when using SNAPSHOT dependencies

Context: Jboss 5.1.0, maven 2.x, snapshot dependencies.
Problem: I got this exception after deployed my ear in jboss 5.1.

EAR name: myEAR.ear
ejb component: services.jar

Jboss classloader cannot find the myPackage/MyInterface.class when this is a SNAPSHOT dependency of my services.jar.

Solution: Correct configuration of the maven ejb plugin.
You need to set to false the useUniqueVersion attribute.

org.apache.maven.plugins maven-ejb-plugin 3.0 true false Exception stack-trace:

er.MBeanServerImpl@52f97d27[ defaultDomain='jboss' ]
2013-09-13 14:22:03,699 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to PostClassLoader: name=vfszip:/usr/local/jboss-5.1.0.GA-jdk/server/standard/deploy/myEAR.ear/ state=ClassLoader mode=Manual requiredState=PostClassLoader
org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/usr/local/jboss-5.1.0.GA-jdk/server/standard/deploy/myEAR.ear/services.jar/
        at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
        at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
        at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
        at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
        at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
        at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
        at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
        at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
        at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
        at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
        at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
        at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
        at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
        at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
        at org.jboss.Main.boot(Main.java:221)
        at org.jboss.Main$1.run(Main.java:556)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NoClassDefFoundError: myPackage/MyInterface
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
        at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572)
        at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530)
        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:507)
        at org.jboss.classloader.spi.base.BaseDelegateLoader.loadClass(BaseDelegateLoader.java:134)
        at org.jboss.classloader.spi.filter.FilteredDelegateLoader.loadClass(FilteredDelegateLoader.java:131)