Skip to content

Instantly share code, notes, and snippets.

View silkentrance's full-sized avatar

Carsten Klein silkentrance

View GitHub Profile
@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
@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 / 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 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 / 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 / README.md
Last active February 6, 2020 00:54
A jest test environment for use with node tmp - temporary work around for https://github.com/raszi/node-tmp/issues/229

A real version of this will be released soon that can then be installed using npm/yarn.

@silkentrance
silkentrance / Jenkinsfile
Created March 25, 2019 13:53
Maven custom build versions that include jira issue id from branch name
pipeline {
agent any
environment {
V_DEPLOY_VERSION = buildDeployVersion(readMavenPom().getVersion())
}
stages {
stage('Version') {
steps {
@silkentrance
silkentrance / README.md
Last active August 7, 2019 22:19
Vuetify with TypeScript

Vuetify with TypeScript

The following changes to the standard setup of the vuetify template will allow you to use typescript instead of babel or just plain javascript.

WORK IN PROGRESS

Additional changes have to be made to vuetify in order to get this running, namely the vuetify typescript declarations. I am currently working on that. Patience is a virtue.

@silkentrance
silkentrance / MyComponent.ts
Last active March 10, 2021 13:09
vue-router typescript integration fails
import Vue from 'vue';
import Component from 'vue-class-component';
@Component({
name : 'component'
})
export default class MyComponent extends Vue {
beforeCreate() {
@silkentrance
silkentrance / SyncStream.py
Last active April 9, 2017 22:40
GRPC Python Request and Response Streaming
import threading
from time import sleep
DEFAULT_SLEEP_TIME = 0.00001
class SyncStream:
def __init__(self, sleep_time = DEFAULT_SLEEP_TIME):