Skip to content

Instantly share code, notes, and snippets.

View oesukam's full-sized avatar
🎯
Focusing

Olivier M. Esuka oesukam

🎯
Focusing
View GitHub Profile
@oesukam
oesukam / Nginx Serve Static HTML files
Last active February 10, 2024 13:35
Nginx Serve Static HTML files
server {
listen 80;
listen [::]:80;
index index.html index.htm index.nginx-debian.html;
server_name domain-name.com;
root /var/www/project-name/build;
@oesukam
oesukam / PHP Nginx server block
Last active February 3, 2021 21:33
PHP Nginx server block
server {
listen 80;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
try_files $uri $uri/ =404;
}
@oesukam
oesukam / pair-key-sign-verify.js
Last active August 25, 2020 18:25
Sign and verify signature with RSA pair keys using Nodejs
const crypto = require('crypto')
const fs = require('fs')
const private_key = fs.readFileSync('certs/private.pem', 'utf-8')
const public_key = fs.readFileSync('certs/public.pem', 'utf-8')
const message = fs.readFileSync('message.txt', 'utf-8')
const signer = crypto.createSign('sha256');
signer.update(message);
signer.end();
@oesukam
oesukam / linux-server-alias
Created June 21, 2020 08:38
Includes a list of alias to easy navigation on a linux server
# Alias to easy navigation on a linux server
# nginx
alias to-nginx="cd /etc/nginx"
alias to-nginx-available="cd /etc/nginx/sites-available"
alias to-nginx-enabled="cd /etc/nginx/sites-enabled"
# Hosted apps
alias to-www="cd /var/www"
@oesukam
oesukam / .s3cfg
Created March 9, 2020 20:44
Digital Ocean S3cmd
[default]
access_key = # Digital Ocean access key
access_token =
add_encoding_exts =
add_headers =
bucket_location = fra1
ca_certs_file =
cache_file =
check_ssl_certificate = True
check_ssl_hostname = True
@oesukam
oesukam / .babelrc
Created June 18, 2019 14:42 — forked from andrewmunro/.babelrc
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}
@oesukam
oesukam / circleci.yml
Created May 20, 2019 13:38 — forked from statico/circleci.yml
Node.js 10 + PostgreSQL CircleCI config
version: 2
workflows:
version: 2
build:
jobs:
- test
jobs:
test:
@oesukam
oesukam / INSTALL.md
Created March 26, 2019 18:27 — forked from takeit/INSTALL.md
Write to NTFS on macOS Sierra (osxfuse + ntfs-3g)
  1. Install osxfuse:
brew cask install osxfuse
  1. Reboot your Mac.

  2. Install ntfs-3g:

ExpressJS - API Tests with Jasmine and request

What am I trying to solve

I was trying to solve an issue with starting the ExpressJS server before each single test and closing it after each test completes, just to make sure each test is running under the same conditions.

Here is the error I ran into while trying to run the tests

$ ./node_modules/jasmine/bin/jasmine.js
Started
started
@oesukam
oesukam / nginxproxy.md
Created December 30, 2017 07:59 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers