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 django.test import TestCase | |
from rest_framework.test import APIClient | |
class FileUploadTestCase(TestCase): | |
def test_upload(self): | |
client = APIClient() | |
client.credentials(HTTP_AUTHORIZATION='Token ' + self.token.key) | |
# or self.client (Django https://docs.djangoproject.com/en/dev/topics/testing/advanced/) | |
response = client.post(reverse('upload-file'), { |
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
const Telegraf = require("telegraf"); | |
const bot = new Telegraf("TOKEN"); | |
bot.catch((err) => { | |
console.error('Ooops', err); | |
process.exit(1); // I choose exit, you should use PM (Process Manager) and let them automatically restart the bot | |
// Or sth else | |
}) |
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
# Private key | |
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048 | |
# Public key | |
openssl rsa -pubout -in private.pem -out public_key.pem | |
# Private key in pkcs8 format (for Java maybe :D) | |
openssl pkcs8 -topk8 -in private.pem -out private_key.pem | |
## nocrypt (Private key does have no password) |
OlderNewer