Converting .htaccess rewrite rules to IIS

  1. Make sure the URL Rewrite module is installed and enabled for IIS. Right click on Sites, and make sure there is an icon with URL Rewrite label is listed in the IIS section.
  2. Install URL Rewrite module from IIS website if the module is not available.
    Download the module here : https://www.iis.net/downloads/microsoft/url-rewrite.
  3. After installing, close and reopen the IIS Manager. Refreshing the modules list will not work.
  4. Double click on the URL Rewrite module, and go to inbound rules > Import Rules.
  5. Copy and paste the rewrite rule from .htaccess to the Rewrite rules box. You will then get the converted rules in Tree View and XML view.
  6. Click on Apply to accept the converted rules and click on Back to Rules.

Thats it! 🙂

 

 

 

Rsync without password to remote server with non-default SSH port

This is the normal rsync command, assuming your are using port 2222 for the SSH port :

rsync -avz -e “ssh -p 2222” /local_folder user@xx.xx.xx.xx:/remote_folder

However, this will require you to fill in the password. If the remote server is trusted, just create the key pair.

ssh-keygen

Enter file in which to save the key (/user/.ssh/id_rsa): put_any_name_here
Enter passphrase (empty for no passphrase):  (just press enter)
Enter same passphrase again: (just press enter)
Your identification has been saved in put_any_name_here
Your public key has been saved in put_any_name_here.pub.

Copy the key to remote server :

ssh-copy-id -p 2424 -i /user/.ssh/put_any_name_here.pub xx.xx.xx.xx

The key is now copied and you may log in to the remote server without using password anymore

ssh -p 2222 139.162.42.249

Schedule the rsync in a cronjob, that’s all 🙂

Installing node-oracledb on Centos 7 for Meteor

  1. Download Oracle Instant Client basic, devel, and sqlplus package RPM from Oracle’s website in RPM format
  2. Install all files for Oracle Instant Client using :
    rpm -ivh oracle-instantclient*
  3. Set required environment variables :
    export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/
    export OCI_LIB_DIR=/usr/lib/oracle/12.1/client64/lib/
    export OCI_INC_DIR=/usr/include/oracle/12.1/client64/
  4. Install node-oracledb
    meteor npm install oracledb --save
  5. That’s it. Enjoy! 🙂

Installing Oracle 11 XE on Centos 7

  1. Download Oracle 11 XE from Oracle website here
  2. Install required tools
    yum install libaio bc flex unzip
  3. Unzip the downloaded Oracle archive
    unzip oracle-*
  4. Install Oracle
    cd Disk1
    rpm -ivh oracle-*
  5. Configure the newly installed Oracle database
    /etc/init.d/oracle-xe configure
  6. Set ORACLE_HOME
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
  7. Add ORACLE_HOME to PATH
    export PATH=$PATH:$ORACLE_HOME/bin
  8. Add ORACLE_SID to PATH
  9. export ORACLE_SID=XE
  10. Log in to SQLPlus
    sqlplus sys/sys as sysdba
  11. If you are Connected, add new user if you want. If not start the database first
    startup
  12. Add test user
    create user test identified by password;
    grant connect,resource,dba to test; //be careful for dba
  13. That’s all. Enjoy!

Installing PostgreSQL 5.6 on Centos 7

Step-by step walkthrough :

  1. Download repository RPM from :
    http://yum.postgresql.org/repopackages.php
  2. After choosing which RPM to download, at terminal :
    yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-1.noarch.rpm
  3. Install the database
    yum install postgresql96-server postgresql96-contrib
  4. Initialize database
    /usr/pgsql-9.6/bin/postgresql96-setup initdb
  5. Create database user
    su - postgres
    createuser --interactive
  6. Create new database
    su - newuser
    createdb newdb
  7. Connect to newly created database
    psql -d newdb
    \conninfo //for connection information
  8. Change database user password
    \password
    \q to quit
  9. To start PostgreSQL service
    systemctl start postgresql-9.6.service
  10. To add to system startup
    systemctl enable postgresql-9.6.service
  11. To allow remote connections, edit :
    vi /var/lib/pgsql/9.6/data/postgresql.conf 
    
    # Change line containing listen_addresses to this :
    listen_addresses='*'
  12. Edit pg_hba.conf file to allow all connections :
    vi /var/lib/pgsql/9.6/data/pg_hba.conf 
    
    # Add new line 
    host all all 0.0.0.0/0 md5
  13. Restart the service
    systemctl restart postgresql-9.6.service
  14. That’s it. Enjoy.