Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
barseghyanartur / no_more_leaking_secrets.rst
Created Jan 11, 2023
Protect yourself from accidentally leaking sensitive information
View no_more_leaking_secrets.rst

Protect yourself from accidentally leaking sensitive information

@barseghyanartur
barseghyanartur / pandoc_convert_howto.md
Last active Jan 11, 2023
Convert .rst to .pdf using `pandoc`
View pandoc_convert_howto.md
pandoc -V geometry:a4paper -V colorlinks=true -f rst --toc -o output.pdf input.rst
@barseghyanartur
barseghyanartur / create-eml-file.py
Created Jan 3, 2023 — forked from jeremykdev/create-eml-file.py
Python script to create an eml file
View create-eml-file.py
# Prototype to create an eml file using python
import os
import uuid
from email import generator
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# where to write the output file
directory = "C:\\Users\\Jeremy\Documents\\python\\email-prototype\\temp"
@barseghyanartur
barseghyanartur / merge_pfds.md
Created Oct 27, 2022
Merge all PDFs in the current directory into one
View merge_pfds.md
pdfunite $(ls -p | grep -v / | tr '\n' ' ') output.pdf
@barseghyanartur
barseghyanartur / script.py
Created May 30, 2022 — forked from ark4n631/script.py
Get a local copy of a file from django storages S3
View script.py
from django.core.files import File
from django.core.files.storage import default_storage, FileSystemStorage
from django.conf import settings
from django.core.files.base import ContentFile
local_storage = FileSystemStorage()
local_storage.base_location = settings.MEDIA_ROOT
def get_local_file_from_object(obj):
@barseghyanartur
barseghyanartur / test_image_upload.py
Created Apr 26, 2022 — forked from guillaumepiot/test_image_upload.py
Django Rest Framework - Image/File upload test
View test_image_upload.py
import os
import io
from PIL import Image
from django.core.urlresolvers import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test import APITestCase
@barseghyanartur
barseghyanartur / flatpak_zoom_version_history.md
Created Mar 22, 2022
See Flatpak Zoom version history and install a specific version
View flatpak_zoom_version_history.md

See the Flapak Zoom version history and install a specific version

List all available zoom versions

Command

flatpak remote-info --log flathub us.zoom.Zoom
View remove_all_remote_branches.md
git branch -r | sed -r 's/origin\///g' | xargs -I {} git push origin :{}
@barseghyanartur
barseghyanartur / instructions.md
Last active Nov 3, 2022
Install virtualenv wrapper on Linux (Ubuntu/Fedora)
View instructions.md

Installation instructions

Install required Linux packages

On Ubuntu

sudo apt-get install python3-virtualenv
sudo apt-get install python3-setuptools
@barseghyanartur
barseghyanartur / travis_to_github_actions_migration.md
Created Dec 1, 2021
How to migrate from travis-ci to github-actions (for Python projects)
View travis_to_github_actions_migration.md

How to migrate from travis-ci to github-actions (for Python projects)

Tested on Python projects only.

Follow the steps below.

Create an .env file with the following context:

.env