Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
barseghyanartur / Copy_protected_DVD_on_Linux.rst
Created June 4, 2024 23:33
Copy protected DVD on Linux

Copy protected DVD on Linux

Identify the volume size

Identify the volume size as follows:

@barseghyanartur
barseghyanartur / Install PyQt5 on Ubuntu with python3 .md
Created May 30, 2024 09:25 — forked from IoTeacher/Install PyQt5 on Ubuntu with python3 .md
Install PyQt5 on Ubuntu with python3. Steps to set up PyQt5 (ubuntu). With python code generation

Instalación en Ubuntu

pip3 install --user pyqt5  
sudo apt-get install python3-pyqt5  
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools

Configurarlo en la terminal

@barseghyanartur
barseghyanartur / open_sublime_text_from_terminal.rst
Last active February 7, 2024 08:55
Open SublimeText from macOs terminal the same way you would do it on Linux

Open SublimeText from macOs terminal the same way you would do it on Linux

  1. Create a sym-link:

    ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /Users/me/.local/bin/subl
@barseghyanartur
barseghyanartur / docker_macos.rst
Last active February 12, 2024 08:37
Docker on macOs

Install Docker and Docker-Compose on macOs

@barseghyanartur
barseghyanartur / middleware.py
Created December 21, 2023 11:34 — forked from SehgalDivij/middleware.py
Middleware in django to log all requests and responses(Inspired by another Github gist I cannot find the link to, now)
"""
Middleware to log all requests and responses.
Uses a logger configured by the name of django.request
to log all requests and responses according to configuration
specified for django.request.
"""
# import json
import logging
from django.utils.deprecation import MiddlewareMixin
@barseghyanartur
barseghyanartur / platform_generate.py
Created December 12, 2023 13:27 — forked from cheind/platform_generate.py
cross platform pip-compile helper
import argparse
import platform
import sys
import subprocess
from pathlib import Path
def describe() -> dict:
meta = {
"python": "py" + ".".join(platform.python_version_tuple()[:2]),
@barseghyanartur
barseghyanartur / caddy.rst
Last active November 13, 2023 09:06
Caddy proxy

Caddy

Installation

sudo snap install caddy --edge
@barseghyanartur
barseghyanartur / create_pdf.py
Last active June 22, 2023 07:47
Create a PDF with 500 pages using `faker-file`
from faker import Faker
from faker_file.base import DynamicTemplate
from faker_file.providers.pdf_file import PdfFileProvider
from faker_file.providers.pdf_file.generators import reportlab_generator
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus import PageBreak, Paragraph
FAKER = Faker()
@barseghyanartur
barseghyanartur / rock_paper_scissors.py
Created February 22, 2023 07:54
Rock, paper, scissors game in Python
"""
Usage:
python rock_paper_scissors.py
"""
import random
__title__ = "rock_paper_scissors"
__version__ = "0.1"
@barseghyanartur
barseghyanartur / install_vera_font_on_linux.md
Last active February 16, 2023 08:06
Install Vera font on Linux