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 / 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"
@i-amolo
i-amolo / gist:d1c74386e699e72f984a69c42e2b3868
Created April 30, 2023 11:49 — forked from djangofan/gist:2493145
Using etc alternatives to set default Java on CentOS
[user@www]# alternatives --install /usr/bin/java java /opt/jdk1.6.0_07/bin/java 2
[user@www]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /opt/jdk1.6.0_07/bin/java
@i-amolo
i-amolo / install.md
Created March 11, 2023 08:16 — forked from Ryanb58/install.md
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@i-amolo
i-amolo / logging.conf
Created March 9, 2023 08:27 — forked from philippegirard/logging.conf
FastAPI logging
[loggers]
keys=root,uicheckapp
[handlers]
keys=consoleHandler,detailedConsoleHandler
[formatters]
keys=normalFormatter,detailedFormatter
[logger_root]
@i-amolo
i-amolo / log.py
Created March 9, 2023 08:21 — forked from nguyenkims/log.py
Basic example on how setup a Python logger
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
LOG_FILE = "my_app.log"
def get_console_handler():
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update
@i-amolo
i-amolo / docker_docker-compose_centos7.md
Last active February 1, 2023 21:20 — forked from odaku/docker_docker-compose_centos7.md
docker and docker compose installation guide

Install Docker CE


Update the CentOs 7 package manager

# yum update
# yum upgrade
# yum clean all

Make sure that you don't have a docker version installed on your system

```sql
CREATE USER 'login'@'localhost' IDENTIFIED BY 'pass';
GRANT SELECT,UPDATE,INSERT ON dbname.* TO 'login'@'localhost';
GRANT ALL PRIVILEGES ON dbname.* TO 'login'@'localhost';
FLUSH PRIVILEGES;
```
Если: An exception occurred in driver: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
То: ALTER USER 'zabbix_yurchenko'@'localhost' IDENTIFIED WITH mysql_native_password BY 'zabbix_yurchenko';