avatar

Andres Jaimes

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: 1sudo 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 1$ mysql -u root -p Postgres 1$ psql -h <host> -U <username> <database-name> Try the following if you don’t know the name of the available databases: 1psql -h <host> -U <username> -l Some installations add your current user to the list of allowed users to the database. In that case you can connect without specifying a username.

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 into a project. It will be difficult for the team to get acquainted with them and deliver a good quality project. Small steps are the best. Depends on the level of communication among the participants. Enforce communication among the team members.

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: 1chmod 600 ~/.my.cnf And done. We can now use it: 1mysqldump 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: 1#!/usr/bin/php 2 3<?php 4srand(2); 5 6echo rand(0,10)."\n"; 7echo rand(0,5)."\n"; 8echo rand(0,4)."\n"; 9echo rand(0,6)."\n"; Java version: 1import java.util.*; 2 3/** 4* @see https://docs.oracle.com/javase/7/docs/api/java/util/Random.html 5*/ 6public class RandomDemo { 7 public static void main( String args[] ){ 8 Random r = new Random(2); 9 System.

Common tasks when working with MySQL

How to install MySQL server in Ubuntu It’s pretty simple: 1sudo apt-get install mysql-server How to connect to MySQL using Java This is a useful and simple snippet: 1import java.sql.Connection; 2import java.sql.DriverManager; 3public class Test { 4 public static void main(String[] args) { 5 try { 6 Class.forName("com.mysql.jdbc.Driver"); 7 Connection c = DriverManager.getConnection( 8 "jdbc:mysql://localhost/?user=root&password="); 9 c.close(); 10 System.out.println("Success"); 11 } 12 catch (Exception e) { 13 e.printStackTrace(); 14 } 15 } 16} 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 1<dependency> 2 <groupId>org.