Skip to content

Instantly share code, notes, and snippets.

View nullexcept1on's full-sized avatar

NullException nullexcept1on

View GitHub Profile

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@nullexcept1on
nullexcept1on / client.py
Created July 3, 2021 12:30
Encrypted Python TCP Socket
import socket
import sys
from tcp import *
def handler(data):
print(data)
return input(">> ")
if __name__ == '__main__':
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@nullexcept1on
nullexcept1on / .htaccess
Created March 31, 2021 17:50 — forked from alexsasharegan/.htaccess
Apache Config for React Router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
@nullexcept1on
nullexcept1on / api_gateway.conf
Created March 20, 2021 20:55 — forked from nginx-gists/api_gateway.conf
Deploying NGINX Plus as an API Gateway, Part 2: Protecting Backend Services
include api_backends.conf;
include api_keys.conf;
limit_req_zone $binary_remote_addr zone=client_ip_10rs:1m rate=1r/s;
limit_req_zone $http_apikey zone=apikey_200rs:1m rate=200r/s;
server {
access_log /var/log/nginx/api_access.log main; # Each API may also log to a separate file
listen 443 ssl;
@nullexcept1on
nullexcept1on / docker-compose.yml
Created October 27, 2020 12:21 — forked from thomasdarimont/docker-compose.yml
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@nullexcept1on
nullexcept1on / SomePlugin.java
Created October 8, 2020 20:15 — forked from blablubbabc/SomePlugin.java
Waiting for running async bukkit tasks to finish inside onDisable()
// inside the plugin class
private static final long ASYNC_TASKS_TIMEOUT_SECONDS = 10;
@Override
public void onDisable() {
// wait for async tasks to complete:
final long asyncTasksTimeoutMillis = ASYNC_TASKS_TIMEOUT_SECONDS * 1000;
final long asyncTasksStart = System.currentTimeMillis();
boolean asyncTasksTimeout = false;
while (this.getActiveAsyncTasks() > 0) {