Usage:
./docker-container-ip.sh container_name_here
{% import "SEOTags.html.twig" as SEOTags %} | |
{% block header_meta %} | |
{{ | |
SEOTags.draw({ | |
'title': 'Hello World', | |
'description': 'Hi, this is a test', | |
'keywords': ['first', 'second', 'third'], | |
'image': 'http://.../image.jpg' | |
}) |
#!/usr/bin/python | |
import os | |
import collections | |
def getPackageName(fileName): | |
exp = fileName.split('-') | |
found = False | |
name = "" | |
sep = "" |
#!/bin/bash | |
# Installs a recent version of docker-compose | |
# as on recent Ubuntu version it's pretty old | |
# but also this script could help to keep consistency | |
# between developer and production environment | |
# Based on: https://gist.github.com/wdullaer/f1af16bd7e970389bad3 | |
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9]+\.[0-9]+$" | tail -n 1` | |
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" | |
sudo chmod +x /usr/local/bin/docker-compose |
- name: Install misc admin packages | |
become: yes | |
apt: name={{ item }} state=present | |
with_items: | |
- htop | |
- iotop | |
- mytop | |
- iftop | |
- iptraf | |
- telnet |
<?php | |
namespace Manager; | |
use Doctrine\DBAL\Connection; | |
use Model\Entity\File; | |
use Symfony\Component\Serializer\Serializer; | |
/** | |
* @package Manager |
#!/bin/bash | |
# | |
# Get host IP and add it locally as docker_host_machine so it could be accessible eg. via http://docker_host_machine | |
# ================================ | |
# Requirements: iproute2 | |
# | |
cat /etc/hosts | grep -v "docker_host_machine" > /etc/hosts.2 && mv /etc/hosts.2 /etc/hosts | |
echo "$(ip route show|grep src|awk '{print $9}') docker_host_machine" >> /etc/hosts |
<?php | |
namespace Wolnosciowiec\Twig; | |
/** | |
* Shorten post preserving the HTML formatting | |
*/ | |
class PostShortenTwigExtension extends \Twig_Extension | |
{ | |
/** |
Usage:
./docker-container-ip.sh container_name_here
#!/bin/bash | |
function get_gateway_interface() { | |
route|grep default|awk '{print $8}' | |
} | |
# Redirect all incoming traffic to the other port | |
function redirect_port_to_port() { | |
# $1 from port | |
# $2 to port |
#!/bin/bash | |
if ! ping -c 1 google.com -W 10 > /dev/null 2>&1; then | |
interface=$(ifconfig -a |grep -E "(enp([a-z0-9]+)|eth([0-9]+))" | grep -v "veth" | awk '{print $1}' | sed -r "s/://g") | |
echo " >> Bringing up the ethernet interface $interface" | |
killall dhclient -9 > /dev/null 2>&1 | |
dhclient $interface | |
echo " >> Setting up DNS" |