Skip to content

Instantly share code, notes, and snippets.

View williams9438's full-sized avatar

Williams Olawale williams9438

View GitHub Profile
@williams9438
williams9438 / gke-fullpilot.sh
Created November 6, 2023 08:07 — forked from lmakarov/gke-fullpilot.sh
Create a GKE Standard cluster matching GKE Autopilot configuration (aka Fullpilot)
# Configuring gcloud
export PROJECT_ID=my-project-12345
export COMPUTE_REGION=us-central1
gcloud components update
gcloud config set project ${PROJECT_ID}
gcloud config set compute/region ${COMPUTE_REGION}
# Setting up a GKE cluster
export CLUSTER_NAME=my-cluster-1
@williams9438
williams9438 / pint.json
Created June 21, 2023 20:34 — forked from JustSteveKing/pint.json
Laravel Pint configuration
{
"preset": "psr12",
"rules": {
"align_multiline_comment": true,
"array_indentation": true,
"array_syntax": true,
"blank_line_after_namespace": true,
"blank_line_after_opening_tag": true,
"combine_consecutive_issets": true,
"combine_consecutive_unsets": true,
@williams9438
williams9438 / create-database.sh
Created May 11, 2023 12:36 — forked from entzik/create-database.sh
A shell script to create a postgres database on AWS RDS
#!/bin/sh
aws rds create-db-instance \
--db-instance-identifier HomeAutomationDB \
--db-instance-class db.t2.micro \
--region eu-west-3 \
--engine postgres \
--allocated-storage 5 \
--no-publicly-accessible \
--db-name homeautomation \
@williams9438
williams9438 / connect-heroku-app-to-postgres-rds-with-ssl.md
Created December 14, 2021 14:48 — forked from glarrain/connect-heroku-app-to-postgres-rds-with-ssl.md
How to connect a Heroku application to an Amazon RDS PostgreSQL instance, forcing SSL and certificate chain verification

1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:

wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

2 - Add config/rds-combined-ca-bundle.pem to the repository and redeploy to Heroku.

3 - Update the DATABASE_URL env var:

#!/bin/env/python
import hashlib
import binascii
# Utility methods for generating and comparing RabbitMQ user password hashes.
#
# Rabbit Password Hash Algorithm:
#
# Generate a random 32 bit salt:
# CA D5 08 9B
@williams9438
williams9438 / rmq_passwd_hash.py
Created July 31, 2021 01:00 — forked from anapsix/rmq_passwd_hash.py
generate RabbitMQ compatible SHA256 password hash
#!/usr/bin/env python
# details on rabbitMQ password hashing
# https://www.rabbitmq.com/passwords.html#computing-password-hash
from __future__ import print_function
import base64
import os
import hashlib
import struct
import getpass
@williams9438
williams9438 / age_counting.php
Created February 14, 2021 07:48 — forked from Gerst20051/age_counting.php
PHP Age Counting
<?php
// Your goal is to count how many items exist that have an age equal to or greater than 50, and print this final value.
$ch = curl_init('https://coderbyte.com/api/challenges/json/age-counting');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
@williams9438
williams9438 / fancybutton.md
Created June 25, 2019 08:35 — forked from citrusui/fancybutton.md
How to add a fancy Direct Message button to your Tweets https://twitter.com/citrusui/status/719279185123012609

How to add a fancy Direct Message button to your Tweets

Step 1: Go to gettwitterid.com and enter your username.

Step 2: Copy your user ID from the previous website.

Step 3: Copy the following URL:

@williams9438
williams9438 / Class file
Created January 21, 2019 06:09 — forked from samatsav/Class file
Convert PHP arrays to XLS
<?php
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@williams9438
williams9438 / .gitlab-ci.yml
Created December 10, 2018 15:41 — forked from vojtasvoboda/.gitlab-ci.yml
GitLab CI FTP deploy with mwienk/docker-lftp docker image
stages:
- test
- deploy
cache:
paths:
- vendor
# test job
test: