This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yt-dlp -v --ignore-config --split-chapters -o 'chapter:%(title)s - %(section_number)02d - %(section_title)s.%(ext)s' -f bestaudio[ext=m4a] --extract-audio --embed-thumbnail 'https://youtube.com/watch?v=aaaaaa' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using bootloader | |
# To enter bootloader, connect the board to the computer and connect briefly the GND and RST pins. | |
# Some boards may require this connection to be done twice. | |
# When the bootloader is running, a virtual serial connection is created and so we can read/write to the device | |
# Checking connection and fuses | |
avrdude -c avr109 -p m32u4 -P /dev/ttyACM0 -n | |
# It should write something like the example below | |
# Connecting to programmer: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I had to automate a few tasks in my browser with my current logged session, but by default | |
# Selenium always starts a new session. | |
# After some research, the only way I found to attach Selenium to my running browser session | |
# was through the debugger address option. | |
# Start chrome with the command line option: google-chrome --remote-debugging-port=8181 | |
# Then start selenium webdriver with the debug address option (I could only find the option | |
# in latest selenium-webdriver gem (v4.0)) | |
require 'bundler/inline' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euox pipefail | |
# Build Emacs 28 with GTK and native compilation. | |
# The pure GTK implementation enable native support in Wayland. | |
# Apt dependencies are for Ubuntu 20.04. | |
march=${1:-native} | |
mtune=${1:-native} | |
emacs_git_dir=emacs-pgtk-nativecomp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Usage | |
# ./install.sh # defaults to 2.3.8 | |
# ./install.sh 2.3.3 | |
# Explanation | |
# Ruby 2.3 or lower only support OpenSSL 1.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Original source: https://smartnets.wordpress.com/2017/04/27/create-certificate-chain-and-sign-certificates-using-openssl/ | |
# RootCA.crt and IntermediateCA.crt must be manually trusted in the certificate store | |
# The Server.pfx is optional and can be imported directly in IIS certificates settings | |
# The Server.csr is optional | |
openssl genrsa -out RootCA.key 4096 | |
openssl req -new -x509 -days 1826 -key RootCA.key -out RootCA.crt | |
openssl genrsa -out IntermediateCA.key 4096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Payment | |
attr_reader :authorization_number, :amount, :invoice, :order, :payment_method, :paid_at | |
def initialize(attributes = {}) | |
@authorization_number, @amount = attributes.values_at(:authorization_number, :amount) | |
@invoice, @order = attributes.values_at(:invoice, :order) | |
@payment_method = attributes.values_at(:payment_method) | |
end | |
def pay(paid_at = Time.now) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Building Ruby 2.3.x | |
PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig asdf install ruby 2.3.8 | |
# Fedora | |
# https://www.tecmint.com/configure-software-repositories-in-fedora/ |