This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx mainline from the nginx.org apt repository as of this gist 1.5.3 | |
# | |
# | |
# Version 0.1 | |
# | |
# Build instructions: | |
# sudo docker build -t="nginx" . | |
# | |
# Usage: | |
# sudo docker -d nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
MAINTAINER Nicholas Johns | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" > /etc/apt/sources.list.d/universe.list | |
RUN apt-get update; apt-get install -y -q wget curl python-software-properties libonig2 libqdbm14 | |
RUN add-apt-repository ppa:ondrej/php5 | |
RUN wget -qO - http://nginx.org/keys/nginx_signing.key | apt-key add - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<hashdash> i've found socat to be an obscurish/unix-unfriendly but useful tool for quick debugs of what something like docker is doing on the wire | |
<hashdash> for unix sockets, even: | |
<hashdash> socat -v UNIX-LISTEN:listener,fork UNIX:/var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function _formatTreeIntoArray(&$tree, $current_depth = 0) | |
{ | |
$formattedTree = array(); | |
while($leaf = current($tree)) | |
{ | |
if($leaf->DEPTH > $current_depth) | |
{ | |
$formattedTree[] = $this->_formatTreeIntoArray($tree, $leaf->DEPTH); | |
} | |
elseif($leaf->DEPTH < $current_depth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$current_depth = 1; | |
$html = ''; | |
foreach($menu as $key => $value) | |
{ | |
if(isset($menu[$key+1]) && $menu[$key+1]->DEPTH > $current_depth) | |
{ | |
if($current_depth > 1) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
split -l 5000 dbdump.sql | |
find ./x* -type f -print0 | while IFS= read -r -d '' filename;\ | |
do sed -i '1s/^/\n\nSET FOREIGN_KEY_CHECKS=0;\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET AUTOCOMMIT = 0;\nSET time_zone = \"+00:00\";\nSTART TRANSACTION;\n\n /' $filename;\ | |
done | |
find ./x* -type f -print0 | while IFS= read -r -d '' filename;\ | |
do sed -i '$s/$/\n\nCOMMIT;\nSET FOREIGN_KEY_CHECKS=1;\n\n /' $filename;\ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The purpose of this Dockerfile is to serve as the base for a static website, in this case redstalker.com | |
# There are better ways to do this | |
# For example, using a volume and only running the redstalker.com Dockerfile in the case of update. | |
FROM johnsn/rs-nginx | |
MAINTAINER Nicholas Johns "nicholas.a.johns5@gmail.com" | |
# Force updating ubuntu | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update; apt-get upgrade -y; apt-get install -y wget python-software-properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Dockerfile relies on johnsn/rs-nginx and johnsn/rs-piecrust | |
# It is better to use a volume and then use a Docker container as a binary to generate the | |
# static site vs inheriting multiple services | |
FROM johnsn/rs-piecrust | |
MAINTAINER Nicholas Johns "nicholas.a.johns5@gmail.com" | |
# Force updating ubuntu | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update; apt-get upgrade -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
MAINTAINER Nicholas Johns "nicholas.a.johns5@gmail.com" | |
#Force updating ubuntu | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update; apt-get upgrade -y; apt-get install -y wget | |
#Add nginx certificate and sources | |
RUN wget -qO - http://nginx.org/keys/nginx_signing.key | apt-key add - | |
RUN echo "deb http://nginx.org/packages/mainline/ubuntu/ precise nginx" > /etc/apt/sources.list.d/nginx.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu | |
MAINTAINER Nicholas Johns "nicholas.a.johns5@gmail.com" | |
# Force update | |
# install wget, curl, and python-software-properties for adding PPA's | |
# curl and python-software-properties are not necessary but I like them. | |
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
RUN apt-get update; apt-get upgrade -y; apt-get install -y wget curl python-software-properties | |
# Let's install php 5.5 |
OlderNewer