# Gerson Barreiros — Complete Knowledge Base
> Just another personal blog. Full-text index for AI agents and LLM ingestion.
> Canonical URL: https://gerson.barreiros.nom.br/
> Author: Gerson Barreiros
> Summary Index: https://gerson.barreiros.nom.br/llms.txt

## Free Digital Tools Platform (https://gerson.barreiros.nom.br/ferramentas/)
- **PDF (Stirling-PDF)** (https://pdf.gerson.barreiros.nom.br/): Editor e conversor de documentos PDF (juntar, dividir, comprimir, OCR)
- **IT-Tools** (https://tools.gerson.barreiros.nom.br/): Mais de 80 utilitarios rapidos para desenvolvedores e SysAdmins
- **MeTube** (https://download.gerson.barreiros.nom.br/): Download de videos e audios publicos em alta definicao
- **Paste (PrivateBin)** (https://paste.gerson.barreiros.nom.br/): Compartilhamento seguro de textos e codigo com criptografia
- **Speed (LibreSpeed)** (https://speed.gerson.barreiros.nom.br/): Teste de velocidade de internet (download, upload, ping e jitter)
- **Convert (Vert Local)** (https://convert.gerson.barreiros.nom.br/): Conversor local de imagens (HEIC, WebP, PNG, JPG, PDF)
- **HTML Drop & Studio** (https://html.gerson.barreiros.nom.br/): Criador e publicador rapido de paginas web HTML
- **Mazanoke** (https://mazanoke.gerson.barreiros.nom.br/): Otimizador de imagens com remocao de metadados EXIF
- **PairDrop** (https://pairdrop.gerson.barreiros.nom.br/): Transferencia P2P de arquivos entre dispositivos no navegador
- **Excalidraw** (https://draw.gerson.barreiros.nom.br/): Quadro branco e diagramas livres com exportacao PNG/SVG
- **Squoosh** (https://squoosh.gerson.barreiros.nom.br/): Compressor visual de imagens (AVIF, WebP, MozJPEG, OxiPNG)
- **Send** (https://send.gerson.barreiros.nom.br/): Compartilhamento criptografado de arquivos ate 500 MB
- **ExifCleaner** (https://exif.gerson.barreiros.nom.br/): Higienizador de fotos e remocao de coordenadas GPS/EXIF
- **Diff** (https://diff.gerson.barreiros.nom.br/): Comparador visual de textos, JSON e codigo linha por linha
- **QR Studio & Pix** (https://qr.gerson.barreiros.nom.br/): Gerador de QR Code personalizado com Pix Copia e Cola e Wi-Fi
- **CyberChef** (https://chef.gerson.barreiros.nom.br/): Canivete suico com +300 operacoes de encodings, cifras e hashes
- **Mapa Mental e Diagramas** (https://mapa.gerson.barreiros.nom.br/): Editor de mapas mentais e diagramas Mermaid no navegador
- **Otimizador SVG** (https://svg.gerson.barreiros.nom.br/): Minificador de vetores SVGOMG client-side
- **Display Tester** (https://display.gerson.barreiros.nom.br/): Diagnostico completo de telas e monitores (dead pixel, Hz, ghosting)

---

## Proxy using SSH Tunnel
- URL: https://gerson.barreiros.nom.br/proxy-using-ssh-tunnel/
- Markdown URL: https://gerson.barreiros.nom.br/proxy-using-ssh-tunnel/?format=markdown
- Date: 2015-06-20
- Categories: Amazon AWS, SysAdmin, Tips, Ubuntu

Browse the web using your SSH Server by making it a proxy server
															![](https://gerson.barreiros.nom.br/wp-content/uploads/2015/06/ssh.png)

		To use it, you can use your terminal if you are in Linux, or Putty/WSL in Windows.

```
ssh -D8888 login@10.0.0.30
```

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/sshproxy.png)
The SSH client will create a SOCKS proxy you can configure applications to use. All the traffic sent through the proxy would be sent through the SSH server. It takes local traffic sent to a specific port on your PC and sends it over the SSH connection to a remote location.
And on your browser (i do recommend firefox for it) you can configure as a socket proxy. Using address localhost and the same port that you choosed.
![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/sshproxy2.png)

---

## How to auto start services on boot in Centos / Redhat / Oracle Linux?
- URL: https://gerson.barreiros.nom.br/how-to-auto-start-services-on-boot-in-centos-redhat-oracle-linux/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-auto-start-services-on-boot-in-centos-redhat-oracle-linux/?format=markdown
- Date: 2015-01-23
- Categories: SysAdmin, Tips

To auto start services in Centos, Redhat or Oracle Linux, you can use builtin chkconfig utility. It is located in /sbin directory. If you are a regular user (non-root), then /sbin may not be in your path. Therefore, you may have to use the full path to access the chkconfig utility.

![centos](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/centos.png)

		To auto start a new service:

- Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd
- Add it to chkconfig
```
sudo /sbin/chkconfig --add mysqld
```

- Make sure it is in the chkconfig.
```
sudo /sbin/chkconfig --list mysqld
```

- Set it to autostart
```
sudo /sbin/chkconfig mysqld on
```

- To stop a service from auto starting on boot
```
sudo /sbin/chkconfig mysqld off
```

source: [A Bit Pusher](http://www.abhigupta.com/)

---

## Display calibration
- URL: https://gerson.barreiros.nom.br/display-calibration/
- Markdown URL: https://gerson.barreiros.nom.br/display-calibration/?format=markdown
- Date: 2014-10-13
- Categories: Tips

As i use the same monitor (LG W2486L) on my Nintendo Wii U and my Computer, i never payed attention to the fact that sometimes i couldn’t see some colors just for a wrong calibration on my display.

I do use Adobe Lightroom on this PC to make enhancements to the photos, but how could i know if my display was showing what i need to see?

A friend of mine told me about some videos that could help me to do that, on the link below you can download the videos and check more information about it.

[http://www.avsforum.com/forum/139-display-calibration/948496-avs-hd-709-blu-ray-mp4-calibration.html](http://www.avsforum.com/forum/139-display-calibration/948496-avs-hd-709-blu-ray-mp4-calibration.html)

I just used the basic settings and now my display is very better, i can see a better range of whites and blacks.

---

## YouTube Background for Android 2.2+
- URL: https://gerson.barreiros.nom.br/youtube-background-for-android-2-2/
- Markdown URL: https://gerson.barreiros.nom.br/youtube-background-for-android-2-2/?format=markdown
- Date: 2014-08-05
- Categories: Android, Tips

![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/08/ic_launcher.png)

I made this app for a friend that wanted to play YouTube videos just to listen it’s audio. So it’s very simple, works by sharing the URL from YouTube video with the app or googleing the video. (for instance: go to google.com and type “YouTube lindsey”.

Unfortunately, google removed this app from google play, so its here now.

[Download](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/YouTubeBackground.apk)

---

## AWS lowers cloud pricing by launching the T2 instance type that can burst to handle occasional workload spike
- URL: https://gerson.barreiros.nom.br/aws-lowers-cloud-pricing-by-launching-the-t2-instance-type-that-can-burst-to-handle-occasional-workload-spike/
- Markdown URL: https://gerson.barreiros.nom.br/aws-lowers-cloud-pricing-by-launching-the-t2-instance-type-that-can-burst-to-handle-occasional-workload-spike/?format=markdown
- Date: 2014-07-05
- Categories: Amazon AWS, SysAdmin

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/aws-1.png)
		T2 instances are [Burstable Performance Instances](http://aws.amazon.com/ec2/instance-types/#burst) that provide a baseline level of CPU performance with the ability to burst above the baseline. The baseline performance and ability to burst are governed by CPU Credits. Each T2 instance receives CPU Credits continuously at a set rate depending on the instance size.  T2 instances accrue CPU Credits when they are idle, and use CPU credits when they are active.  T2 instances are a good choice for workloads that don’t use the full CPU often or consistently, but occasionally need to burst (e.g. web servers, developer environments and small databases).

		T2 instances are currently available in three instance sizes: t2.micro, t2.small, and t2.medium. Customers can launch T2 instances using the AWS management console, Amazon EC2 command line interface, and the AWS SDKs. T2 instances are available as On-Demand or Reserved Instances, but they cannot be purchased as Spot Instances.

With On-Demand Instance prices starting at $0.013 per hour ($9.62 per month), for t2.micro, $0.026 per hour ($19,24) for t2.small and $0.052 per hour ($38,48) for t2.medium. T2 instances are the lowest-cost Amazon EC2 instance option.

Features:

- High Frequency Intel Xeon Processors operating at 2.5GHz with Turbo up to 3.3GHz
- Burstable CPU, governed by CPU Credits, and consistent baseline performance
- Lowest-cost general purpose instance type, and Free Tier eligible (t2.micro only)
- Balance of compute, memory, and network resources.

Use cases: Development environments, build servers, code repositories, low-traffic web applications, early product experiments, small databases.

ModelvCPUCPU Credits / hourMem (GiB) Storage   (GB)

t2.micro161EBS Only

t2.small1122EBS Only

t2.medium2244EBS Only

      Instance type

Initial CPU credit*

CPU credits earned per hour

Base performance (CPU utilization)

Maximum CPU credit balance

`t2.micro`

30

6

10%

144

`t2.small`

30

12

20%

288

`t2.medium`

60

24

40%**

576

* There are limits to how many of your T2 instances will launch with the initial credit, which by default is set to 100 launches per 24-hour period by region. If you’d like to increase this limit, you can file a customer support limit increase request by using the [Amazon EC2 Instance Request Form](https://aws.amazon.com/support/createCase?type=service_limit_increase&serviceLimitIncreaseType=ec2-instances).

** `t2.medium` instances have two vCPUs. The base performance is an aggregate of the two vCPUs; this can be 40% utilization on one vCPU, 20% each on two vCPUs, or any combination that does not exceed 40%.

CPU Credits

Traditional Amazon EC2 instance types provide fixed performance, while T2 instances provide a baseline level of CPU performance with the ability to burst above baseline. The baseline performance and ability to burst are governed by CPU credits. Each T2 instance continuously receives CPU credits at a set rate, depending on the instance size. T2 instances accrue CPU credits when they are idle, and use CPU credits when they are active. A CPU credit provides the performance of a full CPU core for one minute. Each T2 instance starts with a healthy balance of CPU credits.

For example, a t2.small instance continuously receives credits at a rate of 12 CPU credits per hour. This capability provides baseline performance equivalent to 20 percent of a CPU core. If at any moment the instance does not need the credits it receives, it stores them in its CPU credit balance for up to 24 hours. If and when your t2.small instance needs to burst to more than 20 percent of a core, it draws from its CPU credit balance. Over time, if you find that your workload needs more CPU credits, or that your instance does not maintain a positive CPU credit balance, we recommend using a larger T2 size, such as the t2.medium, or using a fixed performance instance type.

[Truncated — read full article at https://gerson.barreiros.nom.br/aws-lowers-cloud-pricing-by-launching-the-t2-instance-type-that-can-burst-to-handle-occasional-workload-spike/?format=markdown]

---

## htop
- URL: https://gerson.barreiros.nom.br/htop/
- Markdown URL: https://gerson.barreiros.nom.br/htop/?format=markdown
- Date: 2014-06-30
- Categories: SysAdmin, Ubuntu

![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/06/logo-300x29-1.png)
			htop is an interactive text-mode system-monitor process viewer for GNU/Linux. It aims to be a better ‘top’. It shows a frequently updated list of the processes running on a computer, normally ordered by the amount of CPU usage. Unlike top, htop provides a full list of processes running, instead of the top resource-consuming processes. htop uses color and gives visual information about processor, swap and memory status.

		To install it on ubuntu:

```
sudo apt-get install htop
```

To install it on centos:

```
sudo yum install htop
```

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/htop.png)

---

## Simplify your life with SSH config file and ClusterSSH
- URL: https://gerson.barreiros.nom.br/simplify-your-life-with-ssh-config-file-and-clusterssh/
- Markdown URL: https://gerson.barreiros.nom.br/simplify-your-life-with-ssh-config-file-and-clusterssh/?format=markdown
- Date: 2014-06-25
- Categories: SysAdmin

![](https://gerson.barreiros.nom.br/wp-content/uploads/2015/06/ssh.png)
						If you’re anything like me, you probably log in and out of a half dozen remote servers on a daily basis. And if you’re even more like me, you have trouble remembering all of the various usernames, remote addresses and command line options for things like specifying a non-standard connection port or forwarding local ports to the remote machine. And sometimes you have to do the same thing in a lot of servers, this post is for you.

		One option would be to create a bash alias for each remote server. However, there is another, much better, and more straightforward solution to this problem. OpenSSH allows you to set up a per-user configuration file where you can store different SSH options for each remote machine you connect to.

OpenSSH client-side configuration file is named config, and it is stored in the .ssh directory under the user’s home directory.

The ~/.ssh directory is automatically created when the user runs the ssh command for the first time. If the directory doesn’t exist on your system, create it using the command below:

```
mkdir -p ~/.ssh && chmod 700 ~/.ssh
```

By default, the SSH configuration file may not exist, so you may need to create it using the touch command :

```
touch ~/.ssh/config
```

This file must be readable and writable only by the user and not accessible by others:

```
chmod 600 ~/.ssh/config

```

Typically, when connecting to a remote server via SSH, you would specify the remote user name, hostname, and port. For example, to log in as a user named john to a host called dev.example.com on port 2322 from the command line, you would type:

ssh john@dev.example.com -p 2322

The SSH Config File takes the following structure:

Host hostname1

SSH_OPTION value

SSH_OPTION value

Host dev

HostName dev.example.com

User john

Port 2322

Host *

SSH_OPTION value

The contents of the SSH client config file is organized into stanzas (sections). Each stanza starts with the Host directive and contains specific SSH options used when establishing a connection with the remote SSH server.

Indentation is not required but is recommended since it makes the file easier to read.

The Host directive can contain one pattern or a whitespace-separated list of patterns. Each pattern can contain zero or more non-whitespace character or one of the following pattern specifiers:

* - Matches zero or more characters. For example, Host * matches all hosts, while 192.168.0.* matches hosts in the 192.168.0.0/24 subnet.

? - Matches exactly one character. The pattern, Host 10.10.0.? matches all hosts in 10.10.0.[0-9] range.

! - When used at the start of a pattern, it negates the match. For example, Host 10.10.0.* !10.10.0.5 matches any host in the 10.10.0.0/24 subnet except 10.10.0.5.

The SSH client reads the configuration file stanza by stanza, and if more than one patterns match, the options from the first matching stanza take precedence. Therefore more host-specific declarations should be given at the beginning of the file, and more general overrides at the end of the file.

You can find a full list of available ssh options by typing man ssh_config in your terminal or visiting the ssh_config man page .

The SSH config file is also read by other programs such as scp , sftp , and rsync.

ClusterSSH

If you have a need to type the same command into several machines at once, you can login to each one with SSH and do it serially, or you can save yourself a lot of time and effort and use a tool like ClusterSSH.

To install it, just use:

sudo apt install clusterssh

To use it check on [https://www.linux.com/training-tutorials/managing-multiple-linux-servers-clusterssh/](https://www.linux.com/training-tutorials/managing-multiple-linux-servers-clusterssh/) while i still didnt finish this post.

Source: [linuxize](https://linuxize.com/post/using-the-ssh-config-file/) & [linux.com](https://www.linux.com/training-tutorials/managing-multiple-

[Truncated — read full article at https://gerson.barreiros.nom.br/simplify-your-life-with-ssh-config-file-and-clusterssh/?format=markdown]

---

## Apache restrict access based on IP address to selected directories
- URL: https://gerson.barreiros.nom.br/apache-restrict-access-based-on-ip-address-to-selected-directories/
- Markdown URL: https://gerson.barreiros.nom.br/apache-restrict-access-based-on-ip-address-to-selected-directories/?format=markdown
- Date: 2014-06-24
- Categories: SysAdmin, Ubuntu

[![apache](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/apache.png)](https://httpd.apache.org)Apache web server allows server access based upon various conditions. For example you just want to restrict access to url http://subdomain.domain.com/ (mapped to /var/www/subdomain directory) from 192.168.1.0/24 network (within intranet).

Apache provides access control based on client hostname, IP address, or other characteristics of the client request using mod_access module.

		Read here while i still didnt finish this post.

[https://www.cyberciti.biz/faq/apache-restrict-access-based-on-ip-address-to-selected-directories/](https://www.cyberciti.biz/faq/apache-restrict-access-based-on-ip-address-to-selected-directories/)

Source: [cyberciti.biz](https://www.cyberciti.biz/faq/apache-restrict-access-based-on-ip-address-to-selected-directories/)

---

## How to solve "Falling back to the standard locale" in ubuntu
- URL: https://gerson.barreiros.nom.br/how-to-solve-falling-back-to-the-standard-locale-in-ubuntu/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-solve-falling-back-to-the-standard-locale-in-ubuntu/?format=markdown
- Date: 2014-06-23
- Categories: SysAdmin, Ubuntu

[![ubuntu](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/ubuntu.png)](https://ubuntu.com)Sometimes you can get a error like this:

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LC_PAPER = “pt_BR.UTF-8”,

LC_ADDRESS = “pt_BR.UTF-8”,

LC_MONETARY = “pt_BR.UTF-8”,

LC_NUMERIC = “pt_BR.UTF-8”,

LC_TELEPHONE = “pt_BR.UTF-8”,

LC_IDENTIFICATION = “pt_BR.UTF-8”,

LC_MEASUREMENT = “pt_BR.UTF-8”,

LC_TIME = “pt_BR.UTF-8”,

LC_NAME = “pt_BR.UTF-8”,

LANG = “en_US.UTF-8”

are supported and installed on your system.

perl: warning: Falling back to the standard locale (“C”).

Press continue reading to understand how to fix this!

---

## Powerful Redmine in AWS
- URL: https://gerson.barreiros.nom.br/powerful-redmine-in-aws/
- Markdown URL: https://gerson.barreiros.nom.br/powerful-redmine-in-aws/?format=markdown
- Date: 2014-06-22
- Categories: Amazon AWS, SysAdmin, Ubuntu

In this post i will show how to make a installation of Redmine in AWS with some nice tools from AWS (EC2, RDS, S3, SES, ElastiCache) and making it auto scalable.

[![Redmine](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/redmine.png)](https://redmine.org)

		AWS Account, with your ssh key:

Generate your ssh with this cli (please, run this command with your user, DO NOT USE sudo):

ssh-keygen -t rsa -b 2048

In AWS Key Pairs, click Import Key Pairs, Choose File, select your id_rsa.pub, put a Key Pair Name on it.

[![Amazon EC2](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/ec2.png)](https://aws.amazon.com/ec2/)

Security Group:

EC2 Group

Inbound – All traffic – All – All – yourip

Inbound – HTTP – TCP – 80 – 0.0.0.0/0

Outbound – All traffic – All – All – 0.0.0.0/0

RDS Group

Inbound – MYSQL – TCP – 3306 – InstancePrivateIP

Outbound – All traffic – All – All – 0.0.0.0/0

ElastiCache Group

Inbound – Custom TCP Rule – TCP – 11211 – InstancePrivateIP

Outbound – All traffic – All – All – 0.0.0.0/0

EC2, t1.micro with 8GB is sufficient, ubuntu 14.04 will be used here.

While creating ec2:

Use this image Ubuntu Server 14.04 LTS (PV), 64-bit.

Select your EC2 Security Group.

[![Amazon S3](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/aws-s3.png)](https://aws.amazon.com/s3/)

S3 bucket for Redmine files, create one with AWS S3 Console

Memcached create one node with AWS ElastiCache Console

RDS (we are going to use MySQL) create one in AWS RDS Console

Redmine github [https://github.com/redmine/redmine](https://github.com/redmine/redmine)

Redmine S3 github [https://github.com/ka8725/redmine_s3](https://github.com/ka8725/redmine_s3)

Redmine Backlogs [https://github.com/backlogs/redmine_backlogs](https://github.com/backlogs/redmine_backlogs)

SES for redmine send emails, check more about it [here](https://gerson.barreiros.nom.br/amazon-ses-simple-email-service/).

Create an IAM user with permission for this s3 redmine bucket.

Generate Keys for this user, and keep it.

Policy example:

{

     “Statement”: [

         {[![Amazon IAM](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/aws-iam.png)](https://aws.amazon.com/iam/)

             “Effect”: “Allow”,

             “Action”: “s3:ListAllMyBuckets”,

             “Resource”: “arn:aws:s3:::*”

         },

         {

             “Effect”: “Allow”,

             “Action”: “s3:*”,

             “Resource”: [

                 `"arn:aws:s3:::yourbucketname",
                "arn:aws:s3:::yourbucketname/*"`

             ]

         }

     ]

 }

[![Amazon RDS](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/rds.png)](https://aws.amazon.com/rds/)

Start RDS, with RDS Security Group, login using mysql-client (you dont have ssh shell for a RDS) and create a user for redmine that can only access redmine database.

Example:

mysql -h mysqlrdsaddress.com -U myuser -p

type your password.

create user ‘myredmine’@’%’ identified by ‘mypass’;

create database myredminedatabase;

grant all privileges on myredminedatabase.* to ‘myredmine’@’%’;

Ps. For additional security, you should change the wildcard from % to your instance Private IP.

Start EC2, with EC2 Security Group, your Key Pair and ssh to it with ubuntu@yourmachineip, if you can’t login, check your security group and your keypair.

Install needed packages.

$ sudo apt-get install apache2 libapache2-mod-passenger git postfix libmysqlclient-dev libmagickwand-dev imagemagick bundler

Postfix will make some questions, just press enter until the end.

Configure your .bashrc:

You can skip this, but this is so cool and easy… :-)

vim ~/.bashrc +46

Remove the comment in the line 46 to force color prompt.

Change your line 60 to show

[Truncated — read full article at https://gerson.barreiros.nom.br/powerful-redmine-in-aws/?format=markdown]

---

## Amazon SES – Simple Email Service
- URL: https://gerson.barreiros.nom.br/amazon-ses-simple-email-service/
- Markdown URL: https://gerson.barreiros.nom.br/amazon-ses-simple-email-service/?format=markdown
- Date: 2014-06-19
- Categories: Amazon AWS, SysAdmin

Amazon Simple Email Service (Amazon SES) is a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers. Subscription is quick and is on pay-as-you-go basis. [![Amazon SES](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/aws-ses.png)](https://aws.amazon.com/ses)

		Why Amazon SES?

 

If you don’t have your own SMTP server

Or can’t use your ISP mail server due to restrictions on sent emails

Or you can’t afford high montly fees charged by email service providers

What do you get with Amazon SES?

You send bulk emails at an insanely low price, yet with no loss of quality in terms of deliverability. Compared to other ESP (email service providers), Amazon SES is very cheap — just $1 per 10 000 messages.

You ensure a high deliverablity rate — your emails will pass SPF and Sender ID policy checks enforced by many ISPs and DKIM-sign.

You don’t care about feedback loops — Amazon SES will send you an email once someone of your recipients reports your message as spam so you can take the recipient off your list.

To use, you need to select one region where it works, then request production access, to send more than 2000 emails/24h and to send emails to not verified addresses.

You will need to verify the email account that will send emails through ses or the entire domain. If you use Route53 with your domain, amazon will verify your domain and add what it need to be added to your DNS automatically, if not, the service will help you to do that.

You will need an new IAM user to send emails, it will be created you just need to name it and get the secret access key.

The address, port and other settings you can see in SMTP Settings in Amazon SES console.

---

## How to use different user and group for just one Virtual Host in Apache
- URL: https://gerson.barreiros.nom.br/use-different-user-group-just-one-virtual-host-apache/
- Markdown URL: https://gerson.barreiros.nom.br/use-different-user-group-just-one-virtual-host-apache/?format=markdown
- Date: 2014-06-13
- Categories: SysAdmin, Ubuntu

[![apache](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/apache.png)](https://httpd.apache.org)With the mpm-itk that is a multi-processing module (MPM) you can run each virtualhost with it’s own user id and group id. This is basically used to make a shared hosting secured, since you don’t have to make all virtualhosts folders readeable by apache user.

mpm-itk is based on the traditional prefork MPM, which means it’s non-threaded; in short, this means you can run non-thread-aware code (like many PHP extensions) without problems.

```
sudo apt-get install libapache2-mpm-itk
```

How the virtual host should be configured:

```

  ServerName example.com
  DocumentRoot /path/to/web/root
  AssignUserId vhost-user vhost-group

```

It is good to change website root to be owned by the user and the group set to the vhost, change it with

```
sudo chown -R vhost-user:vhost-group /path/to/webroot
```

Take care with this command, this will change all owner and group of your files in the specified path.
And finally start Apache

```
sudo service apache2 restart
```

Source: [IT Solution](http://itsol.biz/apache-virtual-hosts-with-different-users-centos-6-2-and-apache-2-2/)

---

## How to fix "Can't locate Search/Xapian.pm in @INC"
- URL: https://gerson.barreiros.nom.br/how-to-fix-cant-locate-search-xapian-pm-in-inc/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-fix-cant-locate-search-xapian-pm-in-inc/?format=markdown
- Date: 2014-06-12
- Categories: SysAdmin, Ubuntu

[![perl](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/perl.png)](https://www.perl.org)Error: Can't locate Search/Xapian.pm in @INC (you may need to install the Search::Xapian module) (@INC contains: /path/to/something /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at (eval 143) line 2. BEGIN failed--compilation aborted at (eval 143) line 2.

To fix this, in ubuntu 14.04, just type:

```
sudo apt-get install libsearch-xapian-perl
```

---

## How to fix "Can't locate Sort/Naturally.pm in @INC"
- URL: https://gerson.barreiros.nom.br/how-to-fix-cant-locate-sort-naturally-pm-in-inc/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-fix-cant-locate-sort-naturally-pm-in-inc/?format=markdown
- Date: 2014-06-10
- Categories: SysAdmin, Ubuntu

[![perl](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/perl.png)](https://www.perl.org)Can't locate Sort/Naturally.pm in @INC (you may need to install the Sort::Naturally module) (@INC contains: /path/to/something /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at (eval 145) line 2.
BEGIN failed--compilation aborted at (eval 145) line 2.

To fix this, in ubuntu 14.04, just type:

```
sudo apt-get install libsort-naturally-perl
```

---

## How to disable apache logs
- URL: https://gerson.barreiros.nom.br/how-to-disable-apache-logs/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-disable-apache-logs/?format=markdown
- Date: 2014-06-10
- Categories: SysAdmin, Ubuntu

[![apache](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/apache.png)](https://httpd.apache.org)To disable apache logs (access and error log) to avoid excessive writes on local server just open your /etc/apache2/apache2.conf file and change the following two configurations:

Change the ErrorLog to:

ErrorLog /dev/null

Now, open /etc/apache2/conf.d/other-vhosts-access-log and comment the following line

#CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

In addition, you might have to change these files:

/etc/apache2/sites-available/default-ssl

/etc/apache2/sites-available/default

and change the ErrorLog and comment out the CustomLog:

ErrorLog /dev/null

#CustomLog ${APACHE_LOG_DIR}/access.log combined

If you have more VirtualHosts, you need to make the same configuration for them.

Source; [lleess](http://www.lleess.com/2013/07/how-to-easily-disable-log-in-apache.html)

---

## Delete ElasticBeanstalk bucket
- URL: https://gerson.barreiros.nom.br/delete-elasticbeanstalk-bucket/
- Markdown URL: https://gerson.barreiros.nom.br/delete-elasticbeanstalk-bucket/?format=markdown
- Date: 2014-06-06
- Categories: Amazon AWS, SysAdmin

If you can’t delete Elastic Beanstalk created bucket, first remove all files inside the bucket then remove de bucket policy.

	Go to the bucket’s policy (bucket –> properties –> permissions –> edit bucket policy)

	Save the change to the Bucket Policy.

	Now right click on the bucket and press delete.

---

## AWS t1.micro 100% CPU
- URL: https://gerson.barreiros.nom.br/aws-t1-micro-100-cpu/
- Markdown URL: https://gerson.barreiros.nom.br/aws-t1-micro-100-cpu/?format=markdown
- Date: 2014-06-03
- Categories: Amazon AWS, SysAdmin

Sometimes EC2 CloudWatch monitoring shows 100% CPU usage but when you ssh to your instance and try to see it with ‘top’ you can’t understand what is happening. Probably, Amazon is “borrowing” some of your CPU cycles to give to someone else who needs it – this is standard practice for a virtualised environment where physical server resources like RAM usage and CPU cycles are often hugely over-committed.

![slow](https://gerson.barreiros.nom.br/wp-content/uploads/2021/09/slow.png)To check for CPU steal, run `top` and take a look for the `%st` value. If this value is anything other than zero, it means your VM’s CPU cycles are being “borrowed”.

More: [Understanding CPU Steal Time](http://blog.scoutapp.com/articles/2013/07/25/understanding-cpu-steal-time-when-should-you-be-worried)

---

## Recovering a Lost Amazon EC2 SSH Key
- URL: https://gerson.barreiros.nom.br/recovering-a-lost-amazon-ec2-ssh-key/
- Markdown URL: https://gerson.barreiros.nom.br/recovering-a-lost-amazon-ec2-ssh-key/?format=markdown
- Date: 2014-06-01
- Categories: Amazon AWS, SysAdmin

[![amazon-ec2](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/ec2.png)](https://aws.amazon.com/ec2)In case you lose your Amazon EC2 SSH Key, and can’t login in your instance. This isn’t a big problem if your instance is EBS based and you use an Elastic IP.

1. Upload your new SSH Key, or use one made by AWS

2. Make an AMI of your instance

3. Launch a new machine from your AMI, select the new SSH Key

4. Log in your machine with default user (ubuntu, ec2-user, depends on your original AMI image)

5. Change the Elastic IP to the new machine

6. Turn of the old machine and terminate it.

---

## RDS Instance Sizes, maximum concurrent connections
- URL: https://gerson.barreiros.nom.br/rds-instance-sizes-maximum-concurrent-connections/
- Markdown URL: https://gerson.barreiros.nom.br/rds-instance-sizes-maximum-concurrent-connections/?format=markdown
- Date: 2014-05-31
- Categories: Amazon AWS, SysAdmin

RDS Class max_connections

t1.micro 34
m1.small 125
m1.medium 296
m1.large 623
m1.xlarge 1263
m2.xlarge 1441
m2.2xlarge 2900
m2.4xlarge 5816

															![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/rds.png)

---

## How to waste less money with AWS
- URL: https://gerson.barreiros.nom.br/how-to-waste-less-money-with-aws/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-waste-less-money-with-aws/?format=markdown
- Date: 2014-05-02
- Categories: Amazon AWS, SysAdmin

First of all, you need to carefully select the region where you are going to stablish your servers.

US-EAST / US-WEST-2 are the cheaper regions by the time that i wrote.

You can check the prices per regions on the links at the end of this post.

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/aws-1.png)

Using AWS for almost a year in free tier, i did not paid attention to [purchasing options of instances](https://aws.amazon.com/ec2/purchasing-options/).

---

## How to change timezone in ubuntu
- URL: https://gerson.barreiros.nom.br/how-to-change-timezone-in-ubuntu/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-change-timezone-in-ubuntu/?format=markdown
- Date: 2014-05-02
- Categories: SysAdmin, Ubuntu

![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/timezone-ubuntu.png)
	To change timezone in ubuntu, just use that in terminal:

	sudo dpkg-reconfigure tzdata

---

## How to survive with AWS EC2 T1.Micro instance
- URL: https://gerson.barreiros.nom.br/how-to-survive-with-aws-ec2-t1-micro-instance/
- Markdown URL: https://gerson.barreiros.nom.br/how-to-survive-with-aws-ec2-t1-micro-instance/?format=markdown
- Date: 2014-05-01
- Categories: Amazon AWS, SysAdmin, Ubuntu

![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/05/ec2.png)
		With my t1.micro, i can host my personal redmine, git and blog. But i couldn’t do that with default settings.

I have used swap on file to it and here is how you can do it:

Copy & paste the code below:

```
sudo su -c '

dd if=/dev/zero of=/var/swapfile bs=4096 count=524288
chown root:root /var/swapfile
chmod 0600 /var/swapfile
mkswap /var/swapfile
swapon /var/swapfile
echo "/var/swapfile none swap sw 0 0" >> /etc/fstab
'

```
To disable you can use:

```
sudo swapoff -v /var/swapfile
sudo rm /var/swapfile
sudo sed -i '/swapfile/d' /etc/fstab

```
 

---

## Zabbix
- URL: https://gerson.barreiros.nom.br/zabbix/
- Markdown URL: https://gerson.barreiros.nom.br/zabbix/?format=markdown
- Date: 2014-02-09
- Categories: Tips

![](https://gerson.barreiros.nom.br/wp-content/uploads/2014/02/zabbix_logo_313x82.png)
		Very cool tool for sysadmins! Check it out! :-) [http://www.zabbix.com/](http://www.zabbix.com/)

---

## Android Virtual Device (aka AVD) tunning
- URL: https://gerson.barreiros.nom.br/android-virtual-device-aka-avd-tunning/
- Markdown URL: https://gerson.barreiros.nom.br/android-virtual-device-aka-avd-tunning/?format=markdown
- Date: 2013-12-05
- Categories: Android

![](https://gerson.barreiros.nom.br/wp-content/uploads/2013/12/androidplain-1324760521354886405_512.png)
			In order to make the Android emulator run faster and be more responsive, you can configure it to take advantage of hardware acceleration, using a combination of configuration options, specific Android system images and hardware drivers…

	My AVD API 18 config have intel processor, 768 RAM + 128MB VM Heap + Host GPU + Intel HAXM

 My AVD API 10 config have intel processor, 768 RAM + 128MB VM Heap + Intel HAXM

---

## CLI Database optimization
- URL: https://gerson.barreiros.nom.br/cli-database-optimization/
- Markdown URL: https://gerson.barreiros.nom.br/cli-database-optimization/?format=markdown
- Date: 2013-11-27
- Categories: Tips

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/database75-131988545489512522_512.png)
		MariaDB & MySQL:

```
sudo apt-get install mysql-client
```

```
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --check --all-databases
```

```
mysqlcheck -h yourdatabasehost -u root -p --auto-repair --optimize --all-databases
```

PostgreSQL:

```
vacuumdb -afvz -h yourdatabasehost -U postgres
```

```
reindexdb -a -h yourdatabasehost -U postgres
```

```
 
```

```
*updated* November, 04, 2021
Docker example:
docker exec -it postgres-server vacuumdb -afvz -U postgres

```

---

## Amazon Web Services – Free Tier
- URL: https://gerson.barreiros.nom.br/amazon-web-services-free-tier/
- Markdown URL: https://gerson.barreiros.nom.br/amazon-web-services-free-tier/?format=markdown
- Date: 2013-11-23
- Categories: Amazon AWS, SysAdmin

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/aws-1.png)
			How to get started with AWS free?

 Just go to [http://aws.amazon.com/free/](http://aws.amazon.com/free/) and make your account.

 Credicard will be needed even for a free account.

	What can be done with the free account?

 It’s up to you! If you are going to make a light traffic website free tier can handle it. :-)

	You can have up to two EC2 instances (1 Linux, 1 Windows) with 613M Ram and up to 30GB EBS Size. You can go with all your 30GB on a Linux instance it’s the best way to spend your ‘free’ resources. (Windows is memory hungry.)

	You can have up to one RDS instance (postgres, mysql, …) with 20GB of DB storage and 20GB for backups.

	You can have up to one S3 with 5GB of storage with up to 20k put and 20k get requests.

	You can have up to one Memcached server with 213MB

	And some more things (ELB, DynamoDB, SNS, CloudWatch, …)

			AMI

 It’s an system imagem, like an ubuntu iso. Or an image of your running machine.

	EC2

 Amazon EC2 (Amazon Elastic Compute Cloud) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. The AWS Free Tier includes 750hrs of Linux and Windows Micro Instances each month for one year.

	It’s your machine.

	EBS

 Amazon EBS (Amazon Elastic Block Store) provides highly available, highly reliable, predictable storage volumes that can be attached to a running Amazon EC2 instance. With the AWS Free Tier you get 30 GB of Amazon EBS, plus 2 million I/Os and 1 GB of snapshot storage.

	It’s your disk space.

	You should know that EBS is conneted to EC2 by network, local ephemeral disk are shared with other users.

	RDS

 Amazon RDS (Amazon Relational Database Service) makes it easy to set up, operate, and scale relational databases in the cloud. Amazon RDS supports MySQL, Oracle and Microsoft SQL Server database engines. The AWS Free Tier includes 750 hours of Amazon RDS – enough hours to run a DB Instance continuously each month.

	It’s your database server, it’s better to use one RDS than install mysql or postgresql inside your EC2. Because here you get automatic update, 20GB more space in the free tier and it’s easier to maintain scalability.

	S3

Amazon S3 (Amazon Simple Storage Service) provides a simple web services interface that can be used to store and retrieve any amount of data, at any time, from anywhere on the web. It gives any developer access to the same highly scalable, reliable, secure, inexpensive infrastructure that Amazon uses to run its own web sites.

	It’s where you can store your static files.

	ElastiCache

 Amazon ElastiCache makes it easy to set up, operate, and scale in-memory caches in the cloud. Amazon ElastiCache supports Memcached, a widely adopted caching protocol. The AWS Free Tier includes 750 hours of Amazon ElastiCache – enough hours to run a Cache Node continuously each month.

	It’s your memcached server.

	ELB

 Amazon Elastic Load Balancing distributes incoming application traffic across multiple Amazon EC2 instances, providing greater fault tolerance and scalability. The AWS Free Tier includes 750 hours of load balancing and 15 GB of data processed.

	I never used this, seems good when you have one linux and one windows EC2.

	DynamoDB

 Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. With the AWS Free Tier you get 100 MB of storage, 5 units of write capacity, and 10 units of read capacity for Amazon DynamoDB.

	I never used this.

	SNS

 Amazon SNS (Amazon Simple Notification Service) is a web service that makes it easy to set up, operate, and send notifications from the cloud. It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications.



[Truncated — read full article at https://gerson.barreiros.nom.br/amazon-web-services-free-tier/?format=markdown]

---

## Check you website performance
- URL: https://gerson.barreiros.nom.br/check-you-website-performance/
- Markdown URL: https://gerson.barreiros.nom.br/check-you-website-performance/?format=markdown
- Date: 2013-11-23
- Categories: Tips

![](https://gerson.barreiros.nom.br/wp-content/uploads/2013/11/connectionmagnifierglasssearchwebwebsitezoomicon-1320186022946989367_512.png)
		[WebPageTest](http://www.webpagetest.org/), [GTmetrix](http://gtmetrix.com/), [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) and [Website Grader](https://website.grader.com/) can test your website and your webserver and helps you to see if you are using optimal configurations!

---

## GNU/Linux cli image optimizer
- URL: https://gerson.barreiros.nom.br/gnu-linux-cli-image-optimizer/
- Markdown URL: https://gerson.barreiros.nom.br/gnu-linux-cli-image-optimizer/?format=markdown
- Date: 2013-08-31
- Categories: Tips

![](https://gerson.barreiros.nom.br/wp-content/uploads/2021/08/compress-jpg-lossy-images-command-line-linux-300x139-1.png)
		There are some benefit from lossless recompression utilizing [optipng](http://optipng.sourceforge.net/) for PNGs, [gifsicle](https://www.lcdf.org/gifsicle/) for GIFs and [jpegoptim](https://www.kokkonen.net/tjko/projects.html) for JPGs. Optimized graphics transfer faster and provide a faster perceived response for clients. The following example will recursively optimize (without any loss of quality) all the graphics and image files on a server with the above commands installed and available.

ubuntu:

```
sudo apt-get install optipng gifsicle jpegoptim imagemagick
```
Then execute this lines where you want to optimize your files. Remember to use the same owner user of those images.

```
find . -iname *.png -exec optipng -o7 --strip all {} ;
find . -iname *.gif -exec gifsicle -O2 -b {} ;
find . -iname *.jpg -exec jpegoptim --strip-all --max=85 {} ;
find . -iname *.jpg -exec convert -interlace line -quality 80 {} {} ;
```
For WordPress, you can install [EWWW Image Optimizer](http://wordpress.org/plugins/ewww-image-optimizer) or [WP Smush.it](http://wordpress.org/plugins/wp-smushit)

Source: [Moodle](https://docs.moodle.org/30/en/Performance_recommendations#Moodle_Image_Optimization)

---

