Skip to content

Instantly share code, notes, and snippets.

View breim's full-sized avatar
:shipit:

Henrique Breim breim

:shipit:
  • Barcelona, Spain
View GitHub Profile
@breim
breim / deploy sh
Last active September 22, 2019 07:21
Quiz deploy
sudo apt-get update -y
sudo apt-get upgrade -y
# Rvm
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
rvm install 2.5.3
gem install rails
sudo docker build . -t face8
sudo docker run --name face8 -d -p 8081:8081
sudo docker stop face8
sudo docker start face8
sudo docker ps -a
sudo docker run -it face8 bash
sudo docker exec -it face8 bash
== Funcionando (POSTMAN)
D, [2018-11-13T16:47:35.397354 #5848] DEBUG -- : [5f552a92-fdb0-4eec-a9bf-24de2eb7de6c] (0.9ms) COMMIT
I, [2018-11-13T16:47:35.403792 #5848] INFO -- : [5f552a92-fdb0-4eec-a9bf-24de2eb7de6c] [active_model_serializers] Rendered VideoSerializer with ActiveModelSerializers::Adapter::Attributes (0.81ms)
D, [2018-11-13T16:47:35.415142 #5848] DEBUG -- : [5f552a92-fdb0-4eec-a9bf-24de2eb7de6c] (0.2ms) BEGIN
D, [2018-11-13T16:47:35.417026 #5848] DEBUG -- : [5f552a92-fdb0-4eec-a9bf-24de2eb7de6c] User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
D, [2018-11-13T16:47:35.418859 #5848] DEBUG -- : [5f552a92-fdb0-4eec-a9bf-24de2eb7de6c] SQL (0.4ms) INSERT INTO "logs" ("request_url", "status", "ip_request", "user_id", "http_method", "data", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["request_url", "https://player.chiligumvideos.com/api/videos"], ["status", "200"], ["ip_request", "170.78.
@breim
breim / 660-init-deb.sh
Last active October 23, 2018 04:59
nginx package daemon
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
pt:
dictionary:
actions: &actions 'Ações'
api_id: &api_id 'API ID (pegar essa informação no whitelabel)'
credentials_link: &credentials 'Credenciais'
description: &info 'Descrição'
destroy_question: &destroy_question 'Você tem certeza?'
docs_link: &docs 'Docs'
email: &email 'E-mail'
home_link: &home 'Home'
ubuntu@ip-172-31-57-145:~$ gem install chili_player
Fetching: chili_player-0.1.2.gem (100%)
Successfully installed chili_player-0.1.2
Parsing documentation for chili_player-0.1.2
Installing ri documentation for chili_player-0.1.2
Done installing documentation for chili_player after 0 seconds
1 gem installed
ubuntu@ip-172-31-57-145:~$ irb
@breim
breim / .vimrc
Created August 23, 2018 18:48 — forked from joegoggins/.vimrc
Mac Vim .vimrc file
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
[Unit]
Description=Btc Price
After=network.target
[Service]
Type=service
User=ubuntu
WorkingDirectory=/home/ubuntu/btc_price_example
ExecStart=/bin/bash -lc 'RAILS_ENV=production bundle exec rake btc:api'
Restart=on-failure
class WebNotificationsChannel < ApplicationCable::Channel
def subscribed
stream_from "web_notifications_channel"
end
end
<h1>
USD <div id="price"></div>
</h1>