Skip to content

Instantly share code, notes, and snippets.

View stdevPavelmc's full-sized avatar

Pavel Milanes (CO7WT) stdevPavelmc

View GitHub Profile
@stdevPavelmc
stdevPavelmc / opiprime-skywire-fix.sh
Created November 13, 2018 13:11
Fix the issue #80 (https://github.com/skycoin/skywire/issues/80) in skycoin/skywire repo
#!/bin/bash
# ** Goal **
# Update the init script of the skywire services running on this pc to
# fix a bug (https://github.com/skycoin/skywire/issues/80)
#
# ** Why? **
# A few time ago the dev team changed the skywire code to make it more
# portable using dynamic paths (learning for the environment, that's
# the right way to doit) But the image was still configured in a static
# way and that break the nodes once you update the skywire code.
@stdevPavelmc
stdevPavelmc / extract.py
Created January 9, 2019 21:36
Python3 tarfile extraction with a pprogress callback function
#!/usr/bin/env python3
# A sample code to have a tarfile extraction handle a progress callback
# tarfile must handle gz, bz2 & xz files transparently
# Author: pavelmc@gmail.com
# Title: tar extraction with progress bar
import io
import os
import tarfile
#!/bin/sh
######################################################################
# Convert Youtube AV1 video files, Gnome nautilus script
#
# You need ffmped, mencoder and aom video encoder/decoder for AV1 video
#
# Goal here is to convert it as fast as it can with so-so resolution
# and playable in any embedded device, specs follows
#
#!/bin/sh
######################################################################
# Convert Youtube AV1 video files, Gnome nautilus script
#
# You need ffmped, mencoder and aom video encoder/decoder for AV1 video
#
# Goal here is to convert it as fast as it can with so-so resolution
# and playable in any embedded device, specs follows
#
#!/bin/sh
######################################################################
# Convert Youtube AV1 video files, Gnome nautilus script
#
# You need ffmped, mencoder and aom video encoder/decoder for AV1 video
#
# Goal here is to convert it as fast as it can with so-so resolution
# and playable in any embedded device, specs follows
#
@stdevPavelmc
stdevPavelmc / Cell_Modem_3G.md
Last active September 15, 2022 15:28
How to use your Android Phone as a 3G/4G modem and save you mobile data

How to use your Android Phone as a 3G/4G modem and save you mobile data

Este tutorial tiene una versión en español

Why?

Maybe you has a plain data plan with your cell carrier and this don't care to you, but in Cuba the data plans are expensive and we need to squeeze even the last byte of data from it

Some times you face this scenario: You connect your Cell Phone to the mobile data and set it up as a WiFi hostspot to share the internet with your work PC or Laptop; this is Ok, but then you have a dual waste of bandwidth; yes, think about it:

@stdevPavelmc
stdevPavelmc / Cell_Modem_3G_es.md
Last active October 21, 2022 23:41
Usa tu celular android como un modem 3G/4G y ahorra datos móviles

Como usar tu celular Android como modem para 3G/4G y ahorrar datos

This tutorial has an english version

Porque?

Quizás tu usas un proveedor de telefonía que tiene entre sus ofertas una tarifa plana, o una bien generosa y que te alcanza, pero en Cuba no existe tarifa plana y tendemos a exprimir cada byte de la conexión de datos.

Puede que te hayas topado con este caso: usas los datos móviles del celular compartidos por WiFi con la PC/Laptop de trabajo y no hay nada malo con eso, o si?

{"version":1,"resource":"file:///home/pavel/Documentos/ChagodTours/shago_website/docker/develop/postgres/backup.sh","entries":[{"id":"oJRg.sh","timestamp":1655934982623},{"id":"M5V9.sh","timestamp":1656571835313}]}
@stdevPavelmc
stdevPavelmc / Disable_Gnome_tracker_for_good.md
Last active April 12, 2022 20:21
Disable tracker in Gnome 38-4x

Disable tracker in Gnome 38-4x

Tested on Gnome 40.x/41.x/42.x (Ubuntu) but must work on 38.x and grater.

Stop, disable & mask the services in the userspace (all in just one line):

The code is arranged to easy [human] inspection, read it before proceed; be aware that copy & pasting code on the internet is a bad pactice.

Copy the code below and paste it on your terminal + enter, no sudo is needed.

@stdevPavelmc
stdevPavelmc / microk8s_registry_prune.sh
Last active May 22, 2023 16:10
Microk8s own registry on http://localhost:32000/ can get your drive full with time if you have a lot of images and/or tags; so I made a script based on solutions out in the internet about it, but it's an all in one; Just copy it to your server and run it weekly, monthly or wharever schedule fits you.
#!/bin/bash
# Author: Pavel Milanes <pavelmc@gmail.com>
# Goal: Prune the microk8s registry from unused images
# Date: May 2023
# force install needed tools: git, python3-pip, jq, curl...
apt-get install git python3-pip curl jq -y
# get the list of runing container images, install the soft if not there