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 / 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 February 23, 2025 16:23
Compile Go for Windows from Linux

Compile to Windows executable 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 \
@yordanoweb
yordanoweb / compare-str-cmd-line.md
Last active January 13, 2025 19:50
Compare two strings from command line

Compare strings in command line

[ "$string1" = "$string2" ] && echo OK || echo NO
@yordanoweb
yordanoweb / modify-resolv.conf.md
Last active January 13, 2025 19:50
Free access to resolv.conf

Conquer resolv.conf

Check that resolv.conf is inmutable

lsattr /etc/resolv.conf

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

@yordanoweb
yordanoweb / mysql-useful-queries.md
Last active February 23, 2025 16:26
MySQL useful queries

Useful SQL queries

List databases by creation date

SELECT table_schema AS Database_Name, MIN(create_time) AS Creation_Time FROM information_schema.tables WHERE table_schema like 'some_db_name%' Group by table_schema;

List databases with size

@yordanoweb
yordanoweb / retry-command.md
Last active January 13, 2025 19:51
Retry command

Retry command

timeout 10 bash -c 'until git push -v; do sleep 10; done'

Create RRD with custom options

#!/bin/sh

###################################################
# Create the graph first
###################################################
#
# rrdcreate wlan-traffic.rrd --start now-2h --step 60 DS:in:COUNTER:120:U:2000000 DS:out:COUNTER:120:U:2000000 RRA:AVERAGE:0.5:1:525600 RRA:AVERAGE:0.5:60:8760