Skip to content

Instantly share code, notes, and snippets.

View yordanoweb's full-sized avatar
💭
I may be slow to respond.

Yordano Pascual Rivera yordanoweb

💭
I may be slow to respond.
  • Freelancer
  • Las Tunas, Cuba
View GitHub Profile
@yordanoweb
yordanoweb / png_from_pandas_df.md
Created June 21, 2024 13:59
Create a PNG table image from a Pandas Dataframe
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd


data = {'  A  ': [0, 0, 0.012, 0, 0, 0, 0],
        '  B  ': [0.1, 0, 0.035, 0.12, 0, 0, 0],
        '  C  ': [0, 0, 0, 0, 0.5, 0, 0.2],
        '  D  ': [0, 0.23, 0, 0, 0, 0, 0.33],
@yordanoweb
yordanoweb / pre-commit-golang.md
Created April 6, 2024 22:32
Prepare Golang project for pre-commit

Steps to prepare a Golang project for pre-commit stuff

sudo pamac install pre-commit
sudo npm install -g @commitlint/cli @commitlint/config-conventional
vi /root/golang/project/commitlint.config.js
// /root/golang/project/commitlint.config.js

LUA config with some helpers for LunarVim

local lspconfig = require('lspconfig')

-- Detect if in a Go project
local function is_go_project()
  local go_files = vim.fn.globpath(vim.fn.getcwd(), '*.go', true, true)
 local go_mod_file = vim.fn.findfile('go.mod', vim.fn.getcwd())
@yordanoweb
yordanoweb / cmd-brightness.md
Last active January 30, 2024 02:30
Reduce or increase laptop display brightness from command line

Reduce or increase laptop display brightness from command line

Note: Recently my Archlinux distro stop responding to the shortcut Fn+F3 and Fn+F4 for screen brightness adjustment. Then I found this solution at: https://www.ejmastnak.com/tutorials/arch/backlight/.

First, find out the value of your laptop.

cat /sys/class/backlight/intel_backlight/brightness
@yordanoweb
yordanoweb / find-exec-package.md
Created January 24, 2024 16:00
Find the package of executable with Pacman

Find the package of executable

pacman -Qo executable_name_without_path

For example:

@yordanoweb
yordanoweb / fix-dirty-ntfs.md
Created January 17, 2024 16:11
Fix dirty NTFS disk from Linux

Fix dirty NTFS disk from Linux

The problem

Sometimes when try to mount an NTFS disk in Linux, you get at journalctl the error:

ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: It is recommened to use chkdsk.
ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: volume is dirty and "force" flag is not set!
@yordanoweb
yordanoweb / get-control-resolve.conf.md
Last active July 21, 2024 19:38
Get full control of resolv.conf

Get full control of resolv.conf

Edit NetworkManager.conf

Open /etc/NetworkManager/NetworkManager.conf and add:

[main]
dns=none
@yordanoweb
yordanoweb / go-win-from-linux.md
Last active December 24, 2023 22:45
Compile Go for Windows from Linux

Install zig

By any means, using default distro package manager, or any other method, install zig. Please, install zig first...

Compile project

CGO_ENABLED=1 \
    GOOS=windows \
 GOARCH=amd64 \
@yordanoweb
yordanoweb / compare-str-cmd-line.md
Created December 11, 2023 19:25
Compare two strings from command line
[ "$string1" = "$string2" ] && echo OK || echo NO
@yordanoweb
yordanoweb / modify-resolv.conf.md
Created November 18, 2023 17:56
Free access to resolv.conf

Check that resolv.conf is inmutable

lsattr /etc/resolv.conf

If it is, the previous command will output something like this:

----i---------e------- /etc/resolv.conf