Skip to content

Instantly share code, notes, and snippets.

James Bradach jbradach

Block or report user

Report or block jbradach

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
View gist:24b1e1832908296dc14f36e99cb035f7
### Keybase proof
I hereby claim:
* I am jbradach on github.
* I am bradach (https://keybase.io/bradach) on keybase.
* I have a public key whose fingerprint is 5476 E59A F97E 56EE 461C B57F 0670 FA2B A3EC FD49
To claim this, I am signing this object:
View keybase.md

Keybase proof

I hereby claim:

  • I am jbradach on github.
  • I am bradach (https://keybase.io/bradach) on keybase.
  • I have a public key whose fingerprint is 5476 E59A F97E 56EE 461C B57F 0670 FA2B A3EC FD49

To claim this, I am signing this object:

@jbradach
jbradach / Nginx Config for WordPress Over SSL
Last active Aug 29, 2015
Nginx server block config for WordPress over SSL
View Nginx Config for WordPress Over SSL
# https://gist.github.com/jbradach/e0da911b02cd2c3fbd8b
server {
listen [::]:80;
listen 80;
server_name rudeotter.foo www.rudeotter.foo;
return 301 https://rudeotter.foo$request_uri;
}
@jbradach
jbradach / Nginx Config for Redmine using Puma
Last active Aug 29, 2015
Nginx config for Redmine using Puma
View Nginx Config for Redmine using Puma
# https://gist.github.com/jbradach/31ad6d9c84c3be3b5730
upstream puma_redmine {
server unix:/home/redmine/redmine/tmp/sockets/redmine.sock fail_timeout=0;
#server 127.0.0.1:3000;
}
server {
server_name YOUR.SERVER.NAME;
listen 80;
@jbradach
jbradach / Puma Config for Redmine
Last active Aug 29, 2015
Puma configuration file for Redmine
View Puma Config for Redmine
#!/usr/bin/env puma
# https://gist.github.com/jbradach/6ee5842e5e2543d59adb
# start puma with:
# RAILS_ENV=production bundle exec puma -C ./config/puma.rb
application_path = '/home/redmine/redmine'
directory application_path
environment 'production'
@jbradach
jbradach / Init Script for Redmine using Puma
Last active Aug 29, 2015
Init script for Redmine and Puma
View Init Script for Redmine using Puma
#! /bin/sh
### BEGIN INIT INFO
# Provides: redmine
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redmine with puma
# Description: Starts redmine from /home/redmine/redmine.
### END INIT INFO
@jbradach
jbradach / Nginx Configuration for UWSGI Upstream
Created Aug 6, 2014
Nginx IPv6 server block and upstream for uWSGI apps.
View Nginx Configuration for UWSGI Upstream
upstream uwsgi_host {
server unix:/tmp/flaskapp.sock;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
location ^~ /static/ {
alias /srv/www/flaskapp/app/static;
@jbradach
jbradach / Nginx Configuration for Flask
Created Aug 3, 2014
Nginx server block for deploying a Flask app using uWSGI.
View Nginx Configuration for Flask
server {
listen 80;
server_name $hostname;
root /srv/www/$hostname/myapp;
location = /favicon.ico {
alias /srv/www/$hostname/public_html/favicon.ico;
access_log off;
log_not_found off;
}
@jbradach
jbradach / phpMyAdmin Nginx Config
Created Aug 3, 2014
Nginx location block for phpMyAdmin using an alias.
View phpMyAdmin Nginx Config
location /yourlocation {
alias /usr/share/phpmyadmin;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-ssl.sock;
fastcgi_index index.php;
}
}
@jbradach
jbradach / Flask uWSGI Stats
Created Aug 3, 2014
Connect to uWSGI Stats Server using Unix domain sockets in Flask.
View Flask uWSGI Stats
@app.route('/uwsgistat/')
@app.route('/uwsgistat/<appchoice>')
def uwsgistat(appchoice = None):
if appchoice == None:
return redirect(url_for('index'))
statsocket = '/tmp/' + appchoice + '-stat.sock'
if os.path.exists(statsocket):
client = socket.socket( socket.AF_UNIX, socket.SOCK_STREAM )
client.connect(statsocket)
data = client.recv(2048)
You can’t perform that action at this time.