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 certbot --authenticator webroot --installer nginx | |
select number | |
add webroot (path/to/app) | |
sudo service nginx restart |
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
http://mohumohu/parent.html | |
http://hogehoge.com/iframe.html | |
//parent.html | |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
source :rubygems | |
gem "puma" | |
gem "sinatra" |
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
require 'sinatra' | |
get '/' do | |
File.read(File.join('public', 'index.html')) | |
# or | |
# send_file File.join(settings.public, 'index.html') | |
end |
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
# first sphinx | |
brew install sphinx | |
# the formula does not install libsphinxclient :/ | |
wget http://sphinxsearch.com/files/sphinx-2.0.4-release.tar.gz | |
tar xzf sphinx-2.0.4-release.tar.gz | |
cd sphinx-2.0.4-release/api/libsphinxclient/ | |
CXXCPP="gcc -E" ./configure --prefix=/usr/local | |
make | |
make install |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
upstream puma_<%= fetch(:nginx_config_name) %> { <% | |
flags = 'fail_timeout=0' | |
@backends = [fetch(:puma_bind)].flatten.map do |m| | |
etype, address = /(tcp|unix|ssl):\/{1,2}(.+)/.match(m).captures | |
if etype =='unix' | |
"server #{etype}:#{address} #{fetch(:nginx_socket_flags)};" | |
else | |
"server #{address.gsub(/0\.0\.0\.0(.+)/, "127.0.0.1\\1")} #{fetch(:nginx_http_flags)};" | |
end | |
end |
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
<<APP>> change this variables |
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
# ubuntu: sudo nano /etc/postgresql/<< version >>/main/pg_hba.conf | |
# Позволяет любому пользователю локальной системы подключиться | |
# к любой базе данных, используя любое имя базы данных через | |
# доменные сокеты Unix (по умолчанию для локальных подключений). | |
# | |
# TYPE DATABASE USER ADDRESS METHOD | |
local all all trust | |
# То же, но для локальных замкнутых подключений по TCP/IP. |