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 / 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';
@i-amolo
i-amolo / inTheLifeMediaSearch.php
Created October 25, 2022 10:56 — forked from johnschimmel/inTheLifeMediaSearch.php
PHP SOAP request using CURL to retrieve In The Life Station listings
<?php
function getListingsViaSoap($zipcode) {
$url = "http://www.tracmedia.com/lol/LOLService.asmx";
$soap_request = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<InTheLife xmlns="http://tracmedia.org/">
@i-amolo
i-amolo / Revealing-Module-Pattern.md
Created October 21, 2022 20:40 — forked from zcaceres/Revealing-Module-Pattern.md
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

What else can you do?
How to clone repository to a specific commit? (full clone)
# Create empty repository to store your content
git clone <url>
git reset <sha-1> --hard
More info:
How to clone single branch?