Skip to content

Instantly share code, notes, and snippets.

View admodev's full-sized avatar
🏔️
In the zone

Adolfo Moyano admodev

🏔️
In the zone
View GitHub Profile
@admodev
admodev / javaCommanderPatternExample.java
Created December 17, 2024 19:14
Simple commander pattern example in Java.
public class Main {
public static void main(String[] args) {
Engine v8Engine = new Engine();
Command turnOn = new TurnOnCommand(v8Engine);
Command turnOff = new TurnOffCommand(v8Engine);
RemoteControl remote = new RemoteControl();
remote.setCommand(turnOn);
@admodev
admodev / README.md
Created May 14, 2024 23:39
Un simple script de Python para enviar informes via email en un server smtp.

Instrucciones

Configurar el servidor SMTP: Reemplaza 'smtp.example.com' y 587 con la dirección y el puerto de tu servidor SMTP. Por lo general, esta información la proporciona tu proveedor de correo electrónico.

Credenciales de correo electrónico: Reemplaza 'tu_correo@example.com' y 'tu_contraseña' con tu dirección de correo electrónico y contraseña.

Direcciones de correo electrónico: Cambia 'tu_correo@example.com' por tu dirección de correo electrónico como remitente, y 'destinatario@example.com' por la dirección de correo electrónico del destinatario.

Contenido del correo electrónico: Personaliza el asunto y el cuerpo del correo electrónico según tus necesidades. En el ejemplo, se utiliza la fecha actual para el asunto y un mensaje simple como cuerpo.

x64 NASM cheat sheet

Registers

64 bit 32 bit 16 bit 8 bit
A (accumulator) RAX EAX AX AL
B (base, addressing) RBX EBX BX BL
C (counter, iterations) RCX ECX CX CL
D (data) RDX EDX DX DL
@admodev
admodev / .gitignore
Created October 16, 2023 04:59 — forked from Yousha/.gitignore
.gitignore for PHP developers.
##### Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump

Setup tor proxy on Arch Linux

Copied from this article.

Installation

  1. Install tor

         $ sudo pacman -S tor
         $ ## nyx provides a terminal status monitor for bandwidth usage, connection details and more.

$ sudo pacman -S nyx

@admodev
admodev / tmux.md
Created October 18, 2021 14:26 — forked from scottjwood/tmux.md
tmux cheatsheet

tmux cheat sheet

(CTRL-x means ctrl+x, ALT-x means alt+x)

Prefix key

The default prefix is CTRL-b. If you (or your muscle memory) prefer CTRL-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
@admodev
admodev / tip.md
Created March 17, 2021 02:52
Flask error appepars on windows

If you encounter the following error on Windows when running a flask app: Error could not locate flask application.

Run the following command on PowerShell:

$env:FLASK_APP = "appname"

@admodev
admodev / install-ruby-ubuntu.md
Created September 11, 2020 04:32
Install ruby in ubuntu

Step 1 - Install RVM Ruby Version Manager

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB

curl -sSL https://get.rvm.io | bash -s stable --ruby

source /usr/e.t.c...

rvm get stable --autolibs=enable

usermod -a -G rvm root

@admodev
admodev / Firebase config snippet cheatsheet
Created August 26, 2020 05:09
Snippet para firebase
firebaseConfig = {
apiKey: (this one's easy, it's in the 'General' section in your project settings page, aka the Gear icon button),
authDomain: "{project_id}.firebaseapp.com", (without brackets)
databaseURL: "https://{project_id}.firebaseio.com",
projectId: (again, found in 'General' section in Project Settings),
storageBucket: "{project_id}.appspot.com",
messagingSenderId: (found in 'Cloud Messaging' section in Project Settings)
@admodev
admodev / Change MySQL user password (8.0^)
Created August 25, 2020 12:56
Snippet for changing mysql user password.
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';