Skip to content

Instantly share code, notes, and snippets.

Jaren Glover JarenGlover

Block or report user

Report or block JarenGlover

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 keybase.md

Keybase proof

I hereby claim:

  • I am jarenglover on github.
  • I am jaren (https://keybase.io/jaren) on keybase.
  • I have a public key ASBhhPt5kR0MDAU_9qexPH0lJQFMH44PkRjHb8V5RyyLjAo

To claim this, I am signing this object:

@JarenGlover
JarenGlover / gist:6118a897c6198a07cfd8
Last active Aug 29, 2015
iptables CoreOS with rules for etcd
View gist:6118a897c6198a07cfd8
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
View Dockerfile
#
# example Dockerfile for http://docs.docker.com/examples/postgresql_service/
#
FROM ubuntu
MAINTAINER SvenDowideit@docker.com
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
View vim74_lua
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get install python-dev
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@JarenGlover
JarenGlover / config for vim 7.4.582 with lua on ubuntu 14.04.sh
Last active Aug 29, 2015 — forked from seyDoggy/config for vim 7.4 with lua on ubuntu 13.04
I was having trouble getting lua support while rolling my own vim 7.4 on ubuntu 14.04.
View config for vim 7.4.582 with lua on ubuntu 14.04.sh
#!/usr/bin/env bash
#run with a user with sudoers privilege
#update before apt-get
sudo apt-get update
#install lua (please note 5.3 was released in 2015)
sudo apt-get install lua5.2 liblua5.2
@JarenGlover
JarenGlover / gist:a7441771f07469375f30
Last active Aug 29, 2015
JSON --> Iterable object (List) 2.0
View gist:a7441771f07469375f30
# improvement on how to build a dic from a string
# -> http://www.jarenglover.com/post/106593630960/creating-iterable-objects
# http://stackoverflow.com/questions/988228/converting-a-string-to-dictionary
# this only works if you know it will be valued JSON
>>> import ast
>>> line
'{"domain": {}, "buzz": "", "userid": 0.0, "hours": [20.0, 30.0, 40.0, 20.0, 30.0, 40.0, 35.0, 10.0, 0.0, 15.0, 25.0, 30.0, 10.0, 35.0, 30.0, 30.0, 30.0, 40.0, 25.0, 30.0, 35.0, 15.0, 65.0, 20.0], "buzzid": 0.0, "user": "", "time": 15736, "query": {}, "total": 660.0, "type": 0.0}\n'
>>> type(line)
<type 'str'>
@JarenGlover
JarenGlover / gist:d7ffab312ea756834218
Last active Dec 22, 2018
Nginx - Reverse Proxy | Backend & Front End Example
View gist:d7ffab312ea756834218
upstream fuel {
# Defines a group of servers. Servers can listen on different ports.
server IP:PORT fail_timeout=0;
}
upstream frontend {
server IP:PORT fail_timeout=0;
}
@JarenGlover
JarenGlover / gist:b8b34d80719a1b88b3cb
Last active Aug 29, 2015
Nginx - Serving Static Files at Root
View gist:b8b34d80719a1b88b3cb
server {
listen IP:PORT;
server_name .resume.jarenglover.com;
access_log /path/to/logs/resume-access.log default_uri; # <- "default_ui" is a parameter for customize Nginx logs
error_log /path/to/logs/resume-error.log;
index /Resume.pdf; #this sets the index location of what file will be servered
root /path/to/resume/; # root folder for this server block
location / {
@JarenGlover
JarenGlover / JSON-->Iterable object (List).py
Last active Aug 29, 2015
JSON --> Iterable object (List)
View JSON-->Iterable object (List).py
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> numbers = '[20.0, 30.0, 40.0, 20.0, 30.0, 40.0, 35.0, 10.0, 0.0, 15.0, 25.0, 30.0, 10.0, 35.0, 30.0, 30.0, 30.0, 40.0, 25.0, 30.0, 35.0, 15.0, 65.0, 20.0]'
>>> type(numbers)
<type 'str'>
>>> numbers.strip(r'[|]')
'20.0, 30.0, 40.0, 20.0, 30.0, 40.0, 35.0, 10.0, 0.0, 15.0, 25.0, 30.0, 10.0, 35.0, 30.0, 30.0, 30.0, 40.0, 25.0, 30.0, 35.0, 15.0, 65.0, 20.0'
>>> numbers_strip = numbers.strip(r'[]')
>>> map(float,numberes_strip.split(','))
View gist:7667765bd14a3a165681
CREATE TABLE json_test (id SERIAL, data JSON);
You can’t perform that action at this time.