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.

Deleting files inside a zip file on Linux

Deleting files inside a zip file on Linux

Blog Linux

Sometimes when we’re working with zip files, we need to remove some files inside it to doesn’t override another files during extraction. Linux has a special app to this, we’re talking about zip.

Debian based distros like Ubuntu, Mint, etc., already have this program installed, CentOS for instance doesn’t have installed, so, to install it you will do this:

To those distros, the way to use zip app it’s the same.

Deleting specific files inside a zip file

If you want to delete one or more specific files, you can do this:

Like /bin/rm command, this app also can receive N parameters on –delete arg.

If you want to delete directories inside a zip file, it is the almost same way, but you will add “/*” at the end of string arg. Bellow you have an example of it:

Pay attention to the last parameter, “directory3/sub-folder/*”, in this case, the folder “sub-folder” will be deleted from “directory3” folder.

Be happy : )

Removing deepin-translator from DDE

Removing deepin-translator from DDE

Blog Linux

Deepin is a Chinese Ubuntu-based distro that contains a powerful and very beautiful graphical interface called DDE (deepin-desktop-environment). This interface has a lot of usual features like side control panel, custom software center, an elegant dock menu and the main reason, no critical bugs like Gnome 3 or Unity. You can read more about Deepin here.

One of this features is deepin-translator, this plugin allows for user to quickly translate any selected text putting mouse cursor hover selected text or pressing Ctrl key hover this text. If you’re a developer, sometimes this resource let your work so awful on Eclipse, SQL editors, because you are all time selecting SQL statements to copy-past between editors and deepin-translator always appears hover your selected text, and sometimes it breaks your copy-paste.

To be free of this headache, you can kill the process or remove it from your system. I prefer remove this package, because I really don’t need to translate anything, so to remove you’ll run the command bellow:

Now, feel free from this plugin : )