Add VS6/VB6 components to Visual Studio 2017

Nowadays in 2018, there are still many useful ActiveX components (DLLs and OCXs) that was wrote with the old (and lovely) VS6/VB6 developing environment. Unfortunately, some of those components cannot be use in the earliest versions of Visual Studio because of the DEP (Data Execution Prevention) issue.

Gladly, Microsoft add the ability to use those component in the Visual Studio 2017 easily 🙂

Here are the stages to add the ability to use VS6/VB6 ActiveX component in Visual Studio:

1) Open Visual Studio 2017
2) Click on ‘Get Tools and Features’ in the ‘Tools’ menu.
3) In the ‘Modify’ window click on the ‘Individual Components’ tab.
4) Mark the ‘VC++ 2017 version 15.7 v14.14 latest v141 tools’ option in the list.
5) Click on the ‘Modify’.
6) Wait for Visual Studio 2017 to finish the installation.
7) Open the project that you want to add the VS6/VB6 components.
8) Go to the project properties.
9) Click on the ‘Build Events’ tab.
10) Add the above command to the ‘Post Build’:

call "$(DevEnvDir)..\tools\vsdevcmd.bat"

"$(DevEnvDir)....\VC\Tools\MSVC\14.13.26128\bin\Hostx86\x86\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"
Get Tools and Features in Visual Studio 2017
Get Tools and Features in Visual Studio 2017

That’s It 🙂

From now on you can use the VS6/VB6 components in your Visual Studio 2017 projects.

