This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List the Vagrant config to get ip address and key path | |
| $ vagrant ssh-config | |
| # Bind port | |
| $ sudo ssh -L 0.0.0.0:80:<vagran-ip>:80 -i <path-to-listed-private-key> -p 2222 -N vagrant@localhost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :db do | |
| namespace :drop do | |
| task connections: :environment do | |
| begin | |
| database = ActiveRecord::Base.connection.current_database | |
| ActiveRecord::Base.connection.execute(<<-SQL) | |
| SELECT pg_terminate_backend(pg_stat_activity.pid) | |
| FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = '#{database}' AND pid <> pg_backend_pid(); | |
| SQL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Install Nodejs | |
| curl https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz -O \ | |
| && tar xf node-v8.12.0-linux-x64.tar.xz \ | |
| && cp -R node-v8.12.0-linux-x64/* /usr/local \ | |
| && rm -rf node-v8.12.0-linux-x64 \ | |
| && rm -f node-v8.12.0-linux-x64.tar.xz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p $HOME/Library/KeyBindings | |
| nano $HOME/Library/KeyBindings/DefaultKeyBinding.dict | |
| # Put the following content into them | |
| # | |
| # { | |
| # "#." = ("insertText:", ","); | |
| # } | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO public.banks (id, name, ispb_code, compensation_code, created_at, updated_at) VALUES ('113cd26a-e451-4a86-8fef-e30d353860f3', 'BCO DO BRASIL S.A.', '0', '1', '2023-08-25 12:04:04.798226', null); | |
| INSERT INTO public.banks (id, name, ispb_code, compensation_code, created_at, updated_at) VALUES ('2abd0e9c-8a84-406c-8e85-60b9c27ff52d', 'BRB - BCO DE BRASILIA S.A.', '208', '70', '2023-08-25 12:04:04.798226', null); | |
| INSERT INTO public.banks (id, name, ispb_code, compensation_code, created_at, updated_at) VALUES ('a67e2928-9a99-4688-b66f-e27a61a0af84', 'SANTINVEST S.A. - CFI', '122327', '539', '2023-08-25 12:04:04.798226', null); | |
| INSERT INTO public.banks (id, name, ispb_code, compensation_code, created_at, updated_at) VALUES ('a7c6613f-08b6-4303-8a6a-68f949f8d290', 'CCR SEARA', '204963', '430', '2023-08-25 12:04:04.798226', null); | |
| INSERT INTO public.banks (id, name, ispb_code, compensation_code, created_at, updated_at) VALUES ('b7100d66-f3b5-4968-83b3-967f3c0da6fa', 'AGK CC S.A.', '250699', '272', '2023-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import websockets | |
| import time | |
| SERVER_IP = "192.168.X.X" # IP da máquina que está rodando o servidor | |
| PORT = 8765 # Porta do servidor WebSocket | |
| URL = f"ws://{SERVER_IP}:{PORT}" | |
| async def monitor_websocket(): | |
| while True: |
OlderNewer