Can’t Connect to MySQL Server Remotely on Ubuntu


MySQL by default will not allow incoming remote connections for security reasons. In this article we will edit the MySQL config file mysqld.cnf to allow remote connections.

Testing a Remote MySQL Connection

To test a remote MySQL connection in Linux terminal, simply replace username and hostname_or_ip with your own.

mysql -u username -h hostname_or_ip -p

Or via Command Line in Windows:

telnet 3306

If you are getting an error when trying to connect to your remote MySQL server

ERROR 2003 (HY000): Can't connect to MySQL server on '' (111)

or in Windows Telnet

Connecting To not open connection to the host, on port 3306: Connect failed

1. Edit MySQL config

You may need to comment out bind-address in the MySQL config file mysqld.cnf.

Open mysqld.cnf with nano editor.

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Press CTRL + W and search for bind-address

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address =

The above line is telling MySQL to only accept local connections. Comment out this line by adding # before it so it looks like:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address =

Restart the MySQL service for changes to take effect.

sudo service mysql restart

Now try to connect to MySQL remotely again.

2. Check Firewall

If you still can’t connect, check if there is a firewall configured on your server. The most common firewall for Ubuntu server is ufw.

Check if ufw is enabled:

sudo ufw status

If it’s enabled, you should see some rules:

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Apache Full (v6)           ALLOW       Anywhere (v6)

If MySQL is not listed, add a rule for it.

sudo ufw allow mysql

There should be a rule for MySQL:

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
3306                       ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Apache Full (v6)           ALLOW       Anywhere (v6)
3306 (v6)                  ALLOW       Anywhere (v6)

Restart the ufw service:

sudo service ufw restart

Copy from

Creating custom icon set


react-native-vector-icons supports using custom icon sets if you do not want to use the icons which come bundled with it or if you want to add your own icons. It supports Fontello and IcoMoon to create custom fonts. We used IcoMoon to convert our SVGs to a config which is readable by the library.

Setting up the framework

Install the npm module using npm or Yarn.

npm install --save react-native-vector-icons


yarn add react-native-vector-icons

Configuring your project to support custom icon sets.

We will use IcoMoon to support custom icons/fonts. Icomoon is a free and open source application which lets you convert a set of SVG icons to fonts. It is a front end only app and does not upload your icons anywhere, so there will be no privacy concerns!

The steps for the configuration are as follows:

  • Create a resources folder where we will keep our custom font file (.ttf).
  • Do react-native link react-native-vector-icons. This will set up the vector icons framework for you.

That’s it, you are done with the setup. Now we need to get the TTF file and place it in the resources/fonts folder that we just created.

