Far Cry 3 fechando no Windows 10

Far Cry 3 fechando no Windows 10

Blog Miscellaneous

Boa noite pessoal,

Se você também está se batendo pra descobrir porque o seu Far Cry 3 está fechando do nada no Windows 8/8.1 e 10, saiba que basta desativar o serviço TabletInputService (Touch Keyboard and Handwriting Panel Service) lá no services.msc e jogar normalmente.

Caso não tenha encontrado o mesmo, é esse na imagem abaixo:

Dump de triggers, functions e procedures no MySQL

Dump de triggers, functions e procedures no MySQL

Databases

E aí pessoal,

Essa semana me deparei com um problema que rolou durante uma virada de migração de dados de um cliente novo aqui na empresa. O que aconteceu e que realmente eu acho um pé no saco é o fato do MySQL não exportar alguns caras que eu julgo bem importante, no caso as triggers, functions e procedures por padrão no momento do dump (mysqldump).

O nosso migrador por ventura esqueceu do parâmetro –routines depois de mergir as bases de dados, então quando o pessoal foi usar a aplicação logo pipocou uma exception dando falta de uma função para formatar telefones lá num relatório.

Para resolver esse caso para o cliente seguir com a sua vida, eu acabei fazendo um dump do nosso snapshot de referência:

O arquivo out.sql contém apenas o create de todas as triggers, functions e procedures que há na base de dados informada, porém fico atento a um detalhe, ele não adiciona nenhum comando de DROP, então vale a pena prestar atenção na execução do script para ver se tudo ficou correto.

Abraços.

How to use SFTP with non standard SSH port

How to use SFTP with non standard SSH port

Blog

Hi there,

With you’re getting problems trying to open a SFTP connection over a non standard SSH port, such as 220, you can use -o args to pass port number, like this:

In -o argument, you can group all extra parameters for connection. If you want, you can see docs at:

http://linux.die.net/man/1/sftp

How to fix black map screen in Far Cry 4

How to fix black map screen in Far Cry 4

Blog Miscellaneous

If you are getting a black screen when you go to “Map” tab, you’ll need remove two files from your game folder. First go to the game folder then go to “data_win32”.

At this folder you’ll see two files named “patch.dat” and “patch.fat”. Now you just need remove or move those files. I prefer add “_backup” suffix to them. Finally you’ll have this:

print_027

Enjoy the game :)

Sorting folders by size

Sorting folders by size

Blog Linux

To know about used space of each partition, we usually use df command. See example below:

And we get a result like this:

In some cases, we’ll add sudo before command to list partitions mounted by others users.

When we need to know about the size of each folder, linux provide us other special program called du.

Such as other programs, du has a lot of arguments and its can combined with other programs like sort.

Now, to get some folders sorted by size, we can send ‘du -h’ output to sort program:

All folders and sub folders will be printed sorted by their sizes. If you limit by only first depth, you can use –max-depth arg.

You’ll get a output like:

:)

Never forget to use aliases in your SQL queries

Never forget to use aliases in your SQL queries

Blog Databases

Newest frameworks does all hard work for us, I known a lot of programmers, most commonly Java developers, that don’t know anything about SQL, they only know about what can do with their preferred persistence framework. EclipseLink, Hibernate and others, have a solid implementations to the most known databases. These implementations always use columns and tables aliases due framework mapping.

When we are working with reports using SQL, and not Java objects, is our responsibility to know about SQL ANSI and database specifics, like PostgreSQL schemas, PSQL on Oracle, etc. It’s in this time that many developers fall down. Generally they only know to write something like that:

Don’t be like those guys!

The query below doesn’t have problems, except if ‘bar’ is a giant table with a lot of row (millions or billions). But, the problem is when we need to join many tables, ambiguous columns are the first problem, followed by wrong columns on our select.

In the query above, is so easy to identify possible errors:

  1. ‘id’ can be a primary key on product table and in category too;
  2. ‘description’ follows the same principle, where is it from?

When you name you tables, you don’t have these headaches.

Another important point is about database scope, like on many programming languages, scopes delimit variables’ visibility. Sometimes, when you have sub queries, you’ll pay attention to it.

Sometimes MySQL can run correctly, another one, it cannot, its just lose internally and doesn’t match the correct ‘id’ fields. One more time, aliases can save them:

Follow these principles even when you have more than one nested sub query.

Believe, aliases can save you from a tons of problems.

Setting static IP address and DNS nameserver to network interfaces

Setting static IP address and DNS nameserver to network interfaces

Blog Linux

If you’re installing an Ubuntu server, and you need set to it a static IP address and some nameservers, you can use the power of bash for it :). To set a static address for an interface, eth0 for instance, you can do this:

And put in this file the lines as below:

Pay attention for two last lines, those lines will be up your interface using those DNS nameservers. With it you don’t need to set a nameservers on /etc/resolv.conf, once on Ubuntu’s boot you erase all your modifications on it.

Comparing to CentOS, the boot process doesn’t replace dns-nameservers of /etc/resolv.conf, particularly I like it, I don’t see no reasons to Ubuntu clean this file.