Skip to content

Instantly share code, notes, and snippets.

View mariotpc's full-sized avatar
🎯
Focusing

Mario Enrique Lopez Guzman mariotpc

🎯
Focusing
View GitHub Profile
@mariotpc
mariotpc / Test stream for YouTube Live
Created June 8, 2021 17:33
Test stream for YouTube Live
#!/bin/sh
YT_SERVER="rtmp://a.rtmp.youtube.com/live2"
# Needs AUTH, which is the "Stream Name" from Ingestion Settings > Main Camera
# apt-get install --assume-yes gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools
# https://bugzilla.gnome.org/show_bug.cgi?id=731352#c6
@mariotpc
mariotpc / Kodi doesn't activate HDMI sink
Last active May 29, 2021 14:11
Kodi doesn't activate HDMI sink
The next work's to me
hdmi_ignore_edid=0xa5000080
framebuffer_width=1920
framebuffer_height=1080
hdmi_force_hotplug=1
hdmi_group=1
hdmi_mode=16
@mariotpc
mariotpc / Backup and Restore SD Card - Raspberry Pi
Last active March 29, 2021 17:16
Backup and Restore SD Card - Raspberry Pi
To Backup on SD card:
Code: Backup
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image`date +%d%m%y`.gz
This will compress the image using gzip.
To restore the backup on SD card:
Code: Restore
sudo gzip -dc /home/your_username/image.gz | dd bs=4M of=/dev/sdb
@mariotpc
mariotpc / Minikube baremetal driver
Created March 16, 2021 02:05
Minikube baremetal driver
[root@rpi we12453a12]# docker info
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
Server:
Containers: 42
@mariotpc
mariotpc / Minikube-ARM64
Last active March 15, 2021 16:22
Minikube-ARM64
Mandatory set it - very bottom of the sudoers file
*******************************************************************************
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
username (989sd898d ) ALL=(ALL) NOPASSWD: /usr/bin/podman
Was using podman instead docker backend.
******************************************
@mariotpc
mariotpc / port translate between localhost to docker or podman container
Last active March 12, 2021 18:12
port translate between localhost to docker or podman container
Useful to me...!
podman run -d --name mariotpc-psql -e POSTGRES_PASSWORD="password" -e PGDATA=/var/lib/postgresql/data/pgdata -d -p 5432:5432 postgres
[root@rpi mariotpc]# podman ps -al
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
500e4c9ca19a docker.io/library/postgres:latest postgres About a minute ago Up About a minute ago 0.0.0.0:5432->5432/tcp mariotpc-psql
@mariotpc
mariotpc / Install mySQL-mariaDB on Alpine
Last active February 8, 2021 20:57
Install mySQL-mariaDB on Alpine
Alpine Linux has dummy counterparts packages for those that are not close to that change from mysql to mariadb naming packages.
First One:
###########################
install the software:
alpine:/home/mariotpc# apk add mysql mysql-client
Second One
##############################
Execute the setup, using systemV script
@mariotpc
mariotpc / NGINX with PHP7
Created January 27, 2021 01:19
NGINX with PHP7
As the first step install whole packages for php7
#########################################################
apk add php7-fpm php7-mcrypt php7-soap php7-openssl php7-gmp php7-pdo_odbc php7-json php7-dom php7-pdo php7-zip php7-mysqli php7-sqlite3 php7-apcu php7-pdo_pgsql php7-bcmath php7-gd php7-odbc php7-pdo_mysql php7-pdo_sqlite php7-gettext php7-xmlreader php7-xmlrpc php7-bz2 php7-iconv php7-pdo_dblib php7-curl php7-ctype
Second:
Defining ENV variables which will be used in configuration. You can do this e.g. in /etc/profile.d/php7.sh
PHP_FPM_USER="www"
PHP_FPM_GROUP="www"
PHP_FPM_LISTEN_MODE="0660"
PHP_MEMORY_LIMIT="512M"
@mariotpc
mariotpc / my NGINX conf - taken from Alpine Linux site
Last active January 27, 2021 00:29
my NGINX conf - taken from Alpine Linux site
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.orig
vi /etc/nginx/nginx.conf
##################### CONF #############################
alpine:/home/mariotpc# cat /etc/nginx/nginx.conf
user www;
worker_processes auto; #it will be determinate automatically by the number of core
error_log /var/log/nginx/error.log warn;
@mariotpc
mariotpc / Configure SNMP on my Server
Last active January 20, 2021 01:44
Configure SNMP on my Server
First all I found that the package net-snmp must be installed on the system
After install the package, the file snmpd.conf must be edited in order to allow the queries
In my case, just add...
rocommunity secret 186.151.0.0/16 # <- network for example pourposes
configure iptables on the server to let UDP traffic flow on port 161,162
iptables -D IN_public_allow -s 186.151.XXX.XXX -p udp -m udp --dport 161 -j ACCEPT