Skip to content

Instantly share code, notes, and snippets.

View miguelms95's full-sized avatar
💻
Developing

Miguel Martínez Serrano miguelms95

💻
Developing
View GitHub Profile
@miguelms95
miguelms95 / guide-download-from-yt-dlp.md
Last active June 2, 2025 14:47
yt-dlp download from CLI audio / video

MacOS instructions:

  1. Install:
brew install yt-dlp
  1. Verify installation:
yt-dlp --version
@miguelms95
miguelms95 / install_rvm_ubuntu_22.txt
Created January 16, 2023 23:01
Install rvm ruby in ubuntu 22.04, with custom openssl
rvm pkg install openssl
# install version you want, chec the openssl path
rvm install 2.7.6 --with-openssl-dir=/usr/share/rvm/usr
@miguelms95
miguelms95 / close_ubuntu_laptop_lid_behaviour.md
Last active January 20, 2022 14:51
Configure Ubuntu behaviour when laptop lid is closed

To configure Ubuntu's behaviour when the laptop's lid is been closed.

  1. Open the /etc/systemd/logind.conf file in a text editor as root
sudo vim /etc/systemd/logind.conf
  1. Check if HandleLidSwitch is commented and set the value you want. 2.1. Available options: ignore, poweroff, reboot, halt, kexec, suspend, hibernate, hybrid-sleep, suspend-then-hibernate, lock, and factory-reset. logind.conf documentation.
@miguelms95
miguelms95 / script_skip_paywall_elconfidencial.js
Created February 14, 2021 23:26
Script to skip the paywall popup at El Confidencial
// Post available at: https://medium.com/@miguelms-es/paywalls-vulnerables-el-confidencial-el-espa%C3%B1ol-parte-2-31d92df4fb46
var removePaywall = setInterval(() => {
if(document.getElementsByClassName("tp-modal").length > 0){
document.getElementsByClassName("tp-modal")[0].remove();
document.getElementsByClassName("tp-backdrop")[0].remove();
document.getElementsByClassName("tp-modal-open")[0].classList.remove("tp-modal-open");
console.log("paywall unlocked");
clearInterval(removePaywall);
}else{
console.log("Checking paywall popup")
@miguelms95
miguelms95 / .travis.yml
Created February 13, 2021 23:47
Travis continuous integration example file for a Maven Java SpringBoot application
language: java
jdk:
- oraclejdk11
script: mvn test
before_install:
- chmod +x mvnw
@miguelms95
miguelms95 / reset-mysql-root-password.txt
Last active November 30, 2021 21:53
Reset Mysql root password
-- 1. Enter to mysql DB with sudo user
sudo mysql
-- 2.1 if MySQL5 update the password and flush privileges
UPDATE mysql.user SET authentication_string=PASSWORD('your-new-password'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost';
-- 2.2 if Mysql 8:
UPDATE mysql.user set plugin='mysql_native_password' WHERE User='root' AND Host='localhost';
SET PASSWORD for 'root'@'localhost' = '';
@miguelms95
miguelms95 / Ruby Check Parenthesis syntax algorithm
Last active June 18, 2020 17:00
Check the parenthesis syntax ina string, mathematycal expression.
# Today I was asked to solve this Algorithm problem in a job interview. I did pseudo-code, but here's the ruby one.
# Validate if the mathematical parenthesis syntax is correct
a = ["(2+3)*4+(5/3)+(2)", "()())", ")()()"] # true, false false
def checkMath(input_expresion)
counter = 0
for i in 0..input_expresion.length-1
if counter<0