Remarks

  • This demonstrate use Visual Studio C# project, you can also do the same with Visual Basic or any other desktop language of the Visual Studio 2017.
  • You can change the command $(DevEnvDir) in the Build Events to the location of the Visual Studio 2017 in your hard drive.
  • CoreUI modal not working – Fix CoreUI modal

    I’ve faced a problem when displaying the modal of coreui when calling a js function, such as:

    $('#modal-create-token').modal('show');
    

    Well, after searching for a solution I’ve founded that adding CSS style as above will fix the probelm, and the modal of the coreui will be display:

    .fade {
      opacity: 0;
      -webkit-transition: opacity 0.15s linear;
      -moz-transition: opacity 0.15s linear;
      -o-transition: opacity 0.15s linear;
      transition: opacity 0.15s linear;
    }
    
    .fade.in {
      opacity: 1;
    }
    
    .fade.out {
      opacity: 0;
    }
    

    Also, you may need to add to the modal tag ‘data-backdrop=”false”‘, for example:

    <div class="modal fade" id="modal-create-token" tabindex="-1" role="dialog" data-backdrop="false">
    

    🙂

    Check if a domain name is IDN with PHP

    In some case you may need to check if a domain name is IDN (Internationalized domain name) or not.

    This function can do it for you (from PHP 5.3+):

    //Check if a domain name is IDN or not.
    //Return true of the $name is IDN or false of not.
    public function is_idn($name)
    {
        if(idn_to_utf8($name) != $name)
            return true;
    
        return false;
    }
    

    Then you can call the function ‘is_idn’ as above:

    is_idn('xn--5dbhaeldc2j.com');
    

    Add VUE syntax highlighting support to Sublime Text 3

    While the Sublime Text 3 editor can handle with the common web development languages (HTML / JS / CSS / PHP / etc), in order to add a syntax highlighting support for VUE, you may need to add a plugin to the Sublime Text 3 editor.

    vue-syntax-highlight

    The stages to highlighting VUE in Sublime Text 3 are:

    1) Open the VUE file in Sublime Text 3

    2) Go to menu view->show console

    3) Add this to the console:

    import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaeeebe013ee18cced0ef93d5f746d80ef60' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

    4) Click on Enter. Wait for the installation to finish, this may take a few seconds.

    5) Press on CTRL+Shift+p, a new select box should be open.

    6) Search for ‘Package Control :: Install Package’ then search for ‘vue-syntax-highlight’

    7) Reopen the Sublime Text 3.

    That’s it. From now on your VUE script will be highlight in Sublime Text 3

    Install Sublime Text 3 on Ubuntu / Debian

    Sublime text is my favorite code editor. This editor can handle easily with HTML / Java Script / CSS / PHP and any other web development language.

    While installing the Sublime Text 3 on windows is easy, on linux you can install it using the above command lines:

    # Download the Sublime Text 3
    wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3083_amd64.deb
    
    # Install it
    dpkg -i sublime-text_build-3083_amd64.deb
    

    That’s it!

    Now, in order to open the Sub Lime Text 3 run:

    subl
    

    If you want to open a specific document or file:

    subl 'the_path_to_the_file_name.php'
    

    Change Webmin Password Ubuntu / Debian

    After the installation of Webmin was finished, you may want to enter to the Webmin tool front page with the default user name (root in many cases) and your password. If you don’t know the password or Webmin not allows you to enter to your account, you can change the password with command prompt.

    This command should work on Linux Ubuntu or Linux Debian.

    # set / change the default pass of webmin using the command line.
    # change the "your_password" with your password:
    /usr/share/webmin/changepass.pl /etc/webmin root "your_password"

    Install Webmin – Bash Script

    What is ‘Webmin’?
    Wikipedia said that Webmin is:

    Webmin is a web-based system configuration tool for Unix-like systems, although recent versions can also be installed and run on Windows. With it, it is possible to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify and control open source apps, such as the Apache HTTP Server, PHP or MySQL.

     

    Install Webmin (Bash Script)
    Webmin allows you to manage your server (VPS, Amazon EC2, Google GCE, etc..) from the web browser, easily and effective.

    Here is a bash script that will install webmin under Debian 7:

    #!/bin/bash
    
    # This bash script will install webmin on Debian
    # 
    # Do not forget to make this bash script executable
    # chmod +x install-lamp.sh
    
    #!/bin/bash
    if [ "$EUID" -ne 0 ]
      then echo "Please run as root"
      exit
    fi
    
    # cd /
    
    wget http://prdownloads.sourceforge.net/webadmin/webmin_1.840_all.deb
    
    dpkg --install webmin_1.840_all.deb
    
    apt-get -f install
    
    

    After the installation, open the browser and go to your web server ip or domain using the port 10000, for instance:

    https://server_ip.com:10000 or https://server_domain.com:10000
    

    * If you cannot enter to the main page of the Webmin, make sure to open the port 10000 in your server / service.

    In most of the cases the user name is root and the password is the password of the user.

    In order to change the password from the command line, go to this post:
    https://www.wiserbit.com/bash-scripts/change-webmin-password-ubuntu-debian.html

    install LAMP+ (Nginx, PHP7, MySQL, ImageMagick, curl, zip, php-mbstring, GIT, Composer)

    What is ‘LAMP’?
    Wikipedia said that LAMP is:

    LAMP is an archetypal model of web service stacks, named as an acronym of the names of its original four open-source components: the Linux operating system, the Apache HTTP Server, the MySQL relational database management system (RDBMS), and the PHP programming language. The LAMP components are largely interchangeable and not limited to the original selection. As a solution stack, LAMP is suitable for building dynamic web sites and web applications.

     

    Install LAMP+ on Linux Debian
    Whether you run a VPS, dedicated server, or any cloud solution (Amazon EC2, Google GCE) on linux, you may need to install some programs in order to start developing things.

    This LAMP bash installation include some extra programs that can make life easier with Debian, and will allows you run Laravel 5.2 / 5.3 / 5.4 / 5.5 without any problem.

    #!/bin/bash
    
    # This bash script will install LAMP+ (Nginx, PHP7, MySQL, ImageMagick, curl, zip, php-mbstring, GIT, Composer) to run Laravel 5.4 on Debian
    # 
    # Do not forget to make this bash script executable
    # chmod +x install-lamp.sh
    
    #!/bin/bash
    if [ "$EUID" -ne 0 ]
      then echo "Please run as root"
      exit
    fi
    
    export DEBIAN_FRONTEND=noninteractive
    
    # Update Package List
    apt-get update
    
    # Update System Packages
    #apt-get -y upgrade
    
    # Force Locale
    echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale
    locale-gen en_US.UTF-8
    
    
    echo "deb http://packages.dotdeb.org jessie all" | tee -a /etc/apt/sources.list.d/dotdeb.list
    echo "deb-src http://packages.dotdeb.org jessie all" | tee -a /etc/apt/sources.list.d/dotdeb.list
    wget -qO - http://www.dotdeb.org/dotdeb.gpg | apt-key add -
    apt-get update -y
    
    #nginx
    apt-get install nginx -y
    service nginx reload
    
    #mysql 5.7 (with json type)
    wget http://dev.mysql.com/get/mysql-apt-config_0.8.0-1_all.deb
    sudo dpkg -i mysql-apt-config_0.8.0-1_all.deb
    apt-key adv --keyserver pgp.mit.edu --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
    apt-get update
    apt-get install mysql-server
    
    mysql_secure_installation
    
    cd ~
    
    #php7
    apt-get install php7.0-cli php7.0-curl php7.0-dev php7.0-fpm php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-gd php7.0-intl php7.0-xsl
    
    apt-get install php-fpm php-mysql
    systemctl restart php7.0-fpm -y
    
    #nano /etc/php/7.0/fpm/php.ini
    cd ~
    
    #curl
    apt-get install curl -y
    cd ~
    
    #zip
    apt-get install zip -y
    
    # zip for PHP (use ZipArchive;)
    sudo apt-get -f install
    apt-get install php7.0-zip
    
    #then add to the end of the ini file: zip.so
    echo extension=zip.so >> /etc/php/7.0/cli/php.ini
    echo extension=zip.so >> /etc/php/7.0/fpm/php.ini
    cd ~
    
    #php-mbstring
    apt-get install php-mbstring -y
    #then add to the end of the ini file: mbstring.so
    echo extension=mbstring.so >> /etc/php/7.0/cli/php.ini
    echo extension=mbstring.so >> /etc/php/7.0/fpm/php.ini
    cd ~
    
    
    #imagemagick
    apt-get install pkg-config libmagickwand-dev -y
    cd /tmp
    wget https://pecl.php.net/get/imagick-3.4.0.tgz
    tar xvzf imagick-3.4.0.tgz
    cd imagick-3.4.0
    phpize
    ./configure
    make install
    echo extension=imagick.so >> /etc/php/7.0/cli/php.ini
    echo extension=imagick.so >> /etc/php/7.0/fpm/php.ini
    service php7.0-fpm restart
    service nginx restart
    rm -rf /tmp/imagick-3.4.0*
    
    cd ~
    
    
    #git
    apt-get install git-core -y
    cd ~
    
    curl -sS https://getcomposer.org/installer | php
    
    mv composer.phar /usr/local/bin/composer
    cd ~
    
    

    Install Sudo On Linux Debian (jessie)

    What is ‘sudo’?
    Wikipedia said that sudo is:

    sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for “superuser do” as the older versions of sudo were designed to run commands only as the superuser. However, the later versions added support for running commands not only as the superuser but also as other (restricted) users, and thus it is also commonly expanded as “substitute user do”.Although the latter case reflects its current functionality more accurately, sudo is still often called “superuser do” since it is so often used for administrative tasks.”

     

    This bash script can help you install the sudo command under Linux Debian (jessie):

    #!/bin/bash
    
    # This bash script will install sudo on Debian
    # 
    # Do not forget to make this bash script executable
    # chmod +x install-sudo.sh
    #
    # change the user name (ron) to the current user name
    
    if [ "$EUID" -ne 0 ]
      then echo "Please run as root"
      exit
    fi
    
    apt-get install sudo -y
    
    # Add the current user to the end of the sudoers
    echo "ron   ALL=(ALL:ALL) ALL" >> "/etc/sudoers"
    
    echo "Done."