Skip to content

Instantly share code, notes, and snippets.

View criloz's full-sized avatar
🤡

Cristian Lozano criloz

🤡
  • Bogota, Colombia
View GitHub Profile
@criloz
criloz / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Hi Jeni

add user

Yeah you can here (http://admin.designlens.com/admin/auth/user/), I just created an user called criloz. you can add how many user you want, after you create and user you can edit some of their permission, for example

  • only user with the staff member flags can login into the site.
.PHONY : all build
CURRENT_DIRECTORY := $(shell pwd)
GOPATH := $(CURRENT_DIRECTORY):$(CURRENT_DIRECTORY)/src/vendors
BUILD_DIR:=$(CURRENT_DIRECTORY)/bin
TASKS_DIR:=$(CURRENT_DIRECTORY)/tasks
SERVERS_FILE:=$(TASKS_DIR)/servers.yml
export GOPATH
__author__ = 'cristian'
from base import *
def pull_elasticsearch_image(pmk, ip):
"""
@type param pmk: SSHClient
:return:
__author__ = 'cristian'
from base import *
def get_hostmame(server_name, server):
"""
get hostname of hosts
@type param server_name: str
@type param server: dict
.PHONY : all build
CURRENT_DIRECTORY := $(shell pwd)
GOPATH := $(CURRENT_DIRECTORY):$(CURRENT_DIRECTORY)/src/vendors
BUILD_DIR:=$(CURRENT_DIRECTORY)/bin
TASKS_DIR:=$(CURRENT_DIRECTORY)/tasks
SERVERS_FILE:=$(TASKS_DIR)/servers.yml
export GOPATH
@criloz
criloz / gist:516899ce537003bf171f
Last active August 29, 2015 14:16
master-coreos
#cloud-config
hostname: pulsar-master
coreos:
etcd:
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: etcd.service
@criloz
criloz / gist:9b7d598cc4134f3ee7ff
Created March 10, 2015 09:23
is_parent_running with os.getppid()
from multiprocessing import Process
import time
import os
def is_parent_running():
try:
os.kill(os.getppid(), 0)
return True
except OSError:
@criloz
criloz / gist:8f3e3e5aef510250a7cc
Created March 10, 2015 09:31
is_parent_running with parent_pid
from multiprocessing import Process
import time
import os
def is_parent_running(pid):
try:
os.kill(pid, 0)
return True
except OSError:
class Response(dict):
"""An object more like email.Message than httplib.HTTPResponse."""
"""Is this response from our local cache"""
fromcache = False
"""HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1. """
version = 11
"Status code returned by server. "