Skip to content

Instantly share code, notes, and snippets.

View pejorativefox's full-sized avatar

Chris pejorativefox

View GitHub Profile
@pejorativefox
pejorativefox / Dockerfile
Created April 8, 2018 04:49 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@pejorativefox
pejorativefox / gist:a470716d4d86f1a5920799c5b318cf72
Created August 24, 2017 15:05
Backtrace of crash when opening the 'eat' menu
#0 0x0000000101ed9657 in food_hint_provider[abi:cxx11](item const&) (it=...) at /home/daspork/repos/Cataclysm-DDA/src/item.cpp:6033
#1 0x0000000101d63928 in std::_Function_handler<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (item const&), std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (*)(item const&)>::_M_invoke(std::_Any_data const&, item const&) (__functor=..., __args#0=...) at /usr/include/c++/6/functional:1717
#2 0x0000000101e78b36 in std::function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (item const&)>::operator()(item const&) const (
this=0x7fffffffb6b8, __args#0=...) at /usr/include/c++/6/functional:2127
#3 0x0000000101e6226e in inventory_selector::draw_header (this=0x7fffffffb490, w=0x103877f10) at /home/daspork/repos/Cataclysm-DDA/src/inventory_ui.cpp:1142
#4 0x0000000101e6315f in inventory_selector::refresh_window (this=0x7fffffffb490) at /home/daspork/repos/Cataclysm-DDA/src/invento
@pejorativefox
pejorativefox / specs
Created January 22, 2017 07:33
gcc specs
*asm:
%{m16|m32:--32} %{m16|m32|mx32:;:--64} %{mx32:--x32} %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}
*asm_debug:
%{!g0:%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}} %{fdebug-prefix-map=*:--debug-prefix-map %*}
*asm_final:
%{gsplit-dwarf:
objcopy --extract-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} %{c:%{o*:%:replace-extension(%{o*:%*} .dwo)}%{!o*:%b.dwo}}%{!c:%b.dwo}
objcopy --strip-dwo %{c:%{o*:%*}%{!o*:%b%O}}%{!c:%U%O} }
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU C Library configure (see version.h), which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ../../src/glibc-2.24/configure --prefix=/usr --enable-kernel=2.6.32 --enable-obsolete-rpc libc_cv_slibdir=/lib
## --------- ##
## Platform. ##
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU MP configure 6.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ../../src/gmp-6.1.2/configure --prefix=/usr --enable-cxx --disable-static --docdir=/usr/share/doc/gmp-6.1.2
## --------- ##
## Platform. ##
@pejorativefox
pejorativefox / config.log
Created January 20, 2017 07:56
Binutils config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ../../src/binutils-2.27/configure --prefix=/usr --enable-plugins --enable-shared --disable-werror --with-system-zlib
## --------- ##
## Platform. ##
def log_messages(msg):
"""Seriously??? Ha-ha-ha!"""
sys.stderr.write(msg)
"""
Models and managers for the action system
"""
## Setup logger
import logging
log = logging.getLogger('action.models')
## Django imports
from django.db import models
displayNode = $("#display");
canvasNode = $("<canvas id='canvas1'></canvas>");
canvasNode.attr("width", width);
canvasNode.attr("height", height);
displayNode.append(canvasNode);
context = canvasNode('canvas1').getContext("2d");
What about load balancing between multiple uwsgi instances ?
backend uwsgi0 {
.host = "127.0.0.1";
.port = "3031";
}
backend uwsgi1 {
.host = "192.168.0.17";
.port = "3031";