Skip to content

Instantly share code, notes, and snippets.

View lukaszlach's full-sized avatar
🐳
Captain on the bridge!

Łukasz Lach lukaszlach

🐳
Captain on the bridge!
View GitHub Profile
@lukaszlach
lukaszlach / gist:180cc44cfd476d75387c3cd47a20918e
Created February 24, 2021 19:17
Communication between containers - disk, shared memory, unix sockets
— term (network)
1$ docker run -it alpine:3
2$ docker run -it centos
1$ ip a
2$ ip a
2$ ping 172.17.0.3
1$ apk -U add nginx
1$ nginx -g 'daemon off;'
1$ mkdir -p /run/nginx
1$ nginx -g 'daemon off;'
#!/usr/bin/env bash
RESOLUTION=800x600x24
DISPLAY=:1
Xvfb $DISPLAY -screen 0 $RESOLUTION &
sleep 2
x11vnc -display $DISPLAY -bg -nopw -listen 0.0.0.0 -xkb
sleep 2
cd /eduke3d
exec wine eduke32.exe
FROM debian:stretch
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get install -y curl apt-transport-https x11vnc xvfb gnupg && \
dpkg --add-architecture i386 && \
curl https://dl.winehq.org/wine-builds/Release.key | apt-key add - && \
echo "deb https://dl.winehq.org/wine-builds/debian/ stretch main" > /etc/apt/sources.list.d/wine.list && \
apt-get update && \
apt-get install -y --allow-unauthenticated --install-recommends winehq-devel && \
curl -o /usr/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks && \
#!/bin/bash
cat <<'banner'
____ ____ ____ ____
/ _ \/ __\/ _\/ _ \
| / \|| \/|| / | / \|
| \_/|| /| \_ | |-||
\____/\_/\_\\____/\_/ \|
Docker workshop
Łukasz Lach <llach@llach.pl>
https://lach.dev/orca
curl -sSfL https://gist.githubusercontent.com/lukaszlach/c0fdb7a728cdea632db1aebbbff3f6d6/raw/gcp-uw.sh | bash
cd /
wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/download/v2.0.0-alpha.3/gotty_2.0.0-alpha.3_linux_amd64.tar.gz
tar zxvf gotty.tar.gz
cd /home/d
/gotty -w -c 'docker:' --reconnect /usr/bin/sudo -u d bash -l &
VPS_ID=123
docker run -d --name orca-tunnel --restart always \
-p 4040:4040 \
-p 5000:5000 \
-p 8000:8000 -p 8080:8080 -p 8081:8081 -p 8443:8443 \
-p 9000:9000 \
-p 10080:10080 \
-e SSH_USER=d -e SSH_PASSWORD=docker -e SSH_PORT=80 \
lukaszlach/orca-tunnel "vps$VPS_ID.cmd.cat" 4040 5000 8000 8080 8081 8443 9000 10080
#!/usr/bin/env bash
# curl -sSfL https://gist.githubusercontent.com/lukaszlach/c0fdb7a728cdea632db1aebbbff3f6d6/raw/gcp-uw.sh | bash
# SSHd
sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/.*Port.*/Port 6667/g" /etc/ssh/sshd_config
echo 'Port 80' >> /etc/ssh/sshd_config
sed -i "s/.*ClientAliveInterval.*/ClientAliveInterval 45/g" /etc/ssh/sshd_config
sed -i "s/.*ClientAliveCountMax.*/ClientAliveCountMax 3/g" /etc/ssh/sshd_config
#echo 'ServerAliveInterval 15' >> /etc/ssh/sshd_config