How to generate .ttf fonts using IcoMoon:

  1. Open the IcoMoon application.
  2. Remove the current set (if there is one) and create a new empty set and give your preferred name (remember to give the same name everywhere).
  3. Drag and drop your SVG files onto the tool.
  4. Select the files which you want to export. Select all if you want to export all the icons.
  5. After the selection, click Generate Font. This will download a zip file to your system.
  6. The zip file will contain a selection.json file and a fonts folder containing a .ttf file. We only need these two files to use fonts in react-native.
  7. Put the font file (.ttf) in the resources/fonts folder and add the following script to the package.json:
    "rnpm": {
           "assets": [

    This script will copy the font files to both Android and iOS folders. After this, whenever we want to update the fonts, we will do react-native link react-native-vector-icons and the fonts will be copied/updated automatically to both Android and iOS projects.

  8. Put the JSON file (selection.json) in your app and create a file called CustomIcon.js. Import the selection.json in CustomIcon.js.
    import {createIconSetFromIcoMoon} from 'react-native-vector-icons';
    import icoMoonConfig from './selection.json';
    export default createIconSetFromIcoMoon(icoMoonConfig);
  9. That’s it! To use a font simply import the file as a React component and pass the icon name and size (optional) or even style.
    import CustomIcon from './components/CustomIcon.js'
    <CustomIcon name='android' /> //To use the icon
    <CustomIcon name='android' size={25} /> // To pass size
    <CustomIcon name='android' style={styles.androidIcon} /> // To pass custom tyle

Changing file names of the font file

The default name of the font file is icomoon.ttf. If you want to give it a different name, go to Preferences after step 5 and change the name there before downloading. Also, make sure that if you change the font file name, give the same name to the set as well (by default it is “Untitled Set”).

It is not recommended to change the filename of .ttf font file after the setup/native linking. The filename gets written in project.pbxproj and Info.plist and the file gets copied to android/app/src/main/assets/fonts/ once you run the link command. If you wish to change the filename, you would need to take care of changing the above 2 files as well, and removing the unused icon from the android folder which might cause problems if not done properly.

How do I add/delete icons from the font file (.ttf)

You can easily change/delete the contents of the font file. The tool only needs the selection.json file, which defines the font configuration. The steps for the same are as follows:

  1. Open IcoMoon App
  2. Upload the current selection.json file.
  3. Edit/delete the icon using the tools on top. (Adding an icon is the same as step 3 mentioned above)
  4. After the editing is complete, generate a new font file by following the steps 5 and 6 mentioned above. Once you have the new font file and the new selection.json file, place them in their appropriate locations in the app and do react-native link react-native-vector-icons.

That’s how you change the icons. Pretty neat huh?


Copy from:

View at

SSL in DigitalOcean

Goto your server and

openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr



  1.  Generate Key and CSR file for request certificate in hosting by using command
    sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ -out /etc/ssl/certs/
  2. Go to control panel which hosting provide SSL and download
  3. Now you will get 2 files are *.key and *.crt
  4. copy file domainName.key to /etc/ssl/private/
  5. copy file domainName.crt to /etc/ssl/certs/ 
  6. modify file default in sudo nano /etc/nginx/sites-available/default as bellow

server {

        listen 80 default_server;

        listen [::]:80 default_server;

        # SSL configuration


        listen 443 ssl http2 default_server;

        listen [::]:443 ssl http2 default_server;


        # Note: You should disable gzip for SSL traffic.

        # See:


        # Read up on ssl_ciphers to ensure a secure configuration.

        # See:


        # Self signed certs generated by the ssl-cert package

        # Don’t use them in a production server!


        # include snippets/snakeoil.conf;

        root /var/www/landing-page;

        # Add index.php to the list if you are using PHP

        index index.html index.htm index.nginx-debian.html;


        #ssl on;

        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;

        ssl_ciphers         “HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES”;

        ssl_certificate     /etc/ssl/certs/;

        ssl_certificate_key /etc/ssl/private/;

        location / {

                # First attempt to serve request as file, then

                # as directory, then fall back to displaying a 404.

                try_files $uri $uri/ =404;




server {

       listen         80;


       return         301 https://$server_name$request_uri;




How to Fix App “is damaged and can’t be opened. You should move it to the Trash” Error on Mac


Mac OS Sierra 10.12.x

The premise is the same as shown for Mac OS 10.9.2 through 10.11.x except that the steps to enable the “Anywhere” option are different.

If you view your security settings under System Preferences | Security & Privacy, you will see there is no Anywhere option.

To enable the “Anywhere” option, run the following command in a terminal:

sudo spctl --master-disable

If you go back to System Preferences | Security & Privacy, you will see the Anywhere option enabled. Unlock the edit option by clicking on the padlock icon at the bottom of the window to change to Anywhere option.

At this point, you should be able to install the software.

This security setting affects your whole system. To reinstate the earlier security policy, run the following after the software is installed:

sudo spctl --master-enable

and then check your security settings are as you expect.

Copy from:

Compile-time Error: control may reach end of non-void function with Xcode 10.2

Copy from:


temp solution :

add default: return "null"; between line 52 and 53,

inline const char *jsc::Value::typeof(JSContextRef ctx, const JSValueRef &value) {
    switch (JSValueGetType(ctx, value)) {
        case kJSTypeNull: return "null";
        case kJSTypeNumber: return "number";
        case kJSTypeObject: return "object";
        case kJSTypeString: return "string";
        case kJSTypeBoolean: return "boolean";
        case kJSTypeUndefined: return "undefined";
        default: return "null";

this working for me, waiting for the official solution

Android – Launcher Icon Size




I would create separate images for each one:

LDPI should be 36 x 36.

MDPI should be 48 x 48.

TVDPI should be 64 x 64.

HDPI should be 72 x 72.

XHDPI should be 96 x 96.

XXHDPI should be 144 x 144.

XXXHDPI should be 192 x 192.

Then just put each of them in the separate stalks of the drawable folder.

You are also required to give a large version of your icon when uploading your app onto the Google Play Store and this should be WEB 512 x 512. This is so large so that Google can rescale it to any size in order to advertise your app throughout the Google Play Store and not add pixelation to your logo.

Basically, all of the other icons should be in proportion to the ‘baseline’ icon, MDPI at 48 x 48.

LDPI is MDPI x 0.75.

TVDPI is MDPI x 1.33.

HDPI is MDPI x 1.5.

XHDPI is MDPI x 2.



This is all explained on the Iconography page of the Android Developers website:

copy from: