Skip to content

Instantly share code, notes, and snippets.

View cugni's full-sized avatar

Cesare Cugnasco cugni

View GitHub Profile
@cugni
cugni / gist:38d018f2ce56f78abff1
Created March 5, 2016 21:56
Remove old kernels
sudo apt-get purge $(for tag in "linux-image" "linux-headers"; do dpkg-query -W -f'${Package}\n' "$tag-[0-9]*.[0-9]*.[0-9]*" | sort -V | awk 'index($0,c){exit} //' c=$(uname -r | cut -d- -f1,2); done)
@cugni
cugni / build.sbt
Last active August 29, 2015 14:01
Log4j2 via SLF: Config file and pom
// Dependencies for logging
libraryDependencies += "org.apache.logging.log4j" % "log4j-api" % "2.0"
libraryDependencies += "org.apache.logging.log4j" % "log4j-core" % "2.0"
libraryDependencies += "org.apache.logging.log4j" % "log4j-1.2-api" % "2.0"
libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.7"
@cugni
cugni / gist:9228407
Last active May 27, 2022 10:28
Javadoc with mathjax
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<!-- I can haz math in my javadoc (see http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html) -->
<additionalparam>-header '&lt;script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"&gt;&lt;/script&gt;'</additionalparam>
</configuration>
<executions>
<execution>
@cugni
cugni / pom.xml
Last active August 29, 2015 13:56
create a jar with Maven with all dependencies and main class
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.mydomain.myentrypoint</mainClass>
<packageName>com.mydomain.</packageName>
</manifest>