Skip to content

Instantly share code, notes, and snippets.

@eskadah
eskadah / redis.xml
Created July 24, 2022 17:48
redis xml
<mxfile host="app.diagrams.net" modified="2022-07-24T17:45:25.955Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36" etag="RbOJ07XhCZc2DB-SCQ3l" version="15.9.1" type="device"><diagram id="xd1Gf5sbgqlj4Mk23zVu" name="Page-1">7Vptc5s4EP41/lgPIIPtj/FLru3kOr26037sqEgYTQBxQo6d/vpbgcAgkbcbnLhTOzMxrKRF2ufZ1a7wCC3Tw18C5/HfnNBk5DnkMEKrkee5DprCl5Lca4kboEqyFYxUMuco2LBftB6qpTtGaKFllUhynkiWd4UhzzIayo4MC8H33W4RT0hHkOMttQSbECe29DsjMq6kM985yt9Tto3rJ7uObklx3VkLihgTvm+J0HqEloJzWV2lhyVNlPW6drl+oLWZmKCZfM6AFfkafHq/vrnbfb9dRB/XWUayd16l5Q4nO73gqxT/4hnI1gkuJFviMKal4QT8/0IJK/Ry5H1to+KWylAt1hmhBd/JhGV02eChhBHP5JInoEMNQPB3rSa52ApMGD22ZTwDnYtCCn5LWwOi8qMUsSTpU0RwEVOin3ZHhWQA4Q3+SZPPvGCSwYrQKmWEqDk3Ha4StlUNP7mUPIUGrAUhzInCMxaxTBO4d+FyHzNJNzkO1ar3QHe9Ls1Zt17nRhtGjSmgO8u2cIfUXYxz1ZIetspbxnhfTMa54GQXyg+hmuIiF9VFtw8toQgVFD8AiB+ihAEtNHiwGnp4kBVuwzXwUspTKsU9dKkHBJqe2kH92vH2LbZrUdwmek1rrB1s26g+chAuNA1fQElkUdImnDZklNDDlXJysAXNiL5chWCugoVd+ATfZaShSL06d1YN1SAG4/m0sSslVmh40qotq/
@eskadah
eskadah / home.html
Created May 13, 2020 13:10 — forked from doobeh/home.html
More complete example of FieldList with FormField
<form method="post" action="">
{{ form.name}}
{{ form.hidden_tag() }}
<br/>
{% for entry in form.hours %}
{{ loop.index0|dow }}
{{ entry() }}
{% endfor %}
<input type="submit"/>
</form>
@eskadah
eskadah / gunicorn_start.bash
Created May 6, 2019 11:06 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@eskadah
eskadah / sessionrecorder.py
Created December 21, 2018 21:18 — forked from georgevreilly/sessionrecorder.py
WSGI Middleware to record Request and Response data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WSGI middleware to record requests and responses.
"""
from __future__ import print_function, unicode_literals
import logging
@eskadah
eskadah / nginx-tuning.md
Created November 12, 2018 21:04 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@eskadah
eskadah / post_message.lua
Created November 6, 2018 19:40 — forked from jeffweiss/post_message.lua
Sending POSTs to Elixir Phoenix using wrk or wrk2
wrk.method = "POST"
-- this assumes that we're sending to a html form endpoint with csrf protection disabled
-- wrk.body and wrk.headers would be different if we were sending a JSON payload to a JSON API endpoing
wrk.body = "message[body]=wat"
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
@eskadah
eskadah / cols.txt
Created April 5, 2018 14:53 — forked from 0/cols.txt
Brief awk tutorial
abc 1 2 3
def 4 5 6
ga 7 9 10
hij 1 5 99
@eskadah
eskadah / gist:50c4a13f0d038bd70da1c7bdb39339db
Last active January 21, 2018 11:46
SUNDAY NOTES Privacy Policy

Privacy Policy

eskadah operates the sunday notes application, which provides the SERVICE.

This page is used to inform website visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.

If you choose to use our Service, then you agree to the collection and use of information in relation with this policy. The Personal Information that we collect are used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at github.com/eskadah , unless otherwise defined in this Privacy Policy.

@eskadah
eskadah / nginx.conf
Created January 13, 2018 12:37 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@eskadah
eskadah / elixirphoenix.bash
Created January 4, 2018 14:31 — forked from likethesky/elixirphoenix.bash
Installing Elixir & the Phoenix framework with Homebrew on OS X
$ brew update && brew doctor # Repeat, until you've done *all* the Dr. has ordered!
$ brew install postgresql # You'll need postgres to do this... you may also need to 'initdb' as well. Google it.
$ brew install elixir
$ mix local.hex # Answer y to any Qs
$ createuser -d postgres # create the default 'postgres' user that Chris McCord seems to like -- I don't create mine w/a pw...
# Use the latest Phoenix from here: http://www.phoenixframework.org/docs/installation -- currently this is 1.0.3
# ** Answer y to any Qs **
$ mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.0.3/phoenix_new-1.0.3.ez