Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
| # https://github.com/taskrabbit/elasticsearch-dump | |
| elasticdump \ | |
| --input=http://localhost:9200/index_name \ | |
| --output=product_action_results2.json \ | |
| --type=data \ | |
| --searchBody '{"query":{"query_string": { "query": "sale_system_name:Amazon AND type:error" }}}' \ | |
| --limit 1000 |
| #!/bin/bash | |
| # add user to group and log out. | |
| # sudo usermod -a -G docker $USER | |
| docker run -d --restart unless-stopped --name elasticsearch -p 9200:9200 elasticsearch:2.4.6 | |
| docker run -d --restart unless-stopped --name kibana -p 5601:5601 --link elasticsearch:elasticsearch kibana:4.6.6 | |
| docker run -d --restart unless-stopped --name mongo -p 27017:27017 mongo:3.4.9 --storageEngine mmapv1 | |
| docker run -d --restart unless-stopped --name redis -p 6379:6379 redis:4.0.1 | |
| docker run -p 3000 -e "DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')" -e TZ=America/Recife -v /home/allanbatista/workspace/containers/skyhub/container:/root -it allanbatista/dev-skyhub:1 bash |
| # POST http://localhost:9200/_template/default_template | |
| { | |
| "template": "*", | |
| "mappings": { | |
| "dynamic_templates": [ | |
| { | |
| "timestamp": { | |
| "match": "*_at", | |
| "mapping": { |
| # /etc/nginx/sites-enabled/default | |
| upstream app { | |
| # Path to Puma SOCK file, as defined previously | |
| server unix:///var/www/html/shared/sockets/puma.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server ipv6only=on; |
| sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl | |
| sudo chmod a+rx /usr/local/bin/youtube-dl | |
| youtube-dl https://www.youtube.com/playlist?list=PLxEB_CPQhRLtdVGHhYS8mSUuz3kWP6kkB --yes-playlist -v --print-traffic -f bestvideo[ext!=webm]+bestaudio[ext!=webm]/best[ext!=webm] |
| sudo apt-get install apache2-utils | |
| sudo htpasswd -c /etc/nginx/.htpasswd sidekiq | |
| senha | |
| sudo vim /etc/nginx/sites-enabled/default | |
| # put this inside server | |
| location /admin/sidekiq { | |
| auth_basic "Restricted"; | |
| auth_basic_user_file /etc/nginx/.htpasswd; | |
| } | |
| sudo service nginx restart |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| ## app/middleware/request_timeout_log.rb | |
| # | |
| ## config/application.rb | |
| # add middleware to cout request time and log them | |
| # config.middleware.use 'RequestTimeoutLog' | |
| # | |
| # http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/1265/focus=1269 | |
| # | |
| # class RequestTimeoutLog < Struct.new(:app) | |
| # def call(env) |
| ## | |
| # UpStart mongod | |
| # /lib/systemd/system/mongod.service | |
| # sudo systemctl enable mongod.service | |
| # sudo systemctl start mongod.service | |
| [Unit] | |
| Description=High-performance, schema-free document-oriented database | |
| Documentation=man:mongod(1) | |
| After=network.target |