Skip to content

Instantly share code, notes, and snippets.

View asolera's full-sized avatar

Andrew Solera asolera

  • Secretaria Municipal de Direitos Humanos e Cidadania
  • São Paulo
View GitHub Profile
asolera / settings.json
Created January 28, 2024 03:24
VSCode Settings
View settings.json
"workbench.startupEditor": "none",
"": "Git Bash",
"editor.indentSize": "tabSize",
"editor.detectIndentation": false,
"symbols.hidesExplorerArrows": false,
"workbench.iconTheme": "symbols",
"editor.fontFamily": "JetBrains Mono",
"editor.lineHeight": 1.8,
"editor.fontLigatures": true,
asolera / smtp
Created June 30, 2022 15:01
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 January 24, 2022 18:40
git clone ssh on different port
git clone ssh://git@<url>:<port>/path/to/repo.git
asolera / table_size.sql
Created November 1, 2021 16:12
Show table size in PostgreSQL
View table_size.sql
SELECT pg_size_pretty(pg_relation_size('table_name'));
asolera / dead_tuples.sql
Created November 1, 2021 16:11
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 November 1, 2021 16:08
Show simple config files
cat file.conf | grep -v '#' | grep -ve '^$'
asolera /
Last active October 20, 2021 14:07
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 22:17
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 21:57
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 April 29, 2021 21:00
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: