This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6:13 pm est update | |
core@core-01 ~ $ curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello world" | |
{"errorCode":300,"message":"Raft Internal Error","index":1} | |
core@core-01 ~ $ /bin/etcd | |
[etcd] Sep 28 22:12:41.106 WARNING | Using the directory core-01.etcd as the etcd curation directory because a directory was not specified. | |
[etcd] Sep 28 22:12:41.107 INFO | The path core-01.etcd/log is in btrfs | |
[etcd] Sep 28 22:12:41.108 INFO | Set NOCOW to path core-01.etcd/log succeeded | |
[etcd] Sep 28 22:12:41.109 INFO | core-01 is starting a new cluster | |
[etcd] Sep 28 22:12:41.111 INFO | etcd server [name core-01, listen on :4001, advertised url http://127.0.0.1:4001] | |
[etcd] Sep 28 22:12:41.111 CRITICAL | Failed to create listener: listen tcp :4001: bind: address already in use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE json_test (id SERIAL, data JSON); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(',')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 / { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# example Dockerfile for http://docs.docker.com/examples/postgresql_service/ | |
# | |
FROM ubuntu | |
MAINTAINER [email protected] | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*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 |
OlderNewer