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

My thoughts.

Listar ficheiros mais antigos

No diretório atual podemos pesquisar ficheiros criados há mais de 30 dias. $ find . -maxdepth 1 -type f -mtime +30 Também podemos apagar os ficheiros listados $ find . -maxdepth 1 -type f -mtime +30 -print | xargs /bin/rm -f $ find . -maxdepth 1 -type f -mtime +30 -print0 | xargs -0 /bin/rm […]

Send A Welcome Email For Creating Maildir

When you create a new email account and try to fetch emails from it (with POP3/IMAP) you will probably get error messages saying that the Maildir doesn’t exist. The Maildir is created automatically when the first email arrives for the new account. Therefore it’s a good idea to send a welcome email to a new […]

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   […]