Skip to content

Instantly share code, notes, and snippets.

View PraneethKarnena's full-sized avatar
🎯
Focusing

Praneeth Karnena PraneethKarnena

🎯
Focusing
  • Hyderabad, India
View GitHub Profile
@PraneethKarnena
PraneethKarnena / android_instructions.md
Created July 17, 2019 18:44 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@PraneethKarnena
PraneethKarnena / .gitignore
Last active February 19, 2024 17:49
.gitignore skeleton for use with Python, Django, React and Visual Studio Code
# Created by https://www.toptal.com/developers/gitignore/api/python,pythonvanilla,visualstudiocode,pydev,pycharm
# Edit at https://www.toptal.com/developers/gitignore?templates=python,pythonvanilla,visualstudiocode,pydev,pycharm
### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
@PraneethKarnena
PraneethKarnena / gunicorn.sh
Last active January 21, 2020 08:14
Run Gunicorn with basic configuration options.
gunicorn --bind=127.0.0.1:8000 --workers=4 --worker-class=gevent --threads=8 --worker-connections=100000 --timeout=63 --keep-alive=60 django_project.wsgi
@PraneethKarnena
PraneethKarnena / gunicorn.service
Last active August 10, 2021 06:26
Run Gunicorn as a service
# /etc/systemd/system/gunicorn.service
# sudo systemctl enable gunicorn
# sudo systemctl daemon-reload
# sudo service gunicorn restart
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
@PraneethKarnena
PraneethKarnena / nginx-gunicorn.conf
Last active September 3, 2021 15:54
Nginx configuration for proxying requests to Gunicorn
server {
listen 80;
server_name example.org;
access_log /var/log/nginx/example.access.log;
error_log /var/log/nginx/example.error.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@PraneethKarnena
PraneethKarnena / run_postgres.sh
Created March 12, 2020 07:54
Command for running Postgres on macOS installed with Homebrew
# Command for running Postgres on macOS installed with Homebrew
pg_ctl -D /usr/local/var/postgres start
@PraneethKarnena
PraneethKarnena / install_psycopg2.sh
Created March 12, 2020 08:31
Install psycopg2 on macOS
# Install psycopg2 on macOS
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
pip install psycopg2
@PraneethKarnena
PraneethKarnena / fix_mysql_caching_sha2_password.sql
Created March 23, 2020 08:00
Fix MySQL Unable to load authentication plugin 'caching_sha2_password'
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
@PraneethKarnena
PraneethKarnena / start_postgres_brew.sh
Created March 24, 2020 07:00
Start Postgres with brew
pg_ctl -D /usr/local/var/postgres start