0. Create kafka user
sudo adduser kafka
sudo adduser kafka sudo
su -l kafka
1. Download and Install kafka archive
| [Unit] | |
| Description=Redis In-Memory Data Store | |
| After=network.target | |
| [Service] | |
| Type=forking | |
| User=redis | |
| Group=redis | |
| ExecStart=/usr/local/bin/redis-server /etc/redis/6379.conf | |
| ExecStop=/usr/local/bin/redis-cli shutdown |
| -- Adapted from these sources: | |
| -- http://peterdowns.com/posts/open-iterm-finder-service.html | |
| -- https://gist.github.com/cowboy/905546 | |
| -- | |
| -- Modified to work with files as well, cd-ing to their container folder | |
| on run {input, parameters} | |
| tell application "Finder" | |
| set my_file to first item of input | |
| set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file)) | |
| if is_folder ends with "directory" then |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| import base64 | |
| block_size = AES.block_size | |
| #unpad = lambda s : s[0:-ord(s[-1])] | |
| def pad(plain_text): |
最终实现效果:
使用流程:
#0.起源
| # install ruby, rubygems and all requirements, then install FPM (effing package manager) | |
| # fpm: https://github.com/jordansissel/fpm | |
| # as root | |
| # update system, install requirements | |
| yum update -y | |
| yum install ruby-devel gcc curl libyaml-devel | |
| # get the ruby version manager and install | |
| curl -L get.rvm.io | bash -s stable |
| "Serve a Flask app on a sub-url during localhost development." | |
| from flask import Flask | |
| APPLICATION_ROOT = '/spam' | |
| app = Flask(__name__) | |
| app.config.from_object(__name__) |