This file contains hidden or 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
| ## Pre-requisite: You have to know your last commit message from your deleted branch. | |
| git reflog | |
| # Search for message in the list | |
| # a901eda HEAD@{18}: commit: <last commit message> | |
| # Now you have two options, either checkout revision or HEAD | |
| git checkout a901eda | |
| # Or | |
| git checkout HEAD@{18} |
This file contains hidden or 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
| git pull origin live | |
| docker-compose build | |
| docker-compose up -d |
This file contains hidden or 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
| import os | |
| import subprocess | |
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| from dotenv import load_dotenv | |
| # We load the env vars from a .env file | |
| load_dotenv() | |
| # Token uses by master to send commands to this node |
This file contains hidden or 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
| FROM linuxserver/wireguard as lugodev_vpn_node | |
| RUN apt-get -y update | |
| RUN apt-get install -y python3.6 python3-pip python-dev build-essential python3-venv | |
| RUN mkdir -p /codebase | |
| ADD . /codebase | |
| WORKDIR /codebase | |
| RUN pip3 install -r requirements.txt |
This file contains hidden or 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
| version: "3" | |
| services: | |
| # https://hub.docker.com/r/linuxserver/wireguard | |
| # A VPN node with Wireguard service and an API exposed over 8008 port, based in FastAPI | |
| lugodev_vpn_node: | |
| build: | |
| context: "." | |
| dockerfile: Dockerfile |
This file contains hidden or 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
| # This is a way (not optimized) to handle menus on your Telegram bot. | |
| # I haven't tested this code, but it should work. | |
| # Join the community: https://t.me/LugodevChat | |
| import telegram | |
| from telegram import InlineKeyboardMarkup, InlineKeyboardButton, ParseMode, ChatAction | |
| def start(update, context): | |
| update.message.reply_text( | |
| text='Hola, selecciona una opción', |
This file contains hidden or 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
| sudo apt-get update | |
| sudo apt-get install software-properties-common | |
| sudo add-apt-repository universe | |
| sudo apt-get update | |
| sudo apt-get install certbot python3-certbot-nginx |
This file contains hidden or 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
| echo 'Port to expose Portainer (9000 is suggested):' | |
| read port | |
| echo Creating Portainer volume... | |
| docker volume create portainer_data | |
| echo Installing and starting up Portainer... | |
| docker run -d -p $port:$port --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer |
This file contains hidden or 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
| sudo apt-get purge -y docker-engine docker docker.io docker-ce | |
| sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce | |
| sudo rm -rf /var/lib/docker /etc/docker | |
| sudo rm /etc/apparmor.d/docker | |
| sudo groupdel docker | |
| sudo rm -rf /var/run/docker.sock |
This file contains hidden or 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
| # Add Docker's official GPG key: | |
| sudo apt-get update | |
| sudo apt-get install ca-certificates curl | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
| sudo chmod a+r /etc/apt/keyrings/docker.asc | |
| # Add the repository to Apt sources: | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
NewerOlder