Monday, December 10, 2018

Find Request Execution Time of Each Request in Apache

Apache access log provides many useful parameters which are very helpful while debugging. Requester IP, request url, user agent, request response code, request response size, request creation time etc but if you want to know the execution time of each request, there is nothing wrong with this requirement.

To achieve this, you need to make modifications in LogFormat attribute of apache configuration file.

You can find this parameter in apache configuration file of RPM based distributions like CentOS as well as Debian based distributions like Ubuntu. 

You need to add %T or %D parameters in the LogFormat of apache configuration file. Search following line
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
and change into
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" **%T/%D**" combined
We have just added %T and %D in value of the attribute.  

%T shows the response time in Seconds and %D shows the response time in microseconds. %D is very useful for short time response or to find exact value of response.
Suppose any request takes 7 seconds to finish, you can find its microseconds value in access log something like 7458962 or 7896547.

You can find apache configuration file in /etc/apache2/apache2.conf or /etc/httpd/conf/httpd.conf. Similarly you can find access log file in /var/log/apache2/access.log or /var/log/httpd/access_log  

Friday, November 23, 2018

Run the Django Oscar Sandbox Locally

git clone https://github.com/django-oscar/django-oscar.git

cd django-oscar

mkvirtualenv oscar  # needs virtualenvwrapper

make sandbox

The sandbox site (initialized with a sample set of products) will be available at: http://localhost:8000  

A sample superuser is installed with credentials:
username : superuser
email        : superuser@example.com
password : testing

Monday, November 19, 2018

nginx - Enable Leverage Browser Caching

If you are trying to enable Leverage Browser Caching for your site in nginx and it still shows not enabled in Google PageSpeed Insights and GTmetrix.

Solution :
1) Edit file /etc/nginx/sites-enabled/default
2) Add line
expires 365d;
in your virtualhost under "server {" above "location / {"
3) Restart nginx


Example :
server {
    listen 80;
    server_name yourdomainname.com;
    expires 365d;
    client_max_body_size 128M;
    location / {
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   Host      $http_host;
        proxy_pass         http://127.0.0.1:8080;
        proxy_connect_timeout       600;
        proxy_send_timeout          600;
        proxy_read_timeout          600;
        send_timeout                600;
        add_header X-Frame-Options SAMEORIGIN; 
        add_header X-Content-Type-Options nosniff; 
        add_header X-XSS-Protection "1; mode=block"; 
        proxy_hide_header X-Powered-By;
        server_tokens off;
        autoindex off;
        etag off;
    }

}

Saturday, October 27, 2018

smtplib.SMTPServerDisconnected: Connection unexpectedly closed: [Errno 104] Connection reset by peer

Django Python Error : SMTP Connection closed abruptly

If you are using Yandex smtp to send mails, here are the settings.

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yandex.com'
EMAIL_HOST_USER = 'username@domain.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587


Do not use port 465, try with port 587.

If still it does not work, you need to check the environment variables. Have you defined DEFAULT_FROM_EMAIL or HOST in OS environment files i.e. ~/.bashrc or /etc/environment
If they are there, it may be the issue, you need to comment them and loginto the new terminal as updated settings will be affected, now restart your web server (Python) and try again sending mails.

Monday, October 15, 2018

Databases created in cpanel mysql are not visible in cpanel phpmyadmin

Solution :

  • Confirm that databases are visible under mysql section of cpanel.
  • Logout from cpanel
  • Login into cpanel again.
  • Open phpmyadmin.

Now databases should be visible in phpmyadmin

Thursday, September 6, 2018

AH01797: client denied by server configuration

If you get this message in your logs, it means mentioned Directory or File has been prohibited by server configuration. 

You have mentioned that this directory or file should not be accessible by user.

In many cases, most common forbidden file is xmlrpc.php of wordpress because it may be one reason of DDOS attack. That's why system administrators block this file to access using GET method.

Other forbidden object can be uploads or config directory.


Wednesday, September 5, 2018

Font - Text has turned into boxes in Ubuntu 16.04

Without any cause all text has turned into boxes 'rectangles' everywhere in Ubuntu 16.04.
find /usr/share/fonts -iname '*.ttf' -type f -exec sudo chmod -v 644 {} \;
find /usr/share/fonts -iname '*.otf' -type f -exec sudo chmod -v 644 {} \;
sudo fc-cache -r -v

Python error while installing any package on Ubuntu

Error :
Errors were encountered while processing:
 python-pkg-resources
 python-zope.interface
 python-twisted-core
 python-twisted-web
 python-ubuntu-sso-client
 ubuntu-sso-client
 ubuntu-sso-client-qt
 python-aptdaemon
 python-aptdaemon.gtk3widgets
 oneconf
 software-center
 sessioninstaller
E: Sub-process /usr/bin/dpkg returned an error code (1)


Solution :
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall python-minimal python-lockfile


AWS CLI - Copy data of one s3 bucket to another s3 bucket of same AWS account

Once aws account is configured using secret and access keys, run following command.
aws s3 sync s3://bucket1 s3://bucket2

AWS - SignatureDoesNotMatch (client): Signature not yet current:

Solution :

The issue is with date, you need to fix the date by command.
sudo ntpdate ntp.ubuntu.com

Monday, August 6, 2018

docker open another terminal of running container

If you are running any python node or similar server in docker container which does not return on command prompt and you want to run another command in same container, either you need to stop running server, that may not be your requirement or you attach same container again but it takes you in same running server so you can not run commands.

You can open another instance of terminal of same container. Here is the command you need to execute on terminal.
docker exec -it containerid bash

Suppose your container id is 404d5e3de9c4, so command will be
docker exec -it 404d5e3de9c4 bash
Now another instance of terminal of same container is opened where you can run different commands.

libsass bindings not found when using node-sass in nodejs

You are not able to start gulp because of this error.

Run following commands and start running gulp again.
npm uninstall --save-dev gulp-sass
npm install --save-dev gulp-sass@2

Friday, July 6, 2018

Joomla - White screen with text error : Enable Error Logging

Open file configuration.php. Set value default for error_reporting.
$error_reporting = 'default';
Add these lines at last of the file configuration.php.

ini_set( 'display_errors', true );
error_reporting( E_ALL );

Now hit the same page again in browser, it shows the error message.

gitlab 11 - Keep git data on partition or external hard disk

gitlab change git data path in gitlab 11

1. Mount the partition or external hark disk on the system. It should be accessible by absolute path like /home/partition or /mnt/nfs etc

2. Open file /etc/gitlab/gitlab.rb and data dir path in it.


git_data_dirs({
  "default" => { "path" => "/mnt/nfs/gitlab/git-data" },
  "storage" => { "path" => "/mnt/nfs/gitlab/git-data" },
}) 

It depends on your path.

Reconfigure gitlab.
gitlab-ctl reconfigure

Now you will not get 500 or 502 error and Repositories will be accessed from defined path. 

Note : gitlab completely deprecated git_data_dir "/git-data/path" parameter in gitlab 11.
You need to use path like mentioned above. If you do not change the attribute, you will not be able to reconfigure gitlab successfully.

Friday, June 15, 2018

Failed to add /run/systemd/ask-password to directory watch: No space left on device

Solution :


echo 1048576 > /proc/sys/fs/inotify/max_user_watches

The long-term fix is to edit the file /etc/sysctl.conf to include the line:

fs.inotify.max_user_watches=1048576
Reload Kernel.
sysctl -p
Reload settings from all system configuration files.

Type the following command to reload settings from config files without rebooting the box:

sysctl --system

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found

Solution :
Your gcc is older and you need to upgrade new.

If you are using centos, here is the procedure to upgrade gcc
wget https://ftp.gnu.org/gnu/gcc/gcc-8.1.0/gcc-8.1.0.tar.gz
yum install libmpc-devel mpfr-devel gmp-devel zlib-devel*
./configure --with-system-zlib --disable-multilib --enable-languages=c,c++
make -j 8
make install



Monday, May 21, 2018

docker compose error : ERROR: Service failed to build

ERROR: Service failed to build: Get https://registry-1.docker.io/: Get https://auth.docker.io/token?scope=: dial tcp: lookup auth.docker.io on 127.0.1.1:53: read udp 127.0.0.1:48237->127.0.1.1:53: i/o timeout

ERROR: Get https://registry-1.docker.io: Get https://auth.docker.io: dial tcp: lookup auth.docker.io on 127.0.1.1:53: read udp 127.0.0.1:47094->127.0.1.1:53: i/o timeout


Solution :
Add 8.8.8.8 in /etc/resolv.conf as a nameserver.
nameserver 8.8.8.8

Now try to run 
docker-compose up

You should not get the same error again.

Firefox - Take screenshot of full page

Solution : 1
1. Update with latest Firefox.
2. In right side of the address bar, there is Page Actions menu (three dots)
3. Click on it and select option "Take a screenshot"
4. Either select option full page or visible page.
or
Right click on the page and select option 'Take a Screenshot'
Here you can take screenshot of full page or visible page.

Solution : 2
1. Press key Shift + F2, Firefox console will be visible
2. Run command
screenshot --fullpage
3. It will save screenshot of whole page in default download folder.

Solution : 3
Use addon screengrab

Run bash command with different external IP address

To run bash commands like nmap, mysql, psql, you need to hide your external IP address, if you do not want your external IP should be logged on remote server.

I am pretending you are already using http proxy or sock proxy.

To do this, open terminal and run following commands.

export http_proxy=ip-address:port-number
export https_proxy=ip-address:port-number


Example :
export http_proxy=35.192.xx.xx:3128
export https_proxy=35.192.xx.xx:3128

If you have installed Tor in ubuntu/centos/fedora and it is running on 9050 port, run command to export sock proxy.
 
export http_proxy=127.0.0.1:9050
export https_proxy=127.0.0.1:9050

Now if you run commands like mysqldump or pg_dump or mysql or psql, it will not log your IP address in remote server log.

Solution : II

If you are using tor, you can use torsocks command before these commands to hide your IP

torsocks mysql -h 39.xx.xx.xx -u root -p
The remote server ip 39.xx.xx.xx, will not log your external IP in its log, it will log the tor ip which you are currently using as a sock proxy.

Friday, April 20, 2018

Drupal : PHP Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not found in core/lib/Drupal/Core/DrupalKernelInterface.php on line 15

While running drupal import database command or any similar drupal command using command line, if you get following error :

Fatal error: Interface 'Symfony\Component\HttpKernel\HttpKernelInterface' not found in core/lib/Drupal/Core/DrupalKernelInterface.php on line 15

You need to update composer with optimize autoloader, Here is the command.

Solution :

composer update --optimize-autoloader

composer - mpdf - php fatal error : class mPDF not found

Same vendor folder of one server is not working on another server. There may be reason that working server has php 5.5 and non working server has php 5.6

Add following lines in file vendor/composer/autoload_classmap.php

'UCDN' => $vendorDir . '/mpdf/mpdf/classes/ucdn.php',
'bmp' => $vendorDir . '/mpdf/mpdf/classes/bmp.php',
'cssmgr' => $vendorDir . '/mpdf/mpdf/classes/cssmgr.php',
'directw' => $vendorDir . '/mpdf/mpdf/classes/directw.php',
'grad' => $vendorDir . '/mpdf/mpdf/classes/grad.php',
'mPDF' => $vendorDir . '/mpdf/mpdf/mpdf.php',
'meter' => $vendorDir . '/mpdf/mpdf/classes/meter.php',
'mpdfform' => $vendorDir . '/mpdf/mpdf/classes/mpdfform.php',
'otl' => $vendorDir . '/mpdf/mpdf/classes/otl.php',
'tocontents' => $vendorDir . '/mpdf/mpdf/classes/tocontents.php',
'wmf' => $vendorDir . '/mpdf/mpdf/classes/wmf.php',
Add following lines in file vendor/composer/autoload_static.php
'UCDN' => __DIR__ . '/..' . '/mpdf/mpdf/classes/ucdn.php',
'bmp' => __DIR__ . '/..' . '/mpdf/mpdf/classes/bmp.php',
'cssmgr' => __DIR__ . '/..' . '/mpdf/mpdf/classes/cssmgr.php',
'directw' => __DIR__ . '/..' . '/mpdf/mpdf/classes/directw.php',
'grad' => __DIR__ . '/..' . '/mpdf/mpdf/classes/grad.php',
'mPDF' => __DIR__ . '/..' . '/mpdf/mpdf/mpdf.php',
'meter' => __DIR__ . '/..' . '/mpdf/mpdf/classes/meter.php',
'mpdfform' => __DIR__ . '/..' . '/mpdf/mpdf/classes/mpdfform.php',
'otl' => __DIR__ . '/..' . '/mpdf/mpdf/classes/otl.php',
'tocontents' => __DIR__ . '/..' . '/mpdf/mpdf/classes/tocontents.php',
 'wmf' => __DIR__ . '/..' . '/mpdf/mpdf/classes/wmf.php',
Now run the same web page again in browser. You should not get error.

Lets encrypt error while renewing

The client lacks sufficient authorization :: Invalid response from

Full error :


Attempting to renew cert (domain.co.in) from /etc/letsencrypt/renewal/domain.in.conf produced an unexpected error: Failed authorization procedure. domain.co.in (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://domain.co.in/.well-known/acme-challenge/jfJj7OuSofik58w5Zv9QGADQFTR4OK_nfgVNOfg1xTw: "<!DOCTYPE html>
<html lang="en-US" class="bg-black">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width". Skipping.


Solution :
Do not renew it, instead of install certificates again
sudo certbot --apache -d domain.co.in

Install Lets encrypt on Linux AMI

Run Following Commands :
curl -O https://dl.eff.org/certbot-auto
chmod +x certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto

Make sure apache is running on 443 port and it is opened.

Install mod ssl using following command

sudo yum install mod24_ssl
We have used this command because we have installed httpd using `sudo yum install -y httpd24 php56 php56-mysqlnd`

If you have installed httpd using `sudo yum install httpd`, install mod_ssl using

`sudo yum install mod_ssl`
 
Now install certificates using

certbot-auto -d domain.com --debug

https://coderwall.com/p/e7gzbq/https-with-certbot-for-nginx-on-amazon-linux

Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA.

lets encrypt has one security vulnerability so changed command for generating https certificates

Solution :
sudo certbot --authenticator webroot --installer apache
Now it will ask the domain name to install certificates for it. Follow the instructions and you can install certificates successfully.

Note :
Now this issue has been fixed. Update lets encrypt and use regular commands.

s3cmd - 400 Bad Request

ERROR: S3 error: 400 (Bad Request):

Solution :
Use latest version of s3cmd
https://sourceforge.net/projects/s3tools/files/s3cmd/

mod_qos(004): failed to create mutex (ACT)(/var/tmp/K564968484.mod_qos): No space left on device

Solution :
Apache cannot be started because of this error, it means you have installed and enabled qos module in apache to avoid ddos attack. Now apache is crashed automatically and you are not able to start it.

Disable qos module

sudo a2dismod qos
Restart apache2

Error : django.db.utils.ProgrammingError: permission denied for relation django_migrations

While running django migrations for postgresql if you get above error, there may be chances that postgresql user which is used in connection file does not have sufficient permissions to run the migrations command. You need to provide privileges to postgresql user using super user.
1. Log into the database which is going to be migrated using super user
\c database name

2. Run following queries
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public to username;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public to username;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public to username;

Change text username with postgresql user which is used in server side postgresql connection file.

Note :
Generally you get this error while running python manage.py migrate 
and above solution works well for this error.

Apache - Block IP or an IP Range to prevent opening your site


If you want to block IPs from accessing your site, you can simply achieve it using an htaccess file. Add following line in .htaccess and IP owner will not be able to open your site anymore.


Suppose you want that your site should not be opened from IP 46.161.9.67, you need to add a line your .htaccess file.
Deny from 46.161.9.67
If there are multiple IPs and you want to block them all. Add following line in .htaccess.
Deny from 46.161.9.67 46.161.10.187 46.161.58.89
Block a whole IP Range
Here is the tricky part, If you want to block a whole IP Range like 69.0.0.0 to 69.0.0.255. Use following code in your .htaccess 

Deny from 69.208.0.0/24
If it is from 69.0.0.0 to 69.0.255.255
Deny from 69.208.0.0/16
And If it is from 69.0.0.0 to 69.255.255.255
Deny from 69.208.0.0/8

Refer Link for more wide Range :
https://www.mediawiki.org/wiki/Help:Range_blocks

Sort all files of present working directory and sub directories by modified date and time

If you want to sort all files of a folder and its subfolders by modified date and time, Here is the command.
find . -type f -printf "%T@ %Tc %p\n" | sort -n
Latest modified file will be last in the sequence.

If you want to reverse the sequence i.e. latest modified should be on top.
find . -type f -printf "%T@ %Tc %p\n" | sort -nr

Dot (.) indicates the present working directory. You can use absolute path also.

Laravel Error - No supported encrypter found. The cipher and / or key length are invalid.

While running  composer install or php artisan optimize, If you get this error, here is the solution.

Solution :

Change values in config/app.php

'cipher' => 'AES-256-CBC',
to
'cipher' => MCRYPT_RIJNDAEL_128,

Now run again composer install or php artisan optimize , you will not get the same error again.

Tuesday, March 6, 2018

AWS RDS - Create mysql user with superuser Privileges

Login as super user on command prompt.

Run following query to create user.
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
Just change username and password in above query and execute as root user. A new user will be created.

Now give super user privileges to new user.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'username'@'%' WITH GRANT OPTION;
Just change username in above query. Your new created user will be a super user now.

AWS RDS - Give Superuser Privileges to Regular mysql User

Login as super user on command prompt.

Run following query to give superuser privileges to normal user.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'username'@'%' WITH GRANT OPTION;
Just change username in above query and execute as root user. Your regular user will be a super user now.

Wordpress Permissions - Upload plugin using wp-admin

Upload plugin using wp-admin without ftp.

If you are not able to install plugin using wp-admin because of forbidden error or a permission issue, you simply change the permission of whole wordpress directory to fix it. That is very dangerous and a common security loophole.

Here is the minimum permission for your plugin directory which is enough to instal plugin using wp-admin.

Give 777 to wp-content/plugins and wp-content/upgrade Non-Recursively. It will allow admin to install plugin using wp-admin.


postgresql error : ERROR: database is being accessed by other users

ERROR:  database "X" is being accessed by other users
DETAIL:  There is 1 other session using the database


Solution :
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'database-name';
You need to replace only database name in above query.

Now you can drop the database or perform other activity what you were trying to perform.

composer update - exceeded the timeout of 300 seconds

Failed to download from source: The process  exceeded the timeout of 300 seconds.

Solution :
Increase the timeout limit globally for composer
composer --global config process-timeout 6000
Now run
composer update
You should not get timeout issue.

gitlab forbidden issue

This feature has been added by default in recent update of gitlab.
When there are number of failed login attempts while cloning or pushing files into gitlab repository, gitlab blocks UI as well as pull and push for the IP. Technically, it bans the IP.

Solution :
Disable this feature.

sudo nano /etc/gitlab/gitlab.rb
Uncomment these lines.
gitlab_rails['rack_attack_git_basic_auth'] = {
'enabled' => false,
}
Reconfigure gitlab.
sudo gitlab-ctl reconfigure
Now it will not block that ip after number of failed login attempts.

ubuntu 16.04 - wkhtmltopdf error - QSslSocket: cannot resolve CRYPTO_num_locks

wkhtmltopdf error on ubuntu 16.04 :
Loading pages (1/6)
QSslSocket: cannot resolve CRYPTO_num_locks                  ] 10%
QSslSocket: cannot resolve CRYPTO_set_id_callback
QSslSocket: cannot resolve CRYPTO_set_locking_callback
QSslSocket: cannot resolve sk_free
QSslSocket: cannot resolve sk_num

Solution :

sudo apt-get install libssl-dev=1.0.2g-1ubuntu4.10 openssl=1.0.2g-1ubuntu4

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Ruby Error while installing charlock_holmes 

Error :
Fetching charlock_holmes 0.7.5
Installing charlock_holmes 0.7.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.



Solution : 1

If you are using debian or ubuntu
sudo apt-get install libicu-dev

If you are using Centos or fedora
sudo yum install libicu-devel

Solution : 2
Try to install other version of charlock_holmes
gem pristine charlock_holmes --version 0.6.9.4
or
gem install charlock_holmes -v '0.6.9'

Friday, February 23, 2018

Skipping ssh-dss key id_dsa - not in PubkeyAcceptedKeyTypes

SSH keeps skipping my pubkey and asking for a password

You have correct ssh key but still it is asking password to login or if password authentication is prohibited, it stopped accepting correct keys.

If it was working before and suddenly it starts giving above error, it means you have upgraded your openssh. The new openssh version - 7.0+ does not support DSA keys anymore  (Neither on server nor on client). 

If openssh client has been upgraded and openssh server still supports DSA keys, make the changes in client side ssh config.

Solution  :
sudo nano /etc/ssh/ssh_config
Add following line in the file.
PubkeyAcceptedKeyTypes=+ssh-dss
Restart ssh.

If openssh server has been upgraded and openssh client still supports DSA keys, make the changes in server side sshd config.

Solution  :
sudo nano /etc/ssh/sshd_config
Add following line in the file.
PubkeyAcceptedKeyTypes=+ssh-dss
Restart ssh.

Note :  The best solution, you must use RSA keys. It has strong and secure algorithm and it is better than the patch you are finding.

Saturday, February 10, 2018

openedx installation on Linux | openedx installation on Ubuntu


Easy way :
1. Download the installer (.run file)
https://bitnami.com/stack/edx/installer
2. Make it executable.
chmod a+x filename.run
3. Run the installer.
./filename.run

Hard way:
Install using bash script. Why it is hard because it is gonna give many errors, you need to fix them one by one and start installing again and again until it is installed completely.
wget https://raw.githubusercontent.com/edx/configuration/$OPENEDX_RELEASE/util/install/sandbox.sh -O - | bash

You choose the version of Open edX by setting the OPENEDX_RELEASE variable before running the commands. See Open edX Releases for the tags you can use.
https://openedx.atlassian.net/wiki/spaces/DOC/pages/11108700/Open+edX+Releases
Release names like open-release/ginkgo.2, open-release/eucalyptus.3, open-release/ficus.4 etc

Example:
wget https://raw.githubusercontent.com/edx/configuration/open-release/ginkgo.2/util/install/sandbox.sh -O - | bash

Helpful url :
https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/146440579/Native+Open+edX+Ubuntu+16.04+64+bit+Installation

Hardest way:
Install each package separately like these guides are suggesting. Similar guides you can find for centos and fedora.
https://www.iblstudios.com/step-step-guide-install-open-edx-platform-ficus-release/
I would suggest you to install on virtual machine like docker, vagrant or vmware instead of start installing on your system.

Friday, January 26, 2018

postgresql - Check ip of logged in user

To get Logged in user IP

Run Query :
postgres=> select inet_client_addr();

Tuesday, January 9, 2018

mysql - Check IP of logged in user


Run Query :

mysql> select user();



Mysql 5.7 - Update root password

mysql 5.7 does not have password field in user table of mysql database. They have come up with new idea i.e. authentication_string for security purpose.

Here is way to update mysql superuser password using command line.
UPDATE mysql.user SET authentication_string=PASSWORD('sToituY78hebrt'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost';

where sToituY78hebrt is my root password