Skip to content

Instantly share code, notes, and snippets.

View thiagosf's full-sized avatar
🏠
Always working at home

Thiago Silva Ferreira thiagosf

🏠
Always working at home
View GitHub Profile
@thiagosf
thiagosf / react-vue.conf
Created March 24, 2020 13:45
Multiple react/vue apps into nginx
# the magic happens here: =404
server {
server_name domain.com;
index index.html;
location /projec1 {
alias /var/www/projec1;
try_files $uri $uri/ /index.html =404;
}
location /projec2 {
@thiagosf
thiagosf / nginx.conf
Created September 5, 2019 00:03
Nginx: disable dot files less deny list
## Disable .htaccess and other hidden files
location ~ /\.(?!well-known).* {
deny all;
access_log off;
log_not_found off;
}
@thiagosf
thiagosf / my-favorites-react-packages.md
Last active August 31, 2019 19:07
My favorites react packages
@thiagosf
thiagosf / centos-apache-fix.md
Created July 30, 2019 23:45
CentOS and Apache: Permission denied

Error

[Tue Jul 30 23:32:08.018098 2019] [proxy:error] [pid 1845] (13)Permission denied: AH00957: HTTP: attempt to connect to 0.0.0.0:3000 (0.0.0.0) failed
[Tue Jul 30 23:32:08.018168 2019] [proxy:error] [pid 1845] AH00959: ap_proxy_connect_backend disabling worker for (0.0.0.0) for 60s

Resolution

@thiagosf
thiagosf / fix.md
Last active July 24, 2019 20:20
Error: Too many open files (node)

Error: Too many open files (node)

Simple test to know:

lsof | awk '{print $1}' | uniq -c | sort -n

And check the absurd number of files opened by node.

@thiagosf
thiagosf / deploy.md
Created July 4, 2019 22:46
Cria usuário deploy

Deploy user

Cria usuário deploy e adiciona grupo sudo:

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo

Troca usuário e gera ssh key:

@thiagosf
thiagosf / site.conf
Created February 1, 2019 12:23
Avoid infinite loop rails https on apache
<VirtualHost *:443>
# ...
RequestHeader set X_FORWARDED_PROTO 'https'
</VirtualHost>
@thiagosf
thiagosf / backup-mysql.sh
Created October 25, 2018 15:13
Backup MySQL and compress it
#!/bin/bash
DATE=`date +%Y-%m-%d`
DATABASE='dbname'
USER='username'
PASS='password'
mysqldump -u $USER -p$PASS $DATABASE > dump-$DATE.sql
zip dump-$DATE.sql.zip dump-$DATE.sql
rm dump-$DATE.sql
@thiagosf
thiagosf / node8.sh
Created October 8, 2018 13:04
Install node 8 on Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
@thiagosf
thiagosf / gist:eb2ba7d24968873e745c61d2ee72c0d8
Last active September 25, 2023 10:44
Export ERD (diagrams) from SequelPro

Export ERD (diagrams) from SequelPro

Install graphviz

sudo brew install graphviz

Open SequelPro, choose database and export dot file. Now, run the command: