Skip to content

Instantly share code, notes, and snippets.

View paneru-rajan's full-sized avatar
🇳🇵

Rajan Paneru paneru-rajan

🇳🇵
View GitHub Profile
@paneru-rajan
paneru-rajan / centos_nginx_config.md
Last active November 27, 2017 09:40
[Centos nginx setup] Installing and confiuguring nginx sever with phpmyadmin #nginx #centos7 #phpmyadmin

Installation of nginx and Setting Up with phpmyadmin

sudo yum install epel-release -y
sudo yum install nginx

Setting up php-fpm

@paneru-rajan
paneru-rajan / docker.md
Created December 9, 2017 15:34
[All Container Ip] Ip of all docker container #docker #contianer

#Ip of all docker container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
@paneru-rajan
paneru-rajan / git-branch.md
Last active December 19, 2017 05:27
[GIT steps] Steps to create branch push and commit #git #branching #steps

Git Steps

  1. Create a issue on gitlab with name according to:
bug-001-login-fix
feat-002-model-add
  1. Create lcoal branch with same name as issue

Follow the followings steps:

@paneru-rajan
paneru-rajan / django-migration.md
Last active March 15, 2018 10:08
django resolve migration

To clean migrate again

python manage.py makemigrations appname

python manage.py migrate --run-syncdb

python manage.py migrate --fake appname
@paneru-rajan
paneru-rajan / supervisord_uwsgi.md
Last active March 21, 2018 11:16
Setting up supervisor on django with uswgi
  1. Supervisor File /etc/supervisor/conf.d/prod-scraper.conf
[program:prod-scraper]
directory=/home/nwc/app/production/news-scraper/src/
command=/home/nwc/app/production/venv/bin/uwsgi --ini /home/nwc/app/production/news-scraper/src/crawleradmin.ini
autostart=true
autorestart=true
stderr_logfile=/var/log/prod-scraper.err.log
stdout_logfile=/var/log/prod-scraper.out.log
@paneru-rajan
paneru-rajan / nginx.md
Last active June 1, 2018 06:58
[Nginx configuration for django] It serves static file from different folder #nginx #django #proxy

Nginx proxy configuration for django applications.

  1. Create a file
    vim /etc/nginx/sites-available/<filename>
    
  2. Paste below content and edit accordingly
    server {
    

listen 80;

@paneru-rajan
paneru-rajan / supervisor.md
Last active June 1, 2018 06:57
[Supervisor Config file for django app] Configuration file for django, supervisor and gunicorn #gunicorn #supervisor #django

Supervisor configuraion file

  1. Create a file:
    cd /etc/supervisor/conf.d
    vim test.django.conf
    
  2. Paste content below:
    [program:test.django]
    

command=/home/rajan/.virtualenvs/django-Wkqw33bx/bin/gunicorn -b :8080 mysite.wsgi:application

@paneru-rajan
paneru-rajan / installation.md
Last active April 19, 2020 20:52
[Installing different packges in Ubuntu 18.04] Everything I Installed in Ubuntu 18.04 #ubuntu18.04 #ubuntu #installation #docker-compose #nodejs #npm #docker #elastic-search

List of Different application installation method

  1. Docker Link

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
    sudo groupadd docker
    sudo usermod -aG docker $USER
    
@paneru-rajan
paneru-rajan / jupyter.md
Last active March 2, 2019 18:43
[Installation of jupyter notebook] Installation of jupyter notebook in ubuntu 18 and changing default directory #jupyter #ubuntu #ubuntu18.04 #ipython

Installation of jupyter notebook in ubuntu 18

Install using pip

use ignore-installed if you run into any problems in installations relating

Cannot uninstall ''. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

@paneru-rajan
paneru-rajan / nested_to_flat.md
Created June 26, 2018 19:08
Nested arrays of integers into a flat array

Nested arrays of integers into a flat array

For simplicity i have used JS, and i am fully aware that flatArray() will give array of string, insted a array of numbers. Since js is loosely typed, it's okay to save like this. You can use flatIntigerArray() to get array as Integer array, i am supposing that i will receive intger nested array as said.

How to run this:

  1. Please open browser (I am using Chrome)
  2. Press CTRL+SHIFT+J
  3. Paste below code to see output

Javascript Function