You need to install following packages before installing sdkman:
sudo apt-get install unzip
sudo apt-get install zip
sudo apt-get install sed
Uninstall skdman if you installed already:
# Fail2Ban configuration file | |
# | |
# NOTE | |
# You should set up in the jail.conf file, the maxretry and findtime carefully in order to avoid false positives. | |
# | |
# Author: http://www.go2linux.org | |
# Modified by: samnicholls.net | |
# * Mon 6 Jun 2016 - Updated failregex to capture HOST group correctly | |
[Definition] |
<template> | |
<div id="map" class="map"> | |
<div class="button-bar"> | |
<button v-on:click="addMapLayer()">terrain</button> | |
</div> | |
</div> | |
</template> | |
<script> |
###Exception:
Caused by: java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:407)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:623)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
... 31 more
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.springframework.http.*; | |
import org.springframework.web.client.RestTemplate; | |
class PostJacksonObjectViaRestTemplate { | |
public static void main(String[] args) throws Exception { | |
String url = "http://localhost:8080/example/"; | |
HttpHeaders headers = new HttpHeaders(); |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
@ControllerAdvice | |
public class CustomResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { | |
@Override | |
protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { | |
List<FieldError> fieldErrors = ex.getBindingResult().getFieldErrors(); | |
List<ObjectError> globalErrors = ex.getBindingResult().getGlobalErrors(); | |
List<String> errors = new ArrayList<>(fieldErrors.size() + globalErrors.size()); | |
String error; | |
for (FieldError fieldError : fieldErrors) { |
Two ways to do it, but only worked for me so I'll put it first and the second for reference:
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem
Other options for this method in comments below:
# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hostname.key -certfile root.crt -out hostname.p12