Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
@ikennaokpala
ikennaokpala / _ikenna okpala - short bio.md
Last active April 13, 2024 13:19
Resume / Curriculum Vitae of Ikenna N. Okpala

Ikenna is a Father (of 3), Husband and senior technologist. He has 16+ years of experience working to create web application software.

He has solved real world problems with practical yet elegant user-centred solutions based on business priorities.

He is pragmatic and subscribes to agile, pair programming (where required), behaviour driven development (BDD), DRY, progressive enhancement, and open source approaches to web software development.

He is looking forward to helping the team at <> contribute value to <> and its clients

@ikennaokpala
ikennaokpala / nfs-vagrant-error.md
Last active March 8, 2024 12:54
Vagrant error :NFS is reporting that your exports file is invalid

Vagrant error :NFS is reporting that your exports file is invalid

==> default: Exporting NFS shared folders...
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":

exports:2: path contains non-directory or non-existent components: /Users/<username>/path/to/vagrant
exports:2: no usable directories in export entry
exports:2: using fallback (marked offline): /
@ikennaokpala
ikennaokpala / README.md
Last active March 4, 2024 05:46 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).

The related Nginx options are:

@ikennaokpala
ikennaokpala / Go Cheat Sheet.md
Created December 30, 2014 00:26
Go Cheat Sheet

Go Cheat Sheet

Credits

Most example code taken from A Tour of Go, which is an excellent introduction to Go. If you're new to Go, do that tour. Seriously.

Go in a Nutshell

  • Imperative language
@ikennaokpala
ikennaokpala / _.sh
Last active June 10, 2021 07:24
Starting up and Monitoring a Golang binary in production
# Make it executable
sudo chmod +x etc/init.d/myapp
# Try it:
sudo service myapp start
# Make it run upon boot:
sudo update-rc.d myapp defaults
/* A Spreadsheet-powered Twitterbot Engine, version 0.4, May 2015
by Zach Whalen (@zachwhalen, zachwhalen.net, etc.)
This code powers the backend for a front-end in a google spreadsheet. If somehow you've arrived at this code without the spreadsheet, start by making a copy of that sheet by visiting this link:
bit.ly/botsheet
All of the setup instructions are available in the sheet or (with pictures!) in this blog post:
if Rails.env.production?
Braintree::Configuration.environment = Rails.env.staging? ? :sandbox : :production
Braintree::Configuration.merchant_id = ENV["braintree_merchant_id"]
Braintree::Configuration.public_key = ENV["braintree_public_key"]
Braintree::Configuration.private_key = ENV["braintree_private_key"]
else
Braintree::Configuration.environment = :sandbox
Braintree::Configuration.merchant_id = "<super secret>"
Braintree::Configuration.public_key = "<super secret>"
Braintree::Configuration.private_key = "<super secret>"
@ikennaokpala
ikennaokpala / cloudflare.conf
Created January 11, 2016 07:38 — forked from CodySwannGT/cloudflare.conf
WordPress/Nginx/PHP/Varnish Configuration
# /etc/nginx/cloudflare.conf
# If using Cloudflare, uncomment the following to get proper originating IPs
#set_real_ip_from 204.93.240.0/24;
#set_real_ip_from 204.93.177.0/24;
#set_real_ip_from 199.27.128.0/21;
#set_real_ip_from 173.245.48.0/20;
#set_real_ip_from 103.22.200.0/22;
#set_real_ip_from 141.101.64.0/18;
#real_ip_header CF-Connecting-IP;
@ikennaokpala
ikennaokpala / full_proxy_setup.sh
Last active November 1, 2018 18:03
Behind enemy lines (full proxy setup)
Export your shell environment for http proxy use
export http_proxy="http://hostname:port" or save it to your shell profile. (i.e. ~/.bash_rc)
export http_proxy='http://example.proxy_name.com:80'
For multi-user installs, use sudo -E to preserve the proxy settings in your environment:
Setting git to use a proxy
git config --global url.https://github.com/.insteadOf git://github.com/
git config --global http.proxy %http_proxy%
@ikennaokpala
ikennaokpala / _stylist_heroku_replay.sh
Last active September 28, 2018 09:31 — forked from stefansundin/heroku-replay.sh
Replay production Heroku requests to your local dev environment.
#!/bin/bash -e
app=stylist
dev=http://stylist.mslabs.io
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
do
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")