Skip to content

Instantly share code, notes, and snippets.

@udkyo
udkyo / gist:a5da4ca6496efc3e238d36fd813bc305
Created May 22, 2018 10:09
Terraform - get local external IP
data "external" "public_ip" {
program = [ "sh", "-c", "echo {\\\"ip\\\": \\\"$(curl ifconfig.io)\\\"}" ]
//populates ${data.external.public_ip.result.ip}
}
@udkyo
udkyo / Dockerfile
Last active May 1, 2024 12:51
Basic container for X11 forwarding goodness
FROM ubuntu
RUN apt update \
&& apt install -y firefox \
openssh-server \
xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
@udkyo
udkyo / gist:67bb60565227ef5cda1b10162401a96d
Created April 4, 2018 18:29
docker-compose network thing.
version: "3.4"
services:
spawner:
image: docker
volumes:
- /var/run/docker.sock:/var/run/docker.sock
entrypoint: |
sh -c "docker run --rm --name childcontainer --network ${stack}_default -d alpine sleep 10 && ping childcontainer"
@udkyo
udkyo / README.md
Created March 27, 2018 08:23 — forked from obscurerichard/README.md
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.