Skip to content

Instantly share code, notes, and snippets.

💾

Tristan Fisher tristanfisher

💾
Block or report user

Report or block tristanfisher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tristanfisher
tristanfisher / main.go
Created Aug 10, 2018 — forked from husobee/main.go
simple golang http middleware chaining example
View main.go
package main
import (
"fmt"
"net/http"
"time"
"golang.org/x/net/context"
"github.com/husobee/backdrop"
@tristanfisher
tristanfisher / python_main_event_loop.py
Created May 16, 2017
(Python asyncio default event loop) There is no .open(), there is only new_event_loop().
View python_main_event_loop.py
import asyncio
loop = asyncio.new_event_loop()
async def x(): return 'x'
async def y(): return 'y'
try:
loop.run_until_complete(asyncio.gather(x(), y()))
except ValueError:
@tristanfisher
tristanfisher / relevant_uwsgi_vassal_log.txt
Last active Jun 1, 2016
Is this the level of detail that I should expect from stacktraces behind uwsgi? i'm hoping to get the python traceback in a logfile when i get 502 bad gateways via nginx, not the backtrace of uwsgi crashing.
View relevant_uwsgi_vassal_log.txt
!!! uWSGI process 2581 got Segmentation Fault !!!
*** backtrace of 2581 ***
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_backtrace+0x2e) [0x48145e]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_segfault+0x21) [0x481821]
/lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7fc8116c6d40]
/srv/dependencies/uwsgi_python3/bin/uwsgi(PyUnicode_AsUTF8String+0x1) [0x558ac1]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_python_backtrace+0x156) [0x4980b6]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_exceptions_catch+0x322) [0x461732]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_manage_exception+0x1fe) [0x461a9e]
/srv/dependencies/uwsgi_python3/bin/uwsgi(python_call+0x2e) [0x49867e]
@tristanfisher
tristanfisher / relevant_uwsgi_vassal_log.txt
Created Jun 1, 2016
Is this the level of detail that I should expect from stacktraces behind uwsgi?
View relevant_uwsgi_vassal_log.txt
!!! uWSGI process 2581 got Segmentation Fault !!!
*** backtrace of 2581 ***
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_backtrace+0x2e) [0x48145e]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_segfault+0x21) [0x481821]
/lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7fc8116c6d40]
/srv/dependencies/uwsgi_python3/bin/uwsgi(PyUnicode_AsUTF8String+0x1) [0x558ac1]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_python_backtrace+0x156) [0x4980b6]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_exceptions_catch+0x322) [0x461732]
/srv/dependencies/uwsgi_python3/bin/uwsgi(uwsgi_manage_exception+0x1fe) [0x461a9e]
/srv/dependencies/uwsgi_python3/bin/uwsgi(python_call+0x2e) [0x49867e]
@tristanfisher
tristanfisher / com.displaylink
Created Feb 17, 2016
DisplayLink driver leading to crashes and console/syslog spamming.
View com.displaylink
@tristanfisher
tristanfisher / json_subtree.js
Created Jan 22, 2016
I'd like some help understanding why I can't return from the inner if check -- I wouldn't expect it to return to the level of `if (search_subtree_keyname in tree)`.
View json_subtree.js
var issue_project_tracker = "https://github.com/tristanfisher/yams/issues";
test_api_response = {
"response":
{
"headers": {"date": "Sun, 17 Jan 2016 06:13:38 GMT", "etag": "\"5621a198-fcd\"", "status_code": 200},
"text_response": "Dropbox is running normally.",
"status": "ok"
}
};
View tristan's number 3 ribs - oven variant
For each 3 pounds of ribs:
Ingredients:
Initial marinade:
Salt
2 tablespoon Black pepper
2-3 shots Bushmills whisky (or Eagle Rare or other non-peaty bourbon. Do not use anything Charcoal-aged/filtered. Lagavulin or Laphroaig will also work if serving to parties that are okay with woody/complex whisky) -- Note that this with recipe's cooking time, ~95%+ of the alcohol will evaporate.
1/8 cup fresh chopped garlic
View 1_minimal_example_of_enqueue.py
# file path: (basedir)/api/api_utils/__init__.py
from redis import Redis
from rq import Queue
api_version = 1
task_params = {'cat': 1, 'dog': 0}
REDIS_WORKER_QUEUE_NAME = 'worker'
REDIS_WORKER_HOST='127.0.0.1'
REDIS_WORKER_PORT = 6379
View initialize_db.sh
▶ postgres --config-file=api/conf_files/psql/postgresql.conf -c hba_file=api/conf_files/psql/hba.conf -c ident_file=api/conf_files/psql/pg_ident.conf
LOG: skipping missing configuration file "/srv/postgres/postgresql.auto.conf"
FATAL: "/srv/postgres" is not a valid data directory
DETAIL: File "/srv/postgres/PG_VERSION" is missing.
# The line I really want to preserve in postgresql.conf is:
data_directory = '/srv/postgres' # use data in another directory
# I assume that I need to "initdb" or "pg_ctl init", but I can't find the right flags to honor the postgresql.conf
# (also, I suspect that pg_ctl init is just calling initdb)
@tristanfisher
tristanfisher / ec2_eni.py
Last active Oct 28, 2015
created before eni was a module in ansible 2. WIP and probably not going to be finished
View ec2_eni.py
#!/usr/bin/python
DOCUMENTATION = """
---
module: ec2_eni
short_description: Manage ENI resources in EC2
description:
- Creates, removes, or associates/dissociates ENIs
- name: EC2_ENI documentation
You can’t perform that action at this time.