Skip to content

Instantly share code, notes, and snippets.

View silkentrance's full-sized avatar

Carsten Klein silkentrance

View GitHub Profile
@silkentrance
silkentrance / TestApplication.java
Last active May 26, 2023 09:23
Spring Boot Open Feign Client Integration Testing
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.MapPropertySource;
import org.springframework.util.SocketUtils;
import java.util.HashMap;
import java.util.Map;
@silkentrance
silkentrance / Confluence SVG inline display
Last active November 19, 2021 21:53
Confluence Server : Display Embedded SVG inline
Add the following to your confluence server Custom HTML (At end of HEAD)
```
<style type="text/css">
.confluence-embedded-file[data-mime-type="image/svg+xml"] span {
display: none;
visibility: hidden;
}
</style>
@silkentrance
silkentrance / Anti Log4Shell Nginx Configuration
Last active December 15, 2021 18:23
Anti Log4Shell Nginx Configuration
# Based Upon
This is a dumbed down version of the below provided code which seems to be overly complex to me.
https://www.infiniroot.com/blog/1155/using-nginx-lua-script-mitigate-log4shell-cve-2021-44228-vulnerability
@silkentrance
silkentrance / Confluence: View PDF Attachments inline instead of downloading them
Last active April 24, 2022 15:58
Confluence: View PDF Attachments inline instead of downloading them
Locate your confluence server deployment root, e.g. ``/foo/atlassian/confluence/7.x.x``
```bash
> cd /foo/atlassian/confluence/7.x.x
```
Under ``confluence/WEB-INF/classes/com/atlassian``, create the following folder structure: ``http/mime``,
resulting in ``confluence/WEB-INF/classes/com/atlassian/http/mime``, e.g.
```bash
@silkentrance
silkentrance / .bashrc
Last active August 12, 2022 08:19
Git for Windows SSH Agent
SSH_AUTH_SOCK=~/.ssh/ssh-agent.sock
ssh_agent_pid=$(ps -aef | grep ssh-agent | tr -s ' ' | cut -f 3 -d ' ')
[ -e ${SSH_AUTH_SOCK} ] && [ -z ${ssh_agent_pid} ] && rm ${SSH_AUTH_SOCK}
ssh-add -l 2>/dev/null >/dev/null
[ $? -ne 0 ] && ssh-agent -a ${SSH_AUTH_SOCK} 2>/dev/null >/dev/null
export SSH_AUTH_SOCK
# add existing rsa keys
ssh-add ~/.ssh/*_rsa 2>/dev/null >/dev/null