Skip to content

Instantly share code, notes, and snippets.


Andrew Solera asolera

  • Secretaria Municipal de Inovação e Tecnologia de São Paulo
  • São Paulo
View GitHub Profile
asolera / smtp
Created Jun 30, 2022
SMTP test using Telnet
View smtp
telnet 25
Connected to
Escape character is '^]'.
220 c1v41d.localdomain ESMTP Postfix
helo test.smtp
250 c1v41d.localdomain
mail from:<>
250 2.1.0 Ok
rcpt to:<>
asolera /
Created Jan 24, 2022
git clone ssh on different port
git clone ssh://git@<url>:<port>/path/to/repo.git
asolera / table_size.sql
Created Nov 1, 2021
Show table size in PostgreSQL
View table_size.sql
SELECT pg_size_pretty(pg_relation_size('table_name'));
asolera / dead_tuples.sql
Created Nov 1, 2021
Show dead tuples on PostgreSQL
View dead_tuples.sql
SELECT relname AS "table_name",
n_dead_tup AS "dead_tuples"
FROM pg_stat_user_tables;
asolera /
Created Nov 1, 2021
Show simple config files
cat file.conf | grep -v '#' | grep -ve '^$'
asolera /
Last active Oct 20, 2021
Installing AWS CloudAgent on Amazon Linux
# Associate IAM profile (with role `CloudWatchAgentServerRole`) to your EC2 instance
# Install CloudWatch
sudo yum install amazon-cloudwatch-agent -y
# Install CollectD
sudo amazon-linux-extras install collectd -y
asolera /
Created May 31, 2021
WSO2 Conditional Redirecting Mediation Policy

This mediation policy redirects requests based on resource variable, but keeping limit and offset query params (ignore rest).

"Endpoint type" MUST be set to "Dynamic Endpoint" at "Implement" publisher tab.

asolera / slimscroll.js
Created May 4, 2021
jQuery SlimScroll fix for window resize
View slimscroll.js
function applySlimScroll() {
$('.slimScrollDiv .sidebar').unwrap();
$('.slimScrollBar, .slimScrollRail').remove();
height: 'auto',
size: '10px',
color: #ff0000',
alwaysVisible: true,
railVisible: true,
railColor: '#222',
asolera /
Last active Apr 29, 2021
Traefik + Nginx without Docker on AWS - Amazon Linux 2 (AMI)

Traefik + Nginx without Docker on Amazon Linux 2 (AMI)

Guide on how to configure Traefik with Nginx on Amazon Linux 2 EC2 Instance, without Docker.

  1. Create an EC2 Instance on AWS with security groups allowing incoming traffic on ports 80 and 443.

  2. Connect to your instance.

  3. Install and configure Nginx:

asolera /
Created Apr 23, 2021
Fix CRLF git problems
git config --global core.autocrlf false
git rm --cached -r .
git reset --hard