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 / 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
[email protected]
@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 {
@i-amolo
i-amolo / main.go
Created May 15, 2023 07:43 — forked from dopey/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
Example infrastructure outage incident report
Friday, May 13, 2077
By the Example Security Team
Earlier this week we experienced an outage in our API infrastructure. Today we’re providing an incident report that details the nature of the outage and our response.
The following is the incident report for the Example Security outage that occurred on April 30, 2077. We understand this service issue has impacted our valued developers and users, and we apologize to everyone who was affected.
@i-amolo
i-amolo / config.md
Created May 1, 2023 10:32 — forked from tmkasun/config.md
How to configure nginx as a revers proxy for WSO2 API Manager SPA apps

For APIM 3.0.0

Update deployment.toml

[transport.https.properties]
proxyPort = 443

[server]
hostname = "knnect.lk"