Install the Rails gem if you haven't done so before
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
dnsmasq from package 'dnsmasq-base' starts with a (from libvirt) generated configuration: /var/lib/libvirt/dnsmasq/default.conf. | |
this configuration file is not directly editable because it gets overwritten from libvirt. | |
there is no possibility to set 'no-dhcp-interface=eth0' per 'libvirt'. | |
# ########################################################### | |
# deactivate dhcp in dnsmasq per libvirt | |
# dnsmasq listen on port 53 (dns) and 67 (dhcp) | |
j@ubuntu:~$ sudo netstat -taupen | grep -E ':53|:67' | |
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 0 9817 1218/dnsmasq |
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
Installing Ruby on Rails in Ubuntu 18.04 without any Ruby Manager | |
1.- As Root | |
-- Install Ruby and other packages you could be needing for Rails | |
apt-get install ruby ruby-dev sqlite3 gcc g++ make zlib1g-dev | |
gem update system 3.0.8 | |
gem install bundler | |
-- Install Node | |
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \ | |
apt-get install -y nodejs python-requests python-ipaddr && \ |
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
apt update | |
apt-get install -y build-essential sudo apt-utils dialog | |
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb | |
sudo dpkg -i erlang-solutions_2.0_all.deb | |
sudo apt-get update | |
sudo apt-get install erlang | |
sudo apt-get install elixir | |
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - | |
sudo apt-get update && apt-get install -y nodejs | |
node -v |
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-get install nginx | |
sudo ufw allow OpenSSH | |
sudo ufw allow http | |
sudo ufw allow https | |
sudo ufw allow 4000 | |
sudo ufw enable | |
yes | |
systemctl status nginx | |
sudo nano /etc/nginx/sites-available/default | |
sudo nano /var/www/html/index.nginx-debian.html |
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 install git | |
ssh-keygen | |
cat /home/user/.ssh/id_rsa.pub | |
copy the content | |
go to the github.com/user/myapp-repository/settings | |
ADD DEPLOY KEY | |
git clone git@github.com:user/myapp-repository.git | |
cd myapp | |
git pull | |
Already up to date. |
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
# | |
# if you are using RVM installed system wide (root) | |
# REMEMBER: if you are using RVM system wide NEVER run sudo gem install !!!! | |
# | |
rvmsudo gem install rspec rspec-rails rspec-rails-matchers | |
# | |
# if you are using RVM only on your local user or not using RVM at all | |
# |
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
#Create a new folder | |
mkdir RescueFolder | |
cd RescueFolder | |
#Make the image backup from the container with problems. | |
docker commit <container-id> <backup-image-name> | |
#then run a new container with that image | |
docker run -ti --entrypoint=sh <backup-image-name> | |
#in other terminal session se the temporary container name that is running | |
docker ps | |
CONTAINER ID IMAGE NAMES |
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
# Puma can serve each request in a thread from an internal thread pool. | |
# The `threads` method setting takes two numbers: a minimum and maximum. | |
# Any libraries that use thread pools should be configured to match | |
# the maximum value specified for Puma. Default is set to 5 threads for minimum | |
# and maximum; this matches the default thread size of Active Record. | |
# More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads | |
# | |
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | |
threads threads_count, threads_count |
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
desc 'Stop rails server' | |
task :stop do | |
File.new("tmp/pids/server.pid").tap { |f| Process.kill 9, f.read.to_i }.delete | |
end | |
desc 'Starts rails server' | |
task :start do | |
Process.exec("rails s puma -d") | |
end |
OlderNewer