Skip to content

Instantly share code, notes, and snippets.

View poudel's full-sized avatar
🎯
Focusing

k poudel

🎯
Focusing
View GitHub Profile
@Alex3917
Alex3917 / gist:de07c7e181b61133662af5c76d3ea869
Created September 1, 2020 01:54
How to configure nginx for ElasticBeanstalk with Python on Amazon Linux 2
worker_processes 1;
user nginx;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # set to 'on' if nginx worker_processes > 1
}
@Alex3917
Alex3917 / celery_configs
Created September 1, 2020 01:47
How to configure Celery using Elastic Beanstalk with Amazon Linux 2
# In .ebextensions/01_celery.config
files:
"/etc/systemd/system/celery.service":
mode: "000644"
owner: celery
group: celery
content: |
[Unit]
Description=Celery Service
@singerng
singerng / Django_Default_Config.md
Last active July 25, 2023 20:13
Config for Django/Pipenv/Gunicorn/Nginx/Systemd.

Reasonable default configuration for a web app that uses Django and the following dependencies:

  • Pipenv: Python package manager
  • Gunicorn: WSGI server
  • Nginx: Static webserver passing to gunicorn, handling SSL, etc.
  • Systemd: Used to load Gunicorn on startup

This is my goto for setting up projects.

HN thread: https://news.ycombinator.com/item?id=14910561 "How to find a remote job"

@ololobus
ololobus / create-and-fill-up-table.sql
Last active March 25, 2024 14:59
Create large ~1 GB random dataset in PostgreSQL
CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
EXPLAIN (analyse, buffers)
SELECT num1, avg(num3) as num3_avg, sum(num2) as num2_sum
FROM large_test
GROUP BY num1;
@AndreasS2501
AndreasS2501 / Blockchains.md
Last active September 19, 2018 14:32
How to think an impossible thought?

On Blockchains - Postcapitalism - in response to: Postcapitalism by Jamie Dobson https://www.youtube.com/watch?v=MGdQnL4-H9M

An impossible thought?

But what do we want to think? I think many people want the same thing (see maslov pyramid of needs). But the ever interesting question in the history of humanity was: How to do that so that there exists an equilibrium between all humans (society) and the rest of the planet (nature). Personally I see post-capitalism as a part of a solution for that, but economy is only one thing that should change. To conceive such a complex balance is not a simple thing. Alan Kay often talks about how the internet has some biological ideas in it and yes I think to achieve that balance we need some kind of network organism where everyone is connected and heard. Even nature. So lets focus on that, the impossible thought: How can we live together in peace and prosperity with each other and nature? Sometimes, somehow this reminds me of the https://en.wikipedia.org/wiki/K

@simonw
simonw / how-to.md
Last active March 26, 2024 23:21
How to create a tarball of a git repository using "git archive"
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 9, 2024 10:07
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@unruthless
unruthless / gist:11383824
Last active January 3, 2024 08:57
HTML Email Template guidelines

General guidelines for designing HTML email templates.

Questions and comments welcome anytime – thanks for reading!

KEY TAKEAWAY:

  • Coding for HTML emails is like coding for Internet browsers from 10 years ago. (It’s the email clients’ — Outlook, etc. — fault.)
  • Picture a website from a decade ago: that’s the level of design complexity we can reasonably shoot for.

WIDTH: