Skip to content

Instantly share code, notes, and snippets.

View karolsteve's full-sized avatar
🏠
Working from home

Steve Tchatchouang karolsteve

🏠
Working from home
View GitHub Profile
@karolsteve
karolsteve / FormDataHandler.java
Created March 28, 2024 15:23 — forked from JensWalter/FormDataHandler.java
FormDataHandler for com.sun.net.httpserver.HttpHandler
package io.trivium.glue.binding.http;
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
@karolsteve
karolsteve / openssl-build.sh
Created December 12, 2023 19:41 — forked from foozmeat/openssl-build.sh
A shell script to build openssl for iOS and Mac. It currently builds: Mac -> i386 & x86_64 // iOS -> armv7, arm64 // iOS Simulator -> i386 & x86_64.
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
@karolsteve
karolsteve / https_nginx_express_node_config.md
Created October 31, 2023 15:11 — forked from basharovV/https_nginx_express_node_config.md
How to configure HTTPS with Lets Encrypt, Nginx reverse proxy, Express and Node

How to configure HTTPS with Lets Encrypt, Nginx reverse proxy, Express and Node

  1. Have a Node app ready for production.
  2. Create an app.js file in your project directory:
const express = require('express');
const path = require('path');
const app = express();

// Allow dotfiles - this is required for verification by Lets Encrypt's certbot

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@karolsteve
karolsteve / gist:c5e29bdacb25899ae36a3a4f632ae6eb
Created August 21, 2023 10:27 — forked from bobuss/gist:6515517
Tuning the Linux Kernel for many tcp connections

(from http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-1)

Save yourself some time and tune the kernel tcp settings before testing with lots of connections, or your test will fail and you’ll see lots of Out of socket memory messages (and if you are masquerading, nf_conntrack: table full, dropping packet.)

Here are the sysctl settings I ended up with - YMMV, but these will probably do:

$ cat /etc/sysctl.conf
# General gigabit tuning:
net.core.rmem_max = 16777216