This file contains 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
sudo apt list --upgradable | grep security |cut -d\/ -f1|xargs sudo apt-get install -y |
This file contains 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
# Configuration for server where Postgres is hosted. | |
make sure postgres is listening on 5432 port | |
paste `id_rsa.pub` from client server to ~/.ssh/authorized_keys | |
# Configuration for client server. Where web app live and you need connect it with postgres server |
This file contains 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
# nginx /etc/nginx/nginx.conf | |
rtmp { | |
server { | |
listen 1935; | |
chunk_size 4096; | |
allow publish <your public ip>; | |
deny publish all; | |
application live { | |
live on; |
This file contains 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
#### Postgres hosted on local machine | |
# postgres dump commands | |
pg_dump -U postgres_user -h localhost -Fc database_name > ./path/dump.sql | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d database_name ./path/dump.sql | |
# restore with psql | |
psql -h localhost -d database_name < ./path/dump.sql | |
#### Postgres hosted on docker |
This file contains 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
getArtistName(currentTabId, callback) { | |
chrome.tabs.executeScript( | |
currentTabId, | |
{ code: `document.querySelector('.now-playing span a[href^="/artist/"]').innerText` }, | |
callback | |
); | |
} | |
getSongName(currentTabId, callback) { | |
chrome.tabs.executeScript( |
This file contains 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
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
# Uncomment for socket activation (see below) | |
# Requires=puma.socket | |
[Service] | |
# Foreground process (do not use --daemon in ExecStart or config.rb) | |
Type=simple |
This file contains 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
module Goliath | |
class Request | |
old_post_process = instance_method(:post_process) | |
define_method(:post_process) do |results| | |
status, headers, body = *results | |
# Include any data here | |
# All requests will pass here | |
if env['size-error'] |
This file contains 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
begin | |
require 'em-hiredis' | |
rescue LoadError => error | |
raise 'Missing EM-Synchrony dependency: gem install em-hiredis' | |
end | |
module EventMachine | |
module Hiredis | |
def self.connect(uri = nil) |