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
| docker run -d \ | |
| --name=postgres \ | |
| --restart=always \ | |
| -p 5432:5432 \ | |
| -v /etc/localtime:/etc/localtime:ro \ | |
| -e POSTGRES_USER=user \ | |
| -e POSTGRES_PASSWORD=mysecretpassword \ | |
| -v /storage/postgres:/var/lib/postgresql/data \ | |
| postgres:latest |
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
| server { | |
| listen 80; | |
| server_name seusite.com; | |
| return 301 http://www.seusite.com$request_uri; | |
| } | |
| server { |
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
| # Definiro o ZSH como terminal padrao | |
| chsh -s $(which zsh) | |
| # Symbolic Link | |
| ln -s <source> <target> | |
| # Ubuntu configure locale e timezone | |
| sudo dpkg-reconfigure locales | |
| sudo dpkg-reconfigure tzdata |
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
| VBoxManage modifyvm <vmname> --hwvirtex off |
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
| # Advanced config for NGINX | |
| server_tokens off; | |
| add_header X-XSS-Protection "1; mode=block"; | |
| add_header X-Content-Type-Options nosniff; | |
| # Redirect all HTTP traffic to HTTPS | |
| server { | |
| listen 80; | |
| server_name www.domain.com domain.com; | |
| return 301 https://$host$request_uri; |
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
| # Removendo o carregamento onhover de links | |
| <meta name="turbo-prefetch" content="false"> | |
| # Method Delete link_to no turbo | |
| <%= link_to logout_path, class: "nav-link", data: { turbo_method: :delete, turbo: true } do %> | |
| # COMANDOS | |
| rails new appname -d postgresql | |
| rails new appname --api |
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
| <% if notice || alert %> | |
| <% t = 'success' if notice %> | |
| <% t = 'danger' if alert %> | |
| <% | |
| if notice && notice.split('^')[0] == 'warning' | |
| t = 'warning' | |
| m = notice.split('^')[1] | |
| else | |
| m = notice || alert | |
| end |
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
| # https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
| 1 - Open PowerShell as Administrator and run: | |
| Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | |
| 2 - Restart your computer when prompted. |
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
| # Link de Referência | |
| https://certbot.eff.org/ | |
| https://certbot.eff.org/docs/ | |
| # Install | |
| On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you'll need to do is apt-get the following packages. | |
| $ sudo apt-get update |
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
| # Bash start.sh para inicialização da aplicação Rails >= 5.2 | |
| https://gist.github.com/alexishida/96ab6138caeb63a68e96a0bb1bf58c15 | |
| # Gerando o banco | |
| RAILS_ENV=production rails db:create | |
| RAILS_ENV=production rails db:migrate | |
| RAILS_ENV=production rails db:seed | |
| # Gerando os assets | |
| RAILS_ENV=production rails assets:precompile |