# /etc/letsencrypt/renewal/domain.name.conf
[renewalparams]
account =
authenticator = nginx
installer = nginx
server = https://acme-v02.api.letsencrypt.org/directory
This file contains 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 celery import Task | |
from celery.task import task | |
from my_app.models import FailedTask | |
from django.db import models | |
@task(base=LogErrorsTask) | |
def some task(): | |
return result | |
class LogErrorsTask(Task): |
This file contains 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 requests, json | |
api_url = 'https://api.github.com' | |
authorize_url = 'https://github.com/login/oauth/authorize' | |
token_url = 'https://github.com/login/oauth/access_token' | |
class GitHub(): | |
def __init__(self, client_id = '', client_secret = '', access_token = ''): | |
self.client_id = client_id |
This file contains 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/env bash | |
# https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | |
sudo apt update | |
sudo apt install docker-ce | |
# https://docs.docker.com/compose/install/ | |
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose |
- Get mount passphrase:
ecryptfs-unwrap-passphrase /home/username/.ecryptfs/wrapped-passphrase
-
Store it in a safe place
-
Mount drive with encrypted home directory to other OS, then:
sudo ecryptfs-recover-private /home/username/.Private
This file contains 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 26 > /sys/class/gpio/export | |
echo out > /sys/class/gpio/gpio26/direction | |
echo 1 > /sys/class/gpio/gpio26/value | |
gpio -g read 26 | |
This file contains 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 http.client | |
import requests | |
import atexit | |
import sys | |
from socket import gaierror | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36', | |
'Accept': 'application/json, text/javascript, */*; q=0.01', | |
'Content-Type': 'application/json; charset=UTF-8', |
This file contains 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 timeit import default_timer as timer | |
import requests as req | |
start = timer() | |
req.get(r'https://speedtest.selectel.ru/10MB') | |
print('Download speed [mbits/s]:', round(80 / (timer() - start))) |
NewerOlder