Skip to content

Instantly share code, notes, and snippets.

Eugen Mayer EugenMayer

Block or report user

Report or block EugenMayer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SDKman to JENV
#!/bin/bash
echo "removing current jenv java's to readd them freshly"
jenv versions --bare | xargs -n1 jenv remove
echo "adding all sdkmans java versions to jenv"
find $HOME/.sdkman/candidates/java -type d -maxdepth 1 -mindepth 1 -exec jenv add '{}' \;
@EugenMayer
EugenMayer / 00-docker-shorewall.md
Created Feb 24, 2019 — forked from lukasnellen/00-docker-shorewall.md
setup shorewall for docker networking beyond the default bridge network, e.g., for docker-compose
View 00-docker-shorewall.md

Docker(-compose) with shorewall

The shorewall documentation explains in http://shorewall.org/Docker.html how to configure shorewall for use with docker. The problem with the configuration is that it only allows connections from the host to the main bridge docker0. Connections to other networks on dynamically created bridges, with names starting by default with br-, is blocked. Instead of the recommended contents of /etc/shorewall/interfaces, use wild-card interface names as follows:

#ZONE	INTERFACE	OPTIONS
#dock	docker0		bridge     # disabled default recommendation
dock 	docker0		physical=docker+,routeback=1
dock 	br		physical=br-+,routeback=1
View startup.sh
#!/bin/bash
curl -X GET -O -v 'https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/labs/plugins/quickreload/1.24.1/quickreload-1.24.1.jar'
echo 'Installing Quick Reload from local JAR.'
url="http://admin:admin@localhost/rest/plugins/1.0/";
token=$(curl -sI -H "Accept: application/vnd.atl.plugins.installed+json" "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]');
curl -X POST -v -F plugin=@./quickreload-1.24.1.jar "$url?token=$token"
sleep 5
View gist:117f3076b73bc40577da634356d815df
curl -X GET -O -v 'https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/labs/plugins/quickreload/1.24.1/quickreload-1.24.1.jar'
echo 'Installing Quick Reload from local JAR.'
url="http://admin:admin@localhost/rest/plugins/1.0/";
token=$(curl -sI -H "Accept: application/vnd.atl.plugins.installed+json" "$url?os_authType=basic" | grep upm-token | cut -d: -f2- | tr -d '[[:space:]]');
curl -X POST -v -F plugin=@./quickreload-1.24.1.jar "$url?token=$token"
sleep 5
# install our plugin
View drupal.vhost
upstream fpm {
server drupal:9000;
}
map $http_cookie $consent_check {
default "";
"~*CONSENT=(?<token>.+)" "token";
}
server {
View gist:a96d42b156a5cebd62e5b646751ecc61
boot: dcn
bootdisk: scsi0
cores: 2
ide2: none,media=cdrom
memory: 2000
name: gateway
net0: virtio=BE:85:CC:71:18:D0,bridge=vmbr30
net1: virtio=00:50:56:00:C3:76,bridge=vmbr0
numa: 0
onboot: 1
@EugenMayer
EugenMayer / thor.monkeypath.rb
Created Feb 22, 2018
Pathes Ruby thor to support the NO_COLOR env variable to stop using colors e.g. when you want to parse logs
View thor.monkeypath.rb
class Thor
module Shell
class Color
def can_display_colors?
return false unless ENV['NO_COLOR'].nil?
stdout.tty?
end
end
end
end
@EugenMayer
EugenMayer / cleanup.sh
Last active Feb 22, 2018
cleanup all vms in virtualbox
View cleanup.sh
vagrant global-status --prune; for id in $(vboxmanage list vms | awk '{print $2}' | tr -d { | tr -d '}'); do VBoxManage controlvm $id poweroff ;vboxmanage unregistervm --delete $id ; done
View com.my.docker.loopback.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>de.kontextwork.docker.loopback</string>
<key>ProgramArguments</key>
<array>
<string>ifconfig</string>
<string>lo0</string>
View kontextwork_d4m_fix.sh
#!/bin/bash
set -e
cd ~/Library/Containers/com.docker.docker/Data/database
git reset --hard
echo -n "Current full-sync-on-flush setting: "
P=~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/disk/full-sync-on-flush
if [ -f $P ]; then
echo "file exists"
You can’t perform that action at this time.