Skip to content

Instantly share code, notes, and snippets.

@neerajgupta2407
neerajgupta2407 / celery.sh
Created October 10, 2023 10:42 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@neerajgupta2407
neerajgupta2407 / saleor_api_nginx_conf
Created May 15, 2023 12:43
Saleor Dashboard nginx config
server{
server_name shop-api.algomock.in;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Installing python and other essentials
https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-18-04-server
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install python3.7 libpython3.7-dev python3-all-dev
@neerajgupta2407
neerajgupta2407 / export_and_upload_to_s3.sh
Last active January 15, 2021 19:03
Export POstgres db bbackup and upload to S3.
#!/bin/bash
# Written 2018-11-15 by 4410287
# This script will create a backup file of a postgres database and compress it. It is capable of access a local or remote server to pull the backup. After creating a new backup, it will delete backups that are older than 15 days, with the exception of backups created the first of every month. It is recommended to create a seperate database user specifically for backup purposes, and to set the permissions of this script to prevent access to the login details. Backup scripts for different databases should be run in seperate folders or they will overwrite each other.
HOSTNAME=
USERNAME=
PASSWORD=
DATABASE=
FILENAME=$(date +%Y-%m-%d).backup.sql
@neerajgupta2407
neerajgupta2407 / PaytmChecksum.py
Created June 7, 2020 09:32
Paytm python sample code
import base64
import string
import random
import hashlib
import sys
from Crypto.Cipher import AES
iv = '@@@@&&&&####$$$$'
export APP_MOUNT_URI=/dashboard/
export API_URI=http://3.6.136.178:8000/graphql/
cd /home/ubuntu/codes/backend/storefront && npm start
export APP_MOUNT_URI=/dashboard/
export API_URI=http://3.6.136.178:8000/graphql/
cd /home/ubuntu/codes/backend/saleor-dashboard && npm start
# Update below variables in ~/.bashrc file.
# change below x.x.x.x to your server ip or 127.0.0.1 for localhost
export ALLOWED_HOSTS=x.x.x.x
export ALLOWED_CLIENT_HOSTS=x.x.x.x
export DEBUG=True
export SECRET_KEY=123456
export INTERNAL_IPS=127.0.0.1,x.x.x.x,
export DEFAULT_COUNTRY=IN
export DEFAULT_CURRENCY=INR
export APP_MOUNT_URI=/dashboard/
# setup storefront
git clone https://github.com/mirumee/saleor-storefront.git
cd saleor-storefront
git checkout 2.10.1
npm i
vim package.json : --host 0.0.0.0
npm start