Skip to content

Instantly share code, notes, and snippets.

View askz's full-sized avatar
🎯
Focusing

Max: askz

🎯
Focusing
View GitHub Profile
@yasenn
yasenn / nginx.conf
Created October 18, 2016 20:49
nginx-2016.conf
### Nginx main config: Tweaks & SSL settings (without the FastCGI-cache config parts)
## http {} block:
http {
# [...]
server_tokens off;
reset_timedout_connection on;
@starenka
starenka / .gitignore
Created September 18, 2011 20:02
fabfile to deploy flask app to nginx/supervisor/uwsgi stack
.idea/*
*.pyc
@miketheman
miketheman / Makefile
Created September 1, 2016 19:54
Django + docker-compose Makefile
CURRENT_DIRECTORY := $(shell pwd)
TESTSCOPE = apps
TESTFLAGS = --with-timer --timer-top-n 10 --keepdb
help:
@echo "Docker Compose Help"
@echo "-----------------------"
@echo ""
@echo "Run tests to ensure current state is good:"
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@EmranAhmed
EmranAhmed / nginx-tuning.md
Created March 4, 2017 21:29 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

@floudet
floudet / ssh-chroot-jail.sh
Created June 19, 2016 11:57
Chroot Jail for SSH Access
# Chroot Jail for SSH Access
# Tested on Ubuntu 14.04.2 LTS and Debian GNU/Linux 8 (jessie)
# Reference : http://allanfeid.com/content/creating-chroot-jail-ssh-access
#
# Had to add/change several things to make it work, including:
# - create lib64 folder
# - copy whoami dependencies that ldd doesn't show to fix 'I have no name!'
# in the customized prompt + create passwd file
#
@Rajchowdhury420
Rajchowdhury420 / Tutorial.md
Last active September 7, 2023 18:39
Get sensitive info [Android PenTesting]

Extract [Decompile]

*Jadx - decompiler gui
jadx-gui

* Jadx - decomp cli (with deobf)
jadx -d path/to/extract/ --deobf app_name.apk

* Apkx decompiler
apkx example.apk 
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@Xion
Xion / requestcontexttask.py
Created November 4, 2015 06:39
Base class for Celery tasks running inside Flask request context
from celery import Task
from flask import has_request_context, make_response, request
from myapp import app
__all__ = ['RequestContextTask']
class RequestContextTask(Task):
@jeremyben
jeremyben / myapp.service
Last active February 20, 2024 06:07
systemd socket activation
# https://www.freedesktop.org/software/systemd/man/systemd.unit.html
[Unit]
Description=My App
After=network.target
# https://www.freedesktop.org/software/systemd/man/systemd.exec.html
[Service]
Type=simple
# https://www.freedesktop.org/software/systemd/man/systemd.exec.html#WorkingDirectory=
WorkingDirectory=-/srv/app/