Skip to main content


Use .htaccess to Redirect to HTTPS

If you are using apache webserver and would like to redirect all your traffic to the Secured Socket Layer protocol SSL, you may do that by editing the .htaccess file which resides on the html root of your hosting directory. To do so please add the below lines to your .htaccess file: #HTTPS Redirect <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] </IfModule> #End HTTPS Redirect
Recent posts

Connect Jupyter Notebook Pandas to Postgres

First install Python library Psycopg2 to connect to PostgreSQL: !pip install psycopg2 Now import the necessary libraries: import pandas as pd import psycopg2 as pg import as psql Connect to the DB Server: conn = pg.connect("postgres://username:password@server:port/dbname") Execute a Query: df = pd.read_sql('select* from table_name', conn) df.head()

Google Analytics on Refined Wiki Mobile Theme

Tracking mobile users on Confluence while using Refinedwiki mobile theme is not possible or straightforward using theme configuration. I found a work around that will track users on Google Analytics smoothly. Please follow the below steps: Create a js file, call is analytics.js with the analytics script code, it should look something similar to the below:   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)   })(window,document,'script','//','ga');   ga('create', ' UA-XXXXXX ', 'auto');   ga('set', 'userId',AJS.Data.get("remote-user")); // Set the user ID using signed-in user_id.    ga('send', 'pageview'); Save your script on confluence server confluenceInstall

linux Server out of Space

You could find your VPS out of space all the sudden especially if you are enabling logging for your website or web apps. First you need to know which directory is taking most of the size, then you can eliminate the problem or ask to increase disk place: Go to the root of your vps by typing on ur shell:# cd / Run: #sudo du -h --max-depth=1 Note which directories are using a lot of disk space . cd into one of the big directories. Run #ls -l to see which files are using a lot of space . Delete any you don't need.

IDLE subprocess didn't make connection Python 3.7

After installing Python on Windows 10. When trying to open IDLE, Python's IDE, you might get a  message saying that " IDLE's subprocess didn't make connection . Either IDLE can't start a subprocess or personal firewall software is blocking the connection ". To solve this issue just run IDLE as an Administrator, by right click on the IDLE icon and click Run as administrator. See Photo below:

ERROR: cross-database references are not implemented

You face this error while trying to query two tables from difference databases in Postgres, as Postgress is unlike SQL Server, you can't join two tables from different databases. Instead you may have One Database with Two different Schemas . Schemas group your data tables separately and give you the flexibility to query and join tables from across schemas in the same Database. So if you have DB1 and DB2, you need to move the tables in DB2 to DB1 but in a new schema. If you are using the public schema in DB2 you need to change the name:   alter schema public rename to new_schema_name ; create schema public ;   Now Backup your Schema: $ pg_dump --format custom --file "my_backup" --schema " new_schema_name " "db2" $ pg_restore --dbname "db1" "my_backup" Your Done. If you have any question please let me know.