Skip to content

Instantly share code, notes, and snippets.

FROM debian:wheezy
RUN apt-get update && apt-get -y upgrade && apt-get install -y apache2 libapache2-mod-php5 php5-mysql php5-gd php5-curl
ADD koken /var/www/koken
RUN chown www-data:www-data -R /var/www/koken
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
FROM debian:wheezy
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y apache2 libapache2-mod-php5 php5-mysql php5-gd php5-curl
RUN /usr/sbin/a2enmod rewrite
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
python_run() {
$@ 2>.pythonrunerr
if [ $? -ne 0 ]; then
sed -nri -e '/^\s*File/N' -e 's/^\s*?File "(.*?)", line (.*?),.*\n(.*)$/\1:\2:\3/p' .pythonrunerr
vim -q .pythonrunerr -c cope
else
cat .pythonrunerr >&2
fi
rm .pythonrunerr
}
#
# creating a hub:
#
hub = junction.Hub(
[ # first argument: listening "sites"
"tcp://127.0.0.1:9000", # TCP/IP host:port
"udp://127.0.0.1:9000", # UDP/IP host:port
"tcp:///var/run/stream.sock", # STREAM /path/to/socketfile
"udp:///var/run/dgram.sock", # DGRAM /path/to/socketfile
# vim: fileencoding=utf8:et:sw=4:ts=8:sts=4
from datahog import context, table, entity, prop, storage, pool
from django.conf import settings
from sentry.nodestore import base
BASE = 1
context.set_context(BASE, table.ENTITY)
@teepark
teepark / puffin.py
Created June 9, 2014 18:02
exploration of a faster scheduler core for greenhouse
# vim: fileencoding=utf8:et:sw=4:ts=8:sts=4
import errno
import fcntl
import os
import resource
import select
import socket
from penguin import fds
vagrant@vagrant-ubuntu-trusty-64:~$ grep -A2 pillar /etc/salt/minion
# The Salt pillar is searched for locally if file_client is set to local. If
# this is the case, and pillar data is defined, then the pillar_roots need to
# also be configured on the minion:
pillar_roots:
base:
- /srv/pillar
###### Security settings #####
vagrant@vagrant-ubuntu-trusty-64:~$ cat /srv/pillar/top.sls
base:
#!/usr/bin/env python
# vim: fileencoding=utf8:et:sw=4:ts=8:sts=4
import os
import signal
import gevent, gevent.socket as gsock
def handler(signum, frame):
augroup python_exec
autocmd!
autocmd FileType python nnoremap <buffer> <leader>r :<c-u>execute "w\|!python %"<cr>
autocmd FileType python nnoremap <buffer> <leader>p :<c-u>execute "w\|!flake8 %"<cr>
autocmd FileType python nnoremap <buffer> <leader>o :<c-u>execute "w\|!flake8 %>/tmp/errfile\|cf /tmp/errfile"
augroup END
def read_all(fd):
t = []
while 1:
x = os.read(fd, 4096)
if not x:
return ''.join(t)
t.append(x)