Skip to content

Instantly share code, notes, and snippets.

View libracoder's full-sized avatar
🏠
building out distributed systems that scale

Precious Okwu libracoder

🏠
building out distributed systems that scale
  • Lagos, Nigeria
View GitHub Profile
### Keybase proof
I hereby claim:
* I am libracoder on github.
* I am libracoder (https://keybase.io/libracoder) on keybase.
* I have a public key ASBNT5c4uiBr-QTsTUdoXeZRTbzjHJDFEaJL4lDs4Auwswo
To claim this, I am signing this object:
@libracoder
libracoder / aws-iam-poilcy-schema.json
Created August 10, 2022 11:01 — forked from jstewmon/aws-iam-poilcy-schema.json
AWS IAM Policy JSON Schema
{
"type": "object",
"required": ["Statement"],
"additionalProperties": false,
"properties": {
"Version": {
"type": "string",
"enum": ["2008-10-17", "2012-10-17"]
},
"Id": {
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "org.seadvocacy.docsrchout",
"sha256_cert_fingerprints":
["8C:6F:B4:94:F8:69:F3:39:29:60:B4:E1:2B:0A:14:9D:DC:9F:7B:D3:31:01:73:4A:D1:7F:10:E7:71:31:64:D6"]
}
},
@libracoder
libracoder / lambda_function_ALBS3Logs_to_CloudWatchLogs.py
Created October 14, 2021 02:32 — forked from psa-jforestier/lambda_function_ALBS3Logs_to_CloudWatchLogs.py
A lambda function to stream Application Load Balancer logs dropped in S3 to CloudWatch Logs
'''
This function send Application Load Balancer logs to CloudWatch Logs. So you can use CloudWatch tools, like Insight or custom metrics.
By default, ALB log its access in gz file in S3, and there is no way yo send the log directly to a Log Group / Log Stream.
This lambda function is triggered on S3 "PUT" action (when ALB write its log file). It then download the file localy, unzip it, sort it, and stream it to a CloudWatch log groups.
Installation
Activate ALB logs, and indicate the S3 bucket and the prefix for the log files. Enable, on the bucket, the deletion of old log files
@libracoder
libracoder / certbotresetcert.sh
Created September 27, 2021 09:34 — forked from zoharbabin/certbotresetcert.sh
Delete and reinstall SSL certificates with certbot on Ubuntu
certbot certificates
# find the path to the fullchain certificate you wish to reinstall
certbot revoke --cert-path /etc/letsencrypt/live/... #path to the cert from above
certbot delete --cert-name yourdomain.com
rm -Rf /etc/apache2/sites-available/000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on
rm -Rf 000-default-le-ssl.conf #or whatever the name of the apache conf you had it configured on
sudo apache2ctl restart
certbot #follow the guide to setup the new certificate
@libracoder
libracoder / main.tf
Created June 8, 2021 15:35 — forked from danihodovic/main.tf
Terraform - static site using S3, Cloudfront and Route53
variable "aws_region" {
default = "eu-west-1"
}
variable "domain" {
default = "my_domain"
}
provider "aws" {
region = "${var.aws_region}"
@libracoder
libracoder / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Created August 26, 2018 22:28 — forked from Prototype-X/Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@libracoder
libracoder / npm issue
Last active February 1, 2018 19:15
npm issue solution
re-add legacy path to node
~/.nvm/versions/node/v8.8.1/lib/node_modules/npm
for npm in 8.0 version and legacy version
@libracoder
libracoder / EsoftcoinCrowdsale.js
Created January 27, 2018 02:32
EsoftcoinCrowdsale
pragma solidity ^0.4.18;
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
@libracoder
libracoder / geth.js
Last active November 24, 2017 14:32
Mining Etherum
///Genesis.json
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "0x400",