This file contains hidden or 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 elex/supervisor | |
RUN yum -y -q install mysql-server.x86_64 pwgen.x86_64 | |
RUN yum -q clean all | |
ADD my.cnf /etc | |
ADD startup_mysql.sh /usr/bin | |
EXPOSE 3306 | |
RUN echo -e [program:mysql]\\ncommand=/usr/bin/pidproxy /var/run/mysqld/mysqld.pid /usr/bin/mysqld_safe\\nautostart=true\\nautorestart=true\\nstartsecs=30\\nstartretries=3 >> /etc/supervisord.conf | |
CMD /bin/bash /usr/bin/startup_mysql.sh |
This file contains hidden or 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 centos:latest | |
RUN yum update -y -q | |
RUN yum install gcc -y -q | |
RUN curl -s https://go.googlecode.com/files/go1.2.src.tar.gz | tar -v -C /usr/local -xz | |
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1 | |
ENV PATH /usr/local/go/bin:$PATH | |
ADD . /opt/etcd | |
RUN cd /opt/etcd && ./build | |
EXPOSE 4001 7001 | |
ENTRYPOINT ["/opt/etcd/bin/etcd"] |
This file contains hidden or 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/bash | |
set -e | |
## requires running as root because filesystem package won't install otherwise, | |
## giving a cryptic error about /proc, cpio, and utime. As a result, /tmp | |
## doesn't exist. | |
[ $( id -u ) -eq 0 ] || { echo "must be root"; exit 1; } | |
tmpdir=$( mktemp -d ) |
This file contains hidden or 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/bash | |
set -e | |
repo="$1" | |
distro="$2" | |
mirror="$3" | |
if [ ! "$repo" ] || [ ! "$distro" ]; then | |
self="$(basename $0)" | |
echo >&2 "usage: $self repo distro [mirror]" |
This file contains hidden or 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 centos:latest | |
RUN echo "NETWORKING=yes" > /etc/sysconfig/network | |
RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
RUN yum -y -q update | |
RUN yum -y -q install file ntp vim-enhanced pcre pcre-devel gcc gcc-c++ gcc-g77 flex bison autoconf automake ncurses-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel gettext-devel pam-devel e2fsprogs-devel krb5-devel libidn libidn-devel mysql-devel libtool vixie-cron crontabs libxml2 libxml2-devel bzip2 bzip2-devel curl curl-devel openssl openssl-devel zlib zlib-devel libevent-devel libmcrypt libmcrypt-devel libc-client-devel libxslt-devel libtermcap libtermcap-devel libtool git | |
WORKDIR /tmp | |
RUN wget http://curl.haxx.se/download/curl-7.35.0.tar.bz2 | |
RUN tar xf curl-7.35.0.tar.bz2 | |
RUN cd curl-7.35.0 && ./configure --prefix=/usr/local/curl --with-ssl --without-nss && make && make install && cd .. | |
RUN wget http://downloads.php.net/stas/php-5.4.17.tar.bz2 |
This file contains hidden or 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 elex/centos:latest | |
RUN yum install -q -y python-pip openssh-server openssh-clients passwd | |
RUN yum -q clean all | |
RUN bash -c 'echo "net.ipv4.tcp_fin_timeout = 30\nnet.ipv4.tcp_keepalive_time = 300\\nnet.ipv4.tcp_syncookies = 1\nnet.ipv4.tcp_synack_retries = 2\nnet.ipv4.tcp_syn_retries = 3\nnet.ipv4.tcp_tw_reuse = 1\nnet.ipv4.tcp_tw_recycle = 1\nnet.ipv4.tcp_max_syn_backlog = 4096\nnet.ipv4.ip_conntrack_max = 6553600\nnet.ipv4.netfilter.ip_conntrack_max = 6553600\n" >> /etc/sysctl.conf' | |
# install supervisord | |
RUN /usr/bin/python /usr/bin/pip install supervisor | |
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_dsa_key && ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key | |
RUN sed -ri 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config && echo 'root:changeme' | chpasswd | |
ADD supervisord.conf /etc/ | |
EXPOSE 22 |
This file contains hidden or 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
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
package main | |
import ( | |
"code.google.com/p/go.crypto/ssh" | |
"crypto" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" |
This file contains hidden or 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 models.dbase import db_session | |
from models.host import Host | |
from datetime import datetime | |
h = db_session.query(Host).filter(Host.public_ip=="58.68.229.43").filter(Host.deleted==False).one() | |
hs = db_session.query(Host).filter(Host.create_at > h.create_at).all() | |
for hh in hs: | |
print "|".join([hh.hostname, hh.public_ip, hh.private_ip, str(hh.idc_id), str(hh.cost), str(hh.price), str(hh.currency_id), hh.create_at.isoformat(), hh.h_info, hh.extra]) | |
This file contains hidden or 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 models.dbase import db_session | |
from models.host import Host | |
from models.game import Game | |
from models.gametype import GameType | |
from models.app import App | |
from models.idc import IDC | |
from models.currency import Currency | |
from models.apphostmap import AppHostMap | |
from pymongo import MongoClient |
This file contains hidden or 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 | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |