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 / 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
@yordanoweb
yordanoweb / gpg-usage.md
Last active January 13, 2025 19:52
GPG frequently usages

Generate random string with GPG

gpg --armor --gen-random 2 16
  • The 16 is the amount of bytes
@yordanoweb
yordanoweb / dnscrypt.md
Last active January 13, 2025 19:53
DNS-Crypt in ArchLinux

Use DNSCrypt-Proxy to secure name resolution

Install related packages

pacman -S dnscrypt-proxy

Force system to use dnscrypt-proxy

@yordanoweb
yordanoweb / rotate-90-clockwise-ffmpeg.md
Last active January 13, 2025 19:53
Rotate video 90 degrees clockwise with ffmpeg

Rotate video 90 degrees

ffmpeg -i input_video.mp4 -vf "rotate=0.001" output_video.mp4
@yordanoweb
yordanoweb / zsh-unfreeze-tab-autocomplete.md
Last active January 13, 2025 19:55
Save the day with zsh hang when tab autocomplete freezes

Unfreeze tab autocomplete on ZSH

ohmyzsh/ohmyzsh#7023 (comment)

Basically, edit ~/.zshrc and uncomment the line:

# Uncomment the following line to use case-sensitive completion.
CASE_SENSITIVE="true"
@yordanoweb
yordanoweb / shell-ps1-prompts.md
Last active January 13, 2025 19:55
My shell prompts

Play a little with shell prompt

Some colors

user@host ::: dir $

PS1="\[\033[38;5;141m\]\u\[\033[38;5;209m\]@\[\033[38;5;105m\]\h \[\033[38;5;209m\]::: \[\033[01;37m\]\W \[\033[38;5;209m\]$ \[\033[1;00m\]"