Giter Site home page Giter Site logo

sichaoguo21 / hackersome Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bcambel/oss.io

0.0 1.0 0.0 1.42 MB

Developers gathering up

Home Page: http://hackersome.com

License: Eclipse Public License 1.0

Nginx 0.23% Clojure 87.92% Shell 0.14% HTML 0.37% CSS 10.28% Python 0.55% Java 0.51%

hackersome's Introduction

Hackersome

Gitter

Build Status

Coverage Status

A Community project for developers, entreprenuers, hustlers. Hackersome is the umbrella project name, and includes the following portals

Development

Create a profiles.clj file in the root folder of the project with the following settings

{:dev  {:env {
			;;twitter settings
			:app-consumer-key ""
			:app-consumer-secret ""
			:user-access-token ""
			:user-access-token-secret ""
			;;github settings
			:client-id "" 
			:client-secret ""
}}}

Start a REPL (in a terminal: lein repl, or from Emacs: open a clj/cljs file in the project, then do M-x cider-jack-in. Make sure CIDER is up to date).

In the REPL do

(def sys (startup {}))

Which will return the system map. It's based on Stuart Sierra's amazing Component lib.

In order to access db session component do a

(:connection (:db sys))

The call to (startup {}) does two things, it starts the webserver at port 10554, . Give them some time to start.

Docker

Install docker via the lxc-docker package in Ubuntu. If you're in MacOS use the Boot2Docker image. Don't forget to install fig as well. If you have python & pip already you may install via pip install fig

Modify the /etc/default/docker and add/enable the following lines

DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"

and check if the docker service is running via

service docker status

A sample clojure docker container could be used to play around, get used to.

docker pull clojure
docker run -i -t --entrypoint /bin/bash <imageID>

Cassandra

Using the following Spotify Cassandra Container

Runs a command inside the given container ID. since image runs with cassandra -f option, you wont get any interaction

docker pull spotify/cassandra
# 
docker run spotify/cassandra -d --ip=172.17.0.48
# fetch the IP of the image
docker inspect <image_id> 
# modify your /etc/hosts file to add the cassandra host
docker exec -it <container_id> cqlsh < schema.cql

Kafka

http://www.michael-noll.com/blog/2013/03/13/running-a-multi-broker-apache-kafka-cluster-on-a-single-node/

Using Ches/Kafka as the base image. It's very simple to setup and use. Kafka requires ZooKeeper to keep track of it's client markers, nodes, etc..

docker run -d --name zookeeper jplock/zookeeper:3.4.6
docker run -d --name kafka --link zookeeper:zookeeper ches/kafka -p 9092:9092
docker run -d --name kafka --publish 9092:9092 --publish 7203:7203 --link zookeeper:zookeeper ches/kafka

ZK_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' zookeeper)
KAFKA_IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' kafka)
# learn the image ID. 
# "q" switch for quiet(returns only ID). "f" for filtering
KAFKA_CONT_ID=$(docker ps -fq name=kafka)
docker exec -it $KAFKA_CONT_ID kafka-topics.sh --create --topic test --replication-factor 1 --partitions 1 --zookeeper $ZK_IP:2181
docker exec -it $KAFKA_CONT_ID kafka-console-producer.sh --topic test --broker-list $KAFKA_IP:9092

a more complex kafka installation could be done via the following docker image https://registry.hub.docker.com/u/wurstmeister/kafka/

License

Copyright © 2014 Bahadir Cambel

Distributed under the MIT License.

docker run -d --hostname localhost --name kafka --volume ./data:/data --volume ./logs:/logs --publish 9092:9092 --publish 7203:7203 --env EXPOSED_HOST=127.0.0.1 --env ZOOKEEPER_IP=127.0.0.1 ches/kafka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.