RSS

  • YouTube
  • LinkedIn
  • Google

Using Notepad++ to remove accents

Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today I share a tip to facilitate the replacement of accented characters using only Notepad++ and your HTML Tag Plugin.

Let’s do it!

First of all, we must have HTML Tag Plugin installed. If you already have it, jump to step 4.

  1. Open Notepad++ and look for Plugins in Main Menu.
    Notepad Plugins Menu Item
  1. If HTML Tag is absent, open Plugin Manager->Show Plugin Manager and find HTML Tag Plugin on the list.
    HTML Tag Plugin on Notepad++ Plugin Manager
  2. Select the desired Plugins and hit Install button. Notepadd++ will restart to complete the install.
    Now we can translate special characters to yours HTML entities. We need to do it first to remove accents from our text.
  3. Put your text on the window and make Select All with Ctrl + A or Edit -> Select All in Main Menu.
  4. Open Plugins->HTML Tag->Encode Entities in Main Menu or CTRL + E.
    Now, all special characters will be in html entities.
    Notepad++ With Special Characters Encoded in HTML
  5. Open the Replace Form (CTRL + H or Search->Replace) and fill the Find What field with
    &([a-zA-Z])(:?grave|acute|circ|uml|aring|cedil|slash|tilde); and Replace with field with $1
    Select Regular Expression in Search Mode and hit Replace All button.
    Notepad++ Replace Form
    The text will be replaced with no accents characters, but all other special chars will be in HTML entity.
    Notepad++ HTML replaced text
  6. Now we can return all other chars to your originals but is better to use your text in UTF-8 encoding. Go to Encoding Menu and change text encoding if is not Utf-8. You can return to another encoding after this step.
    To decode HTML use CTRL + Shift + E or Plugins->HTML Tag->Decode Entities.
    Notepad++ Final Text convertion

I Hope that help someone.

 


Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Relembrando o passado…;

Share in your social media
  • 6
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Stirring in my personal files I found this message I wrote shortly after the end of presidential elections of 2014. I don't know why it was not published on my personal blog, but remember posted on Facebook. As I am no longer using Facebook will [Re]publish the text in full.

Principais Candidatos Eleições 2014

Main Election Candidates 2014

 ;

I think it's funny that some people use Facebook to try to convince me of something subjective like she's a lot smarter than the other (and that I, já que isso aqui “;lemos”; alone and not in Group) and do not accept dissent. Some, After 2 or 3 comentários contrários apelam para “;THIS is my FB ACCOUNT, POSTO O QUE EU QUISER”;.
Será que nunca entenderam o que quer dizer “;GLASS HALF FULL OR HALF EMPTY?;
Everything is subjective usually don't have right or wrong choice. If a thing or situation has evidentiary facts, is no longer subjective, is concrete and in this case it's a matter of accepting or not, as a resignation that you didn't realize or your team that is well, losing the flashlight. What is subjective is reached the conclusion through personal experience and State of mind.
Talvez porque eu “;quase”; never try to convince anyone that I'm right and open up the discussion to to argue your point of view, I am outraged when I see intolerant, unbiased, arrogant and inflexible spreading their superior intelligence.
Before attempting to convince someone with arguments drawn from magazine covers, titles of articles or videos from facebook users to which the account is never confirmed, give yourself at least work to read such content under a critical Prism. The people you're going to drive can be those who read 20 books by year, several national and international newspapers in Portuguese or other[s] language[s] and can bring down your arguments in a few seconds if you are not grounded in something concrete.
I'm writing this thinking about the messages about the country's Division disseminated primarily by paulistas. When they see the Rio Grande do Sul fans sing the anthem of the RS on the national anthem at any event think absurd. Preach unity, and repudiate the separatist attitudes, but when a large part of the country doesn't follow its political ideology and the first thing that starts the defender is something that repudiates the other.

Mr post reproduction elected Colonel Tiled (PSDB) that generated controversy

Mr post reproduction elected Colonel Tiled (PSDB) that generated controversy

This selective indignation paulista is disgusting, late and evil.
I advise you that bothered to read this far and got angry with my words to read Vidas Secas, Grande Sertão Veredas and hear stories of Suassuna. Will become a much better person.


Share in your social media
  • 6
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

How to clear deferred messages from Postfix Queue

Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today I was watching the log file from Postfix (in CentOS 6.X default is /var/log/maillog) and saw a lot of messages being deferred.

and these messages did repeat from time to time.

Continue Reading >>


Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Naming files using list from 0 to Z

Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today I was coding some scripts and found a little trouble to use a defined pattern.

The pattern is to create files where the sequence starts in 0 (zero) and cannot be repeated until Z.

Example:

myfile0.ext, myfile1.ext, myfile2.ext, (...), myfile9.ext, myfileA.ext, myfileB.txt, (...), myfileZ.txt

Well, this is not a big trouble so I did use this code.

But $seq did not gave the expected value of 0 (zero) on first run. Instead, it was blank.

Debugging the variables, I saw that the while never evaluates to true. Attempting to reproduce on command line I saw that in_array($seq, $seqs); always return true. I tryed to use “”, “R” and no matter what value I used, still returning true.

So I change to use STRICT argument for in_array to true and works for ‘A’ through ‘Z’, but not for ‘0’ through ‘9’.

Damn… PHP is right, “0” is not strictly equals to 0. The Chr function return string and range('0', '9') creates an array with integer values.

So, I changed the approach to evaluate all values with STRICT, because I would like to create a nice and clean code without no other functions to be used.

This is the final code that I’m using:

How you can see, I changed the $seqs initial values from ‘0’ to your ASCII code and get back to your value that gave me an array with all values in string type.

See you!


Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

PHP Comparison Error

Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Today, I was writing a script in PHP to be used in the command line when I came across unexpected behavior (at least on my part).
The script should receive three arguments, the last of them a list containing one or more numeric codes.
Trying to validate this last argument was getting a different result than imagined.
See the code snippet that I was using:

Continue Reading >>


Compartilhe em suas mídias sociais
  •  
  •  
  •  
  •  
  •  
  •  
  •  

How to fix date / time on Centos 6.X for your timezone even in logfiles

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Today I came across a problem when using the Fail2ban that help me so much to keep my server online even under brute-force attack.

One of my filters were not barring the several attempts to authenticate to a my services although it was fine. I decided to increase the Findtime the common configuration and it began to block.

So it was time to understand why with a findtime down he couldn't spread. I began to check in detail the settings and I realized that even though I changed the time for my timezone to the official schedule of Brasilia, the logs continued to display the schedule in UTC. Suspected that it could be this and decided to change the schedule that is placed in the logs (/var/log/messages).

Bingo!

After the change, and confirm that the logs were using the same schedule that the reported in date changed the findtime to values which wanted and everything worked as expected.

Follow the recipe to change the schedule.

Timezone information are on file /etc/localtime and if he's not on what you want simply replaces him for what he wants and that is present in /usr/share/zoneinfo/. In my case, how I wish the schedule of Brasília, I used /usr/share/zoneinfo/America/Sao_Paulo.

Now just try using the date command and check the output should be something like:

Even after these changes, the logs will continue to have the time the old-fashioned way. To change this edit the file /etc/sysconfig/clock and add the following lines to also reflect your timezone.

In my case, I had to restart the server for the changes to surtissem effect but just restarting the rsyslog service already solve.

See you!.


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

How to fix LOCALE error on Debian Linux/Ubuntu

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Today I had to look at the logs to an FTP server that runs under the pure-ftp and I realized that the timetables were all in UTC .
As I needed to send part of the logs to a third party that makes use of it and are not familiar with systems, could end up taking place some misunderstanding. I decided then that should keep the logs of all the applications on Brazilian time zone.
According to the documentation of the pure-ftp it uses environment variables to determine which will be the schedule included in the logs

Continue Reading >>


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Substituir caracteres especiais em Strings Delphi

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

Today I had to modify an ancient system done in Delphi to generate files containing some information. Nestas informações há elementos que se utilizam de caracteres não Alpha-numéricos como “;:; e “;/; and behold, to my surprise I am obligated to remove them.

Procurei por uma função que substituísse caracteres como “;Ç”; para “;C”; and only found removal functions.

Then I created my that is just below.

 ;


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

jQuery.html() doesn't work in Internet Explorer

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

I recently had problems with a javascript code that uses jQuery and it worked in several browsers i.e. Chrome, o Firefox and some versions of Internet Explorer, but that stubbornly refused to work in Internet Explorer 7 and 8.
Here is the code:

After some tests I realized that wasn't a problem in the method, as in other codes it behaved as expected.
So debugging code thoroughly and the answers of the Ajax method realized a small syntax error in HTML and was just correct it and IE 7 displayed correctly the answer.
Then follows the big tip, If you have problems with the method jQuery.html(), check first of all whether the content being written in the element is an html code without errors, because the validation in IE 7/8 will not allow write HTML with errors, no matter how small it is.


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

How to –; Configure mail server

Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;

I have my own mail server using Postfix, Dovecot, SpamAssassin, ClamAV, Amavisd-new, fail2ban, postfixadmin and RoundCube under CentOS 6. X.
Although it has several recipes for how to configure this package, It took me many hours to figure out how to keep the service running correctly, each setting in main.cf and master.cf and in order to achieve in reducing the flood of spam that arrives every minute.
And anti-spam is the focus of this publication. I have suffered and still suffer with the constant attempts to use my services as a zombie or shedding of viruses, fraud and everything else you can.

Continue Reading >>


Share in your social media
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;
  •  ;