Sérgio Henriques

About Me

Here are some things that you should know about me.

Sérgio Henriques

Software Engineer

My name is Sérgio Henriques and I am a Software Engineer. I work mainly on designing and building web-based applications that have a strong database content.

I design and develop web/mobile applications mainly using PHP or Microsoft technologies on the backend and various JavaScript/Html libraries at the front end. I have strong technical skills around MySQL databases, including Microsoft's database access technology, Entity Framework. I have equally strong know-how on building the web front end using Microsoft's ASP.NET MVC and JavaScript libraries.

Blog

Notebook of my daily problems solutions

Limpar SPAM do Maildir

Basicamente não conseguia aceder a algumas pastas numa conta de email a partir de qualquer cliente. Uma vez que o formato utilizado era Maildir pude aceder diretamente às pastas da conta e remover as mensagens manualmente. grep -l -r ‘SPAM’ cur | xargs rm Para contar o numero de ficheiros dentro da pasta basta utilizar […]

Lets Encrypt: comandos certbot

Para gerar certificados uso este $ sudo /path/to/certbot-auto –apache certonly É possível consultar a lista de certificados existentes $ sudo /path/to/certbot-auto certificates Para eliminar um certificado que já expirou (por ex. para um domínio que já não é utilizado) $ sudo /path/to/certbot-auto delete –cert-name MyDomain

Upgrade XAMPP in Windows

I had to write this article cause I couldn’t find any complete solution to help people out with updating XAMPP in Windows. Well, finally here is a easy to understand, step by step guide to upgrade XAMPP that actually works. Kudos! SOME MAJOR CHANGES! If you are updating XAMPP after a long time like me than be ready for some major changes. XAMPP no longer […]

Parse apache vhosts file

So, I wanted to parse the apache config file so I could get the ServerName and the DocumentRoot of each VirtualHost. awk ‘/^<VirtualHost*/,/^<\/VirtualHost>/{if(/^<\/VirtualHost>/)p=1;if(/ServerName|DocumentRoot|## User/)out = out (out?OFS:””) (/User/?$3:$2)}p{print out;p=0;out=””}’ vhosts.conf The command will output the info in the format: ServerName DocumentRoot or opposite depending on the order in which they appear on the VirtualHost   […]

Change sendmail queue

To actually change it, modify the /etc/sysconfig/sendmail file. It’ll look something like this: DAEMON=yes QUEUE=1h Change the QUEUE unit to suit your preferences. QUEUE=5m

Forcing queue send on individual email message

You can flush the message with: sendmail -qIyourqueueID -oTnow The “I” flag to the -q flag specifies which queue ID to use. The -oTnow flag sets the queue timeout to “now”. Note sendmail will still try to deliver the message once when you do this.