Skip to content

Instantly share code, notes, and snippets.

earthgecko

Block or report user

Report or block earthgecko

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
@probonopd
probonopd / traceback.py
Last active Feb 10, 2018
Show flask traceback when running on production server
View traceback.py
import traceback
@app.errorhandler(500)
def internal_error(exception):
"""Show traceback in the browser when running a flask app on a production server.
By default, flask does not show any useful information when running on a production server.
By adding this view, we output the Python traceback to the error 500 page.
"""
trace = traceback.format_exc()
View grep.rb
% ruby grep.rb logstash-1.1.[0123]-monolithic |sort | uniq -c
1 /files/logstash//logstash-1.1.1-monolithic.jar
1 /files/logstash//logstash-1.1.2-monolithic.jar
399 /files/logstash/logstash-1.1.0-monolithic.jar
4 /files/logstash/logstash-1.1.1-monolithic-jruby1.7.0RC1.jar
308 /files/logstash/logstash-1.1.1-monolithic.jar
537 /files/logstash/logstash-1.1.2-monolithic.jar
77 /files/logstash/logstash-1.1.3-monolithic.jar
@apk
apk / websock.sh
Created Apr 18, 2012
A web socket server as a bash script.
View websock.sh
#!/bin/bash
# WebSocket shell, start & browse to http://<Host>:6655/
# Requires bash 4.x, openssl.
# Author: rootshell@corelogics.de (which isn't me, apk)
coproc d { nc -l -p 6656 -q 0; }
nc -l -p 6655 -q 1 > /dev/null <<-ENDOFPAGE
HTTP/1.1 200 OK
<html><head><script language="javascript">
var url = location.hostname + ':' + (parseInt(location.port) + 1);
@gerhard
gerhard / gist:1707291
Created Jan 30, 2012
This is how New Relic follows up on their trials
View gist:1707291
This was sent by a New Relic account executive to one of my co-workers as a
follow-up to the trial. Generally speaking, it's a good idea to not patronise
your potential customers. There's no room for more than a single dot in a
business e-mail. Use a spell-checker for your e-mails if you can't spell. Write
in clear English. What do you think?
Hello <name>,
You can’t perform that action at this time.