Skip to content

Instantly share code, notes, and snippets.

View i-amolo's full-sized avatar

Innocent J. Blacius i-amolo

View GitHub Profile
@i-amolo
i-amolo / nginx.conf
Created April 10, 2024 21:08 — forked from weapp/nginx.conf
Return common errors as json in Nginx
error_page 500 /500.html;
location /500.html{
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}';
}
error_page 502 /502.html;
location /502.html{
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}';
}
@i-amolo
i-amolo / !Nginx Basic Auth.md
Created April 10, 2024 21:05 — forked from laurentbel/!Nginx Basic Auth.md
Nginx reverse proxy with basic authentication

Nginx Basic Auth

A simple demo of using Nginx as a reverse proxy to add basic authentication.

@i-amolo
i-amolo / API.md
Created February 18, 2024 16:37 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@i-amolo
i-amolo / mysql_root_password_changes_on_centos7.txt
Created February 14, 2024 10:25 — forked from kangmasjuqi/mysql_root_password_changes_on_centos7.txt
Change/Reset MySQL Root password on Centos 7
https://stackoverflow.com/questions/33510184/change-mysql-root-password-on-centos7/34207996#34207996
1. Stop mysql:
systemctl stop mysqld
2. Set the mySQL environment option
systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
3. Start mysql usig the options you just set
systemctl start mysqld
@i-amolo
i-amolo / .env
Created October 16, 2023 21:25 — forked from tderick/.env
.env file for docker-compose file to deploy a keycloak server
KEYCLOAK_VERSION=16.1.1
PORT_KEYCLOAK=8080
POSTGRESQL_USER=keycloak
POSTGRESQL_PASS=keycloak
POSTGRESQL_DB=keycloak
VIRTUAL_HOST=example.com
LETSENCRYPT_HOST=example.com
LETSENCRYPT_EMAIL=example@gmail.com
@i-amolo
i-amolo / TimeZone.md
Created August 19, 2023 20:20 — forked from sjimenez44/TimeZone.md
Change time zone Docker container

Change TimeZone in Docker containers

With Docker Engine

The timezone of a container can be set using an environment variable in the docker container when it is created. For example:

$ docker run ubuntu:latest date
Sat Feb 27 15:58:32 UTC 2021
$ docker run -e TZ=America/Bogota ubuntu:latest date
Sat Feb 27 15:58:40 Asia 2021
@i-amolo
i-amolo / guid-sql-server.sql
Created August 15, 2023 12:39 — forked from akkidas/guid-sql-server.sql
Generate New Guid (uniqueidentifier) in SQL Server
-- If you want to generate a new Guid (uniqueidentifier) in SQL server the you can simply use the NEWID() function.
SELECT NEWID()
GO
-- This will return a new random uniqueidentifier e.g.
E75B92A3-3299-4407-A913-C5CA196B3CAB
To select this Guid in in a variable
--assign uniqueidentifier in a variable
DECLARE @EmployeeID uniqueidentifier
@i-amolo
i-amolo / docker-compose.yaml
Created July 4, 2023 15:01 — forked from rossnelson/docker-compose.yaml
golang and ms sqlserver using sqlx and go-mssqldb
version: '3'
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-CU8-ubuntu
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=Melon40twomonkeys
ports:
- '1433:1433'
@i-amolo
i-amolo / pool_cx_oracle.py
Created June 26, 2023 19:44 — forked from Calzzetta/pool_cx_oracle.py
Connection pool with cx_Oracle
import cx_Oracle
def perform_query(query, bind_variables):
connection = db_pool.acquire()
cursor = connection.cursor()
cursor.execute(query, bind_variables)
result = cursor.fetchall()
cursor.close()
db_pool.release(connection)
return result
input {
kafka{
codec => json
bootstrap_servers => "localhost:9092"
topics => ["elastic-test"]
}
}
filter {
mutate {