Копируем публчиный ключ на сервер:
ssh-copy-id server
Добавляем ключ в authorizedkeys, чтобы не вводить пароль:
import sqlite3 | |
conn = sqlite3.connect('date.db') | |
cur = conn.cursor() | |
cur.execute("""CREATE TABLE IF NOT EXISTS users( | |
id INTEGER PRIMARY KEY AUTOINCREMENT, | |
name TEXT, | |
password TEXT);""") | |
conn.commit() |
import time | |
def random(): | |
getTime = time.time() | |
randInt = getTime % 1 | |
randInt = str(randInt) |
#!/bin/sh | |
session_name='project' | |
path=~/work/project | |
pg=project_db | |
set -euC | |
cd $path | |
att() { |
[Unit] | |
Description=Rebind my keyboard via kbct | |
[Service] | |
Type=simple | |
ExecStart=sudo kbct remap --config /home/arthur/.config/kbct.yaml | |
Restart=always | |
[Install] | |
WantedBy=default.target |
import pprint | |
import requests | |
from bs4 import BeautifulSoup as bs | |
URL = 'https://freelance.habr.com/tasks' | |
categorie = '?categories=development_bots' | |
resp = requests.get(URL+categorie) |
# import uvicorn | |
if __name__ == "__main__": | |
uvicorn.run("main:app", host="0.0.0.0", port=8000, log_level="info") |
#!/usr/bin/bash | |
ADMIN_USER=arthur | |
echo Bot Name | |
read name | |
useradd -s /bin/bash $name | |
mkdir /home/$name |
import aiohttp | |
import asyncio | |
import requests | |
import time | |
async def aio(): | |
URL = 'https://cleanuri.com/api/v1/shorten' | |
links = ['https://artlin.codeberg.page/contacts.html'] * 10 |
import bs4 as bs | |
import requests | |
URL = 'http://www.cbr.ru/scripts/XML_daily.asp?date_req=' | |
def get_rate(code: str, date: str = '') -> float: | |
date = reversed(date.split('-')) | |
date = '/'.join(str(x) for x in date) |