Skip to content

Instantly share code, notes, and snippets.

View acalatrava's full-sized avatar

Antonio Calatrava acalatrava

  • Mobile Innovations SL
  • Spain
  • 23:45 (UTC +01:00)
  • X @acalatrava
View GitHub Profile
@acalatrava
acalatrava / README.md
Last active November 13, 2024 15:35
SSH over WebSockets

SSH over WebSocket

Stuck behind restrictive firewalls or deep packet inspection? This project lets you tunnel SSH connections through WebSockets, bypassing most limitations on standard SSH ports.


Why This Project Exists

While receiving treatment in the hospital, I encountered a common problem: restricted internet access with only hospital Wi-Fi available, and a firewall blocking SSH (even on port 443). They were also using Deep Packet Inspection, preventing SSH traffic over non-standard ports.

@acalatrava
acalatrava / README.md
Created April 11, 2024 08:47
Docker Volume Backup and Restore Script

Docker Volume Backup and Restore Script

Overview

This Bash script automates the process of exporting all Docker volumes to a compressed archive, creating a portable script for restoring these volumes on another system. It includes the generation of a recover.sh script for restoring the volumes from the archive and wraps everything into a self-executable import.sh script for easy transportation and execution.

Prerequisites

  • Docker installed on the host machine.
  • Bash shell environment.
  • Sufficient disk space for the backup files.
@acalatrava
acalatrava / finetune.py
Last active September 22, 2023 11:54
QLORA FineTuning
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Original file https://github.com/jzhang38/TinyLlama/blob/main/sft/finetune.py
#
"""
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
pip install accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7
pip install scipy evaluate tqdm pandas packaging
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDO4FyRqgNGTBmYZwihUW5E85R8TNWuiETT5yXp8EVRnv0bkJMn2R2sUSfcAip+/N+q/Rn+iM/tLR3GiHwjWn3i+IDzeHDvU6tjlPsjLs0LxehnJXKtgFlwInY5IYWRByW6MQpVh2GTy1OCO3TvMpuXcTfAcNsg9qX3+/AhjcuAcu54ybjsgVeyl5lrWFxc17B0dUH11zh3HPo2gASB/QJlQIOmXMp+hpoL++I3hMKRduiNV8ArQrDO7y6GUwln5oZnRV6lh46bm4fCxuwqF1T19dOutU2XunFXq9Jad4k5cxranRnQdJxVSvqEwUhEyyzPUbf07RWRSi8jAGJscIn5 antonio@iMac