Installing Rancher on Ubuntu/Docker

On this article we are going to install a rancher server on Ubuntu. Let’s start by getting the rancher image from docker hub: sudo docker run -d --restart=always -p 8080:8080 --name=rancher-server rancher/server Go to http://ip-address:8080 and click on Add Host. It is important that you do not use a localhost address (127.0.0.1, localhost). If you do so, and you want to add your local computer as an agent, you will not be able to reach it.

From MySQL to Postgres - Useful commands

This article shows a list of basic commands on MySQL and their corresponding versions for PostgreSQL. Connecting to a database MySQL $ mysql -u root -p Postgres $ su pgsql $ psql Or using a different user: $ psql dbname If you can’t connect because you don’t know what databases are available, try any of these: psql -l psql postgres psql template1 The postgres database is a default database meant for use by users, utilities and third party applications read more.

Ideas for successful software projects

This article describes some ideas on getting a successful software development process. A successful project: Depends on the expertise of the team. Don’t try to push many new technologies to a project. It will be difficult for the team to get acquainted with them and deliver a quality project. Small steps are the best. Depends on the level of communication. Enforce communication among the team members. Even if they are working remotely.

Storing MySQL credentials on a file

MySQL allows you to store credentials in a file called ~/.my.cnf. The contents can look like this: [mysqldump] user=myuser password=mypassword We have to modify the file permissions and give read/write permissions to the owner only: chmod 600 ~/.my.cnf And done. We can now use it: mysqldump mydatabase mysqldump is going to read the credentials from that file.

Why you should not initialize a random generator with a static number

The following examples use random generated numbers initialized with a static seed. Never do it like this. Run the following examples multiple times to understand why it is important to have a good seed. PHP version: #!/usr/bin/php <?php srand(2); echo rand(0,10)."\n"; echo rand(0,5)."\n"; echo rand(0,4)."\n"; echo rand(0,6)."\n"; Java version: import java.util.*; /** * @see https://docs.oracle.com/javase/7/docs/api/java/util/Random.html */ public class RandomDemo { public static void main( String args[] ){ Random r = new Random(2); System.

Common tasks when working with MySQL

How to install MySQL server in Ubuntu It’s pretty simple: sudo apt-get install mysql-server How to connect to MySQL using Java This is a useful and simple snippet: import java.sql.Connection; import java.sql.DriverManager; public class Test { public static void main(String[] args) { try { Class.forName("com.mysql.jdbc.Driver"); Connection c = DriverManager.getConnection( "jdbc:mysql://localhost/?user=root&password="); c.close(); System.out.println("Success"); } catch (Exception e) { e.printStackTrace(); } } } How to connect to MySQL using C# Go to http://www.

Akka Actors

The Play Framework is built upon Akka actors, but does everything so that you don’t really need to use them. Despite this, actors are easy to integrate with Play, precisely because it is built on them (there is already an actor system for you to use) A few exceptions are: websockets handling (doing that using actors is a breeze) scheduling tasks for doing daily or weekly jobs Akka actors use messages to communicate between among them.

Inspirational videos

This article contains a series of curated inspirational videos from different users. “It will make you rich”. What poor people don’t know about making money

Videos from UKspreadbetting

This article contains a series of inspirational videos from user UKspreadbetting which I consider very important. Why trading forex is so difficult Is trading the road to great rewards and richness? Trade entries and exits Institutional traders versus private traders

Recommended libraries for Java

This article lists a curated list of Java libraries that I have used over the years for different projects. They are all well documented, and for most of them, plenty of examples can be found on the web. Apache Commons Email Commons Email Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify. User Guide Apache Commons StringUtils <dependency> <groupId>